]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fixed "make distuninstallcheck" by removing installed configuration files
authorAlex Rousskov <rousskov@measurement-factory.com>
Fri, 27 Feb 2009 15:25:31 +0000 (08:25 -0700)
committerAlex Rousskov <rousskov@measurement-factory.com>
Fri, 27 Feb 2009 15:25:31 +0000 (08:25 -0700)
iff they are identical to the installed default configuration files.

Added scripts/remove-cfg.sh to do the safe removal because we need that
functionality in many Makefiles.

Made installed mime.conf removal safe. We were removing it without checking
for modifications.

Added commands to remove the following installed default configuration
files: cachemgr.conf.default and msntauth.conf.default.

errors/Makefile.am
helpers/basic_auth/MSNT/Makefile.am
scripts/Makefile.am
scripts/remove-cfg.sh [new file with mode: 0644]
src/Makefile.am
tools/Makefile.am

index 55b5578a350474f57764099cb83b5544dd9c8599..6c2a8a5008ee517b43447b27c620a5f75bc17f82 100644 (file)
@@ -93,7 +93,8 @@ uninstall-local:
                        rm -f $(DESTDIR)$(DEFAULT_ERROR_DIR)/$$l/`basename $$f`; \
                done; \
          fi \
-       done; \
+       done;
+       @$(SHELL) $(top_srcdir)/scripts/remove-cfg.sh $(RM) $(DESTDIR)$(DEFAULT_STYLESHEET)
        rm -f $(DESTDIR)$(DEFAULT_STYLESHEET).default
 
 # undocumented hack.  You can use this target to create multi-lingual
index 81cb45d7c2cb169b61032b2afe340e162c1100d4..1deb9b56acc89f960b4cf8b83134b016b036ea30 100644 (file)
@@ -6,6 +6,7 @@
 #  Uncomment and customize the following to suit your needs:
 #
 
+MSNTAUTH_CONF = $(sysconfdir)/msntauth.conf
 
 libexec_PROGRAMS = msnt_auth
 
@@ -38,9 +39,14 @@ confload.o: confload.c
        $(COMPILE) -DSYSCONFDIR=\"$(sysconfdir)\" -c $(srcdir)/confload.c -o $@
 
 install-data-local:
-       @if test -f $(DESTDIR)$(sysconfdir)/msntauth.conf ; then \
-               echo "$@ will not overwrite existing $(DESTDIR)$(sysconfdir)/msntauth.conf" ; \
+       @if test -f $(DESTDIR)$(MSNTAUTH_CONF) ; then \
+               echo "$@ will not overwrite existing $(DESTDIR)$(MSNTAUTH_CONF)" ; \
        else \
-               echo "$(INSTALL_DATA) $(srcdir)/msntauth.conf.default $(DESTDIR)$(sysconfdir)/msntauth.conf" ; \
-               $(INSTALL_DATA) $(srcdir)/msntauth.conf.default $(DESTDIR)$(sysconfdir)/msntauth.conf ; \
+               echo "$(INSTALL_DATA) $(srcdir)/msntauth.conf.default $(DESTDIR)$(MSNTAUTH_CONF)" ; \
+               $(INSTALL_DATA) $(srcdir)/msntauth.conf.default $(DESTDIR)$(MSNTAUTH_CONF) ; \
        fi
+
+uninstall-local:
+       @$(SHELL) $(top_srcdir)/scripts/remove-cfg.sh $(RM) $(DESTDIR)$(MSNTAUTH_CONF)
+       $(RM) -f $(DESTDIR)$(MSNTAUTH_CONF).default
+
index 4cc88c9ebb247097a00bff945f00ec7d8b41dff0..7947b82c4169b32afbce2e54f0bb777185e7e6b5 100644 (file)
@@ -1,11 +1,7 @@
-#
-#  This file is a Makefile for compiling and installing Cache Manager. 
-#  Cache Manager is a manager program for Internet Object Cache.
-#
-
-
 bin_SCRIPTS = RunCache RunAccel
 EXTRA_DIST     = AnnounceCache.pl access-log-matrix.pl cache-compare.pl \
                cachetrace.pl check_cache.pl convert.configure.to.os2 \
                fileno-to-pathname.pl flag_truncs.pl icp-test.pl \
                icpserver.pl tcp-banger.pl udp-banger.pl upgrade-1.0-store.pl
+
+dist_noinst_SCRIPTS = remove-cfg.sh
diff --git a/scripts/remove-cfg.sh b/scripts/remove-cfg.sh
new file mode 100644 (file)
index 0000000..7b5905f
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+# Removes an configuration file if it is identical to the default file,
+# preventing "make distcheck" failures due to configuration leftovers.
+# Intended to be used for installed configuration files.
+
+remover=$1 # the program to remove a file
+prime=$2   # the configuration file to be removed, including path
+default=$3 # the default configuration filename, including path
+
+# by default, use .default default extension
+if test -z "$default"
+then
+       default="$prime.default"
+fi
+
+# is the primary configuration file present?
+if test -f $prime
+then
+       # is the primary config identical to the default?
+       if diff -q $default $prime > /dev/null
+       then
+               echo " $remover -f $prime";
+                $remover -f $prime;
+        fi
+fi
+
+exit 0
index 6cf1644d1a3290c2ee6f7b6f688ce97310aa625b..d2570621249ce6d71598b9eed312a681f5ccfbc4 100644 (file)
@@ -1118,16 +1118,8 @@ install-data-local: install-sysconfDATA install-dataDATA
        $(mkinstalldirs) $(DESTDIR)$(DEFAULT_LOG_PREFIX)
 
 uninstall-local:
-       @if test -f $(DESTDIR)$(DEFAULT_MIME_TABLE) ; then \
-               echo "rm -f $(DESTDIR)$(DEFAULT_MIME_TABLE)"; \
-               $(RM) -f $(DESTDIR)$(DEFAULT_MIME_TABLE); \
-       fi
-
-# Don't automatically uninstall config files
-#      @if test -f $(DESTDIR)$(DEFAULT_CONFIG_FILE) ; then \
-#              echo "rm -f $(DESTDIR)$(DEFAULT_CONFIG_FILE)"; \
-#              $(RM) -f $(DESTDIR)$(DEFAULT_CONFIG_FILE); \
-#      fi
+       @$(SHELL) $(top_srcdir)/scripts/remove-cfg.sh $(RM) $(DESTDIR)$(DEFAULT_MIME_TABLE)
+       @$(SHELL) $(top_srcdir)/scripts/remove-cfg.sh $(RM) $(DESTDIR)$(DEFAULT_CONFIG_FILE)
 
 CLEANFILES = cf_gen_defines.h cf.data cf_parser.h squid.conf.default squid.conf.documented \
        globals.cc string_arrays.c repl_modules.cc DiskIO/DiskIOModules_gen.cc \
index 45718d2d536ffc5acee5faa64957a9b6309d0488..9b8dda7cd17d7128787f475ab1ddf92293ec0bd1 100644 (file)
@@ -64,12 +64,8 @@ install-data-local:
        fi
 
 uninstall-local:
-
-# Don't automatically uninstall config files
-#      @if test -f $(DESTDIR)$(DEFAULT_CONFIG_FILE) ; then \
-#              echo "rm -f $(DESTDIR)$(DEFAULT_CONFIG_FILE)"; \
-#              $(RM) -f $(DESTDIR)$(DEFAULT_CONFIG_FILE); \
-#      fi
+       @$(SHELL) $(top_srcdir)/scripts/remove-cfg.sh $(RM) $(DESTDIR)$(DEFAULT_CACHEMGR_CONFIG)
+       $(RM) -f $(DESTDIR)$(DEFAULT_CACHEMGR_CONFIG).default
 
 DISTCLEANFILES =