From c25152b4553803135788553aa57892775e92f1cc Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 9 Oct 2007 09:33:48 +0200 Subject: 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. --- ChangeLog | 8 ++++++++ src/Makefile.am | 40 +++++++++++++++++++++++----------------- 2 files changed, 31 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index f6d6da7b8..d720013ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-10-09 Jim Meyering + + 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. + 2007-10-08 Jim Meyering When forming a truncated name, use the "[...]" prefix even for 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 -- cgit v1.2.3-70-g09d2