diff options
author | Jim Meyering <meyering@redhat.com> | 2007-10-09 09:33:48 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2007-10-09 09:35:30 +0200 |
commit | c25152b4553803135788553aa57892775e92f1cc (patch) | |
tree | c2da86424a360e28cb33b22325d687256592db98 /src | |
parent | e6f4b28275316895ad8808a9d0abcc468df8780b (diff) | |
download | coreutils-c25152b4553803135788553aa57892775e92f1cc.tar.xz |
Now that we don't install su, don't make misleading suggestions.
* src/Makefile.am (install-exec-local) [$(INSTALL_SU) != yes]:
Don't suggest running "make install-root".
(uninstall-local) [$(INSTALL_SU) != yes]: Don't even check
the installed binary.
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 40 |
1 files changed, 23 insertions, 17 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index fc3c7a1d4..bc67ff2b8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -182,29 +182,35 @@ install-root: su$(EXEEXT) @$(install_su) install-exec-local: su$(EXEEXT) - @TMPFILE=$(DESTDIR)$(bindir)/.su-$$$$; \ - rm -f $$TMPFILE; \ - echo > $$TMPFILE; \ + @if test "$(INSTALL_SU)" = yes; then \ + TMPFILE=$(DESTDIR)$(bindir)/.su-$$$$; \ + rm -f $$TMPFILE; \ + echo > $$TMPFILE; \ ## See if we can create a setuid root executable in $(bindir). ## If not, then don't even try to install su. - can_create_suid_root_executable=no; \ - chown root $$TMPFILE > /dev/null 2>&1 \ - && chmod $(setuid_root_mode) $$TMPFILE > /dev/null 2>&1 \ - && can_create_suid_root_executable=yes; \ - rm -f $$TMPFILE; \ - if test $$can_create_suid_root_executable = yes; then \ - $(install_su); \ - else \ - echo "WARNING: insufficient access; not installing su"; \ - echo "NOTE: to install su, run 'make install-root' as root"; \ + can_create_suid_root_executable=no; \ + chown root $$TMPFILE > /dev/null 2>&1 \ + && chmod $(setuid_root_mode) $$TMPFILE > /dev/null 2>&1 \ + && can_create_suid_root_executable=yes; \ + rm -f $$TMPFILE; \ + if test $$can_create_suid_root_executable = yes; then \ + $(install_su); \ + else \ + echo "WARNING: insufficient access; not installing su"; \ + echo "NOTE: to install su, run 'make install-root' as root"; \ + fi; \ + else :; \ fi uninstall-local: # Remove su only if it's one we installed. - @if grep '$(PACKAGE_NAME)' $(installed_su) > /dev/null 2>&1; then \ - echo " rm -f $(installed_su)"; \ - rm -f $(installed_su); \ - else :; fi + @if test "$(INSTALL_SU)" = yes; then \ + if grep '$(PACKAGE_NAME)' $(installed_su) > /dev/null 2>&1; then \ + echo " rm -f $(installed_su)"; \ + rm -f $(installed_su); \ + else :; \ + fi; \ + fi copy_sources = copy.c cp-hash.c |