[Pkg-sysvinit-commits] r587 - sysvinit/trunk/debian/initscripts
Thomas Hood
jdthood-guest at costa.debian.org
Wed Jan 11 15:42:47 UTC 2006
Author: jdthood-guest
Date: 2006-01-11 15:42:46 +0000 (Wed, 11 Jan 2006)
New Revision: 587
Modified:
sysvinit/trunk/debian/initscripts/postinst
sysvinit/trunk/debian/initscripts/preinst
Log:
Use www.dpkg.org code to deal with obsoleted conffile bootclean.sh
Modified: sysvinit/trunk/debian/initscripts/postinst
===================================================================
--- sysvinit/trunk/debian/initscripts/postinst 2006-01-11 12:59:54 UTC (rev 586)
+++ sysvinit/trunk/debian/initscripts/postinst 2006-01-11 15:42:46 UTC (rev 587)
@@ -130,15 +130,6 @@
updatercd stop-bootlogd-single start 99 S .
updatercd stop-bootlogd start 99 2 3 4 5 .
-#
-# Indicate that bootclean.sh is no longer used
-# (It has been replaced by bootclean.)
-#
-if [ -f /etc/init.d/bootclean.sh ]
-then
- chmod ugo-x /etc/init.d/bootclean.sh
- mv /etc/init.d/bootclean.sh /etc/init.d/bootclean.sh.dpkg-old
-fi
#
# Remove scripts that were left behind by older glibc (<< 2.3.2.ds1-12)
@@ -153,6 +144,9 @@
fi
done
+#
+# Mount virtual filesystems
+#
if [ -x /etc/init.d/mountvirtfs ]
then
if which invoke-rc.d >/dev/null 2>&1
Modified: sysvinit/trunk/debian/initscripts/preinst
===================================================================
--- sysvinit/trunk/debian/initscripts/preinst 2006-01-11 12:59:54 UTC (rev 586)
+++ sysvinit/trunk/debian/initscripts/preinst 2006-01-11 15:42:46 UTC (rev 587)
@@ -3,12 +3,43 @@
# initscripts preinst
#
+
+# Remove a no-longer used conffile
+#
+# $1: conffile
+#
+# If the argument was not listed as a conffile, silently do nothing.
+# Adapted from code obtained from www.dpkg.org/ConffileHandling
+rm_conffile() {
+ CONFFILE="$1"
+
+ if [ -e "$CONFFILE" ]; then
+ CURRENT_MD5SUM="$(md5sum "$CONFFILE" | sed -e "s/ .*//")"
+ FACTORY_MD5SUM="$(sed -n -e "/^Conffiles:/,/^[^ ]/{\\' $CONFFILE'{s/.* //;p}}" /var/lib/dpkg/status)"
+ if [ "$CURRENT_MD5SUM" != "$FACTORY_MD5SUM" ]; then
+ echo "Renaming obsolete modified conffile to '${CONFFILE}.dpkg-old'."
+ mv -f "$CONFFILE" "$CONFFILE".dpkg-old
+ else
+ echo "Removing obsolete unmodified conffile ${CONFFILE}."
+ rm -f "$CONFFILE"
+ fi
+ fi
+}
+
case "$1" in
install|upgrade)
+ #
# /etc/init.d/stop-bootlogd used to be a symlink to bootlogd;
# now it is a separate script. We need to remove the symlink here,
# before dpkg installs the /etc/init.d/stop-bootlogd file.
+ #
[ -L /etc/init.d/stop-bootlogd ] && rm -f /etc/init.d/stop-bootlogd
+ #
+ # Remove obsolete conffiles
+ #
+ if dpkg --compare-versions "$2" le "2.86.ds1-9" ; then
+ rm_conffile "/etc/init.d/bootclean.sh"
+ fi
;;
abort-upgrade)
exit 0
More information about the Pkg-sysvinit-commits
mailing list