Hello,
Please review the attached patch. The patched Makefiles delete
installed configuration files, restoring functionality removed from
Squid some time ago, but hopefully in a safer manner. This is the
cleanest way I could find to make "make distcheck" work again (with the
other pending SourceLayout changes).
-------- change log ------------------
Made "make distuninstallcheck" work:
Fixed "make distuninstallcheck" by removing installed configuration
files 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.
--------------------------------------------
Thank you,
Alex.
bb:approve
=== modified file 'errors/Makefile.am'
--- errors/Makefile.am 2009-02-25 04:08:59 +0000
+++ errors/Makefile.am 2009-02-26 22:30:53 +0000
@@ -93,7 +93,8 @@
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
=== modified file 'helpers/basic_auth/MSNT/Makefile.am'
--- helpers/basic_auth/MSNT/Makefile.am 2009-02-18 12:26:04 +0000
+++ helpers/basic_auth/MSNT/Makefile.am 2009-02-26 22:41:20 +0000
@@ -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 @@
$(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
+
=== modified file 'scripts/Makefile.am'
--- scripts/Makefile.am 2001-08-31 17:19:04 +0000
+++ scripts/Makefile.am 2009-02-26 23:11:14 +0000
@@ -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
=== added file 'scripts/remove-cfg.sh'
--- scripts/remove-cfg.sh 1970-01-01 00:00:00 +0000
+++ scripts/remove-cfg.sh 2009-02-26 22:45:09 +0000
@@ -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
=== modified file 'src/Makefile.am'
--- src/Makefile.am 2009-02-20 00:14:30 +0000
+++ src/Makefile.am 2009-02-26 21:49:29 +0000
@@ -1118,16 +1118,8 @@
$(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 \
=== modified file 'tools/Makefile.am'
--- tools/Makefile.am 2009-02-18 00:18:43 +0000
+++ tools/Makefile.am 2009-02-26 23:23:54 +0000
@@ -64,12 +64,8 @@
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 =