From: Todd C. Miller Date: Fri, 8 Jul 2016 18:56:47 +0000 (-0600) Subject: Only remove backup files as part of "make uninstall" when INSTALL_BACKUP X-Git-Tag: SUDO_1_8_18^2~126 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6f5b8cf757958ad013db348649774f21ae62c509;p=sudo Only remove backup files as part of "make uninstall" when INSTALL_BACKUP is set. --- diff --git a/lib/util/Makefile.in b/lib/util/Makefile.in index 59a581bed..a241e63ed 100644 --- a/lib/util/Makefile.in +++ b/lib/util/Makefile.in @@ -229,6 +229,8 @@ install-plugin: uninstall: $(LIBTOOL) $(LTFLAGS) --mode=uninstall rm -f $(DESTDIR)$(libexecdir)/sudo/libsudo_util.la + -test -z "$(INSTALL_BACKUP)" || \ + rf -f $(DESTDIR)$(libexecdir)/sudo/libsudo_util.*~ splint: splint $(SPLINT_OPTS) -I$(incdir) -I$(top_builddir) -I$(top_srcdir) $(srcdir)/*.c diff --git a/lib/zlib/Makefile.in b/lib/zlib/Makefile.in index 22f6601d6..1557a65fb 100644 --- a/lib/zlib/Makefile.in +++ b/lib/zlib/Makefile.in @@ -134,6 +134,8 @@ install-plugin: uninstall: $(LIBTOOL) $(LTFLAGS) --mode=uninstall rm -f $(DESTDIR)$(libexecdir)/sudo/libsudo_z.la + -test -z "$(INSTALL_BACKUP)" || \ + rf -f $(DESTDIR)$(libexecdir)/sudo/libsudo_z.*~ splint: diff --git a/plugins/group_file/Makefile.in b/plugins/group_file/Makefile.in index fddb90e80..24a34ae15 100644 --- a/plugins/group_file/Makefile.in +++ b/plugins/group_file/Makefile.in @@ -139,7 +139,8 @@ install-plugin: install-dirs group_file.la uninstall: -$(LIBTOOL) $(LTFLAGS) --mode=uninstall rm -f $(DESTDIR)$(plugindir)/group_file.la - -rm -f $(DESTDIR)$(plugindir)/group_file.so~ + -test -z "$(INSTALL_BACKUP)" || \ + rm -f $(DESTDIR)$(plugindir)/group_file.so$(INSTALL_BACKUP) splint: splint $(SPLINT_OPTS) -I$(incdir) -I$(top_builddir) -I$(top_srcdir) $(srcdir)/*.c diff --git a/plugins/sample/Makefile.in b/plugins/sample/Makefile.in index 4230bd696..e5bcad3fc 100644 --- a/plugins/sample/Makefile.in +++ b/plugins/sample/Makefile.in @@ -138,7 +138,8 @@ install-plugin: install-dirs sample_plugin.la uninstall: -$(LIBTOOL) $(LTFLAGS) --mode=uninstall rm -f $(DESTDIR)$(plugindir)/sample_plugin.la - -rm -f $(DESTDIR)$(plugindir)/sample_plugin.so~ + -test -z "$(INSTALL_BACKUP)" || \ + rm -f $(DESTDIR)$(plugindir)/sample_plugin.so$(INSTALL_BACKUP) splint: splint $(SPLINT_OPTS) -I$(incdir) -I$(top_builddir) -I$(top_srcdir) $(srcdir)/*.c diff --git a/plugins/sudoers/Makefile.in b/plugins/sudoers/Makefile.in index 7f2c96e2c..626965643 100644 --- a/plugins/sudoers/Makefile.in +++ b/plugins/sudoers/Makefile.in @@ -345,10 +345,11 @@ install-sudoers: install-dirs uninstall: -$(LIBTOOL) $(LTFLAGS) --mode=uninstall rm -f $(DESTDIR)$(plugindir)/sudoers.la -rm -f $(DESTDIR)$(replaydir)/sudoreplay \ - $(DESTDIR)$(replaydir)/sudoreplay~ \ - $(DESTDIR)$(visudodir)/visudo \ - $(DESTDIR)$(visudodir)/visudo~ \ - $(DESTDIR)$(plugindir)/sudoers.so~ + $(DESTDIR)$(visudodir)/visudo + -test -z "$(INSTALL_BACKUP)" || \ + $(DESTDIR)$(replaydir)/sudoreplay$(INSTALL_BACKUP) \ + $(DESTDIR)$(visudodir)/visudo$(INSTALL_BACKUP) \ + $(DESTDIR)$(plugindir)/sudoers.so$(INSTALL_BACKUP) -cmp $(DESTDIR)$(sudoersdir)/sudoers $(srcdir)/sudoers >/dev/null && \ rm -f $(DESTDIR)$(sudoersdir)/sudoers diff --git a/plugins/system_group/Makefile.in b/plugins/system_group/Makefile.in index 1635d3b42..141aede5c 100644 --- a/plugins/system_group/Makefile.in +++ b/plugins/system_group/Makefile.in @@ -139,7 +139,8 @@ install-plugin: install-dirs system_group.la uninstall: -$(LIBTOOL) $(LTFLAGS) --mode=uninstall rm -f $(DESTDIR)$(plugindir)/system_group.la - -rm -f $(DESTDIR)$(plugindir)/system_group.so~ + -test -z "$(INSTALL_BACKUP)" || \ + rm -f $(DESTDIR)$(plugindir)/system_group.so$(INSTALL_BACKUP) splint: splint $(SPLINT_OPTS) -I$(incdir) -I$(top_builddir) -I$(top_srcdir) $(srcdir)/*.c diff --git a/src/Makefile.in b/src/Makefile.in index 8f2c45860..cc92943fc 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -194,13 +194,14 @@ install-plugin: uninstall: -$(LIBTOOL) $(LTFLAGS) --mode=uninstall rm -f $(DESTDIR)$(noexecdir)/sudo_noexec.la -rm -f $(DESTDIR)$(bindir)/sudo \ - $(DESTDIR)$(bindir)/sudo~ \ $(DESTDIR)$(bindir)/sudoedit \ $(DESTDIR)$(libexecdir)/sudo/sesh \ - $(DESTDIR)$(libexecdir)/sudo/sesh~ \ - $(DESTDIR)$(noexecdir)/sudo_noexec.so~ \ $(DESTDIR)/usr/lib/tmpfiles.d/sudo.conf - -test -n "$(INIT_SCRIPT)" && \ + -test -z "$(INSTALL_BACKUP)" || \ + rm -f $(DESTDIR)$(bindir)/sudo$(INSTALL_BACKUP) \ + $(DESTDIR)$(libexecdir)/sudo/sesh$(INSTALL_BACKUP) \ + $(DESTDIR)$(noexecdir)/sudo_noexec.so$(INSTALL_BACKUP) + -test -z "$(INIT_SCRIPT)" || \ rm -f $(DESTDIR)$(RC_LINK) $(DESTDIR)$(INIT_DIR)/sudo splint: