tags 648433 + patch
thanks

On Fri, Nov 11, 2011 at 03:19:24PM +0100, Petter Reinholdtsen wrote:
> [Christoph Anton Mitterer]
> > Hi.
> > 
> > When the default /etc/default/rcS changes,... those changes get not
> > propagated somehow to the user.
> 
> As far as I know, any changes to the package version of that file are
> carefully made to ensure that it do not matter that the old files are
> not updated.  What problem are you experiencing?

I've attached a patch to update /etc/default/rcS from the new
defaults.rcS if certain conditions are met.  Essentially, its
sha1sum must match a version of the previous defaults, so we can
be sure that the user did not modify it.  If this is true, we do
the update.

I'm still unsure why it can't be made a proper conffile.  Other
than initial install (setting UTC), is it ever edited automatically?
Surely if it's changed from the default, the dpkg conffile handling
would handle this perfectly well?


Regards,
Roger

-- 
  .''`.  Roger Leigh
 : :' :  Debian GNU/Linux             http://people.debian.org/~rleigh/
 `. `'   Printing on GNU/Linux?       http://gutenprint.sourceforge.net/
   `-    GPG Public Key: 0x25BFB848   Please GPG sign your mail.
diff --git a/debian/initscripts.postinst b/debian/initscripts.postinst
index 37682bc..60b5444 100755
--- a/debian/initscripts.postinst
+++ b/debian/initscripts.postinst
@@ -121,6 +121,48 @@ then
 fi
 
 #
+# If rcS file has not been modified from a previous default, update it
+# to the latest version.  Note that the list was generated from the
+# git repository using the following shell commands:
+#
+# for file in debian/src/initscripts/share/default.rcS debian/initscripts/share/default.rcS; do
+#     git log --format="%H" -- "$file" | while read commit; do
+# 	filehash="$(git ls-tree "$commit" "$file" | cut -d ' ' -f 3 | cut -f 1)"
+# 	if [ -n "$filehash" ]; then
+# 	    git show "$filehash" | sha1sum
+# 	fi
+#     done
+# done | cut -d ' '  -f 1 | sort | uniq
+#
+# This list should not include the current sha1sum, or else it will
+# try to update the unchanged file on future upgrades.  This is listed
+# separately as a no-op.
+#
+rcShash="$(sha1sum /etc/default/rcS | cut -d ' ' -f 1)"
+case "$rcShash" in
+	093a44fc4d3bf71a9e0db72d77725d9e7b8a6e50 | \
+	1015bb356f45a1827dbb950cd683fa8457dfbde9 | \
+	1aeb1b2ec69e4e04dc18e7f40b43846e3f059536 | \
+	4236f10374de5a4f3b08e658526b5b7877ccb65e | \
+	594595e22dbb6ceaf7c27118d793b372ee47d266 | \
+	5c14126591302229891be0f2c2a19f64359d71ff | \
+	67d92e4240a1e19f341228910b912f34fa763e4e | \
+	8f438a9b327e87930bcbc0d3ed05f5771e326b04 | \
+	9ef7a3897c1962418241b014e843148a015bf478 | \
+	c432715638e2456135203fed86b58587d6409d29 | \
+	d09dce2de70c56d4b738bcf32e2eabc6fde23aa7 | \
+	dec43dd15916fc8ac249cf6872cbc4a3a9b8b9ad)
+		echo "Installing new version of config file /etc/default/rcS ... (not modified by user)"
+		cp -p /usr/share/initscripts/default.rcS /etc/default/rcS
+		;;
+	3ead47692317baed2c3777cd9698553508718ecc)
+		echo "Not installing new version of config file /etc/default/rcS (already at latest version)"
+		;;
+	*)
+		echo "Not installing new version of config file /etc/default/rcS (modified by user)"
+esac
+
+#
 # In 2.86.ds1-7 the "single" script was moved.
 # We have to remove the old links _before_ we install new ones.
 #

Reply via email to