[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#230857: patch for thought



This is an experimental patch (against CVS) which attempts to handle
upgrading from any libc version whether or not initscripts has been updated.
It's a little hackish, and it's probably not quite the right thing,
and I'm not really up to testing it, but I hope it helps.  :-)  It does
depend on upgraded initscripts 'adopting' mountvirtfs; I'm not really
sure whether it does that or not.

--- libc.preinst	2004-03-17 17:34:57.000000000 -0500
+++ libc.preinst.new	2004-03-17 18:16:39.000000000 -0500
@@ -54,11 +54,39 @@
 	if [ -e /var/run/utmpd.ro ]; then rm -f /var/run/utmpd.ro; fi
 	if [ -e /var/run/utmpd.rw ]; then rm -f /var/run/utmpd.rw; fi
     fi
-    if dpkg --compare-versions "$2" lt 2.3.2.ds1-11; then
-	mv /etc/init.d/devpts.sh /etc/init.d/mountkernfs
-    elif dpkg --compare-versions "$2" eq 2.3.2.ds1-11; then
-	rm /etc/init.d/devpts.sh
+
+    # Remove obsolete mountvirtfs conffile.
+    if [ -f /etc/init.d/devpts.sh ] ; then
+	if [ ! -f /etc/init.d/mountvirtfs ] \
+	   && dpkg --compare-versions "$2" lt 2.3.2.ds1-11; then
+	    # Initscripts is << 2.85-10, and this is the old equivalent
+	    # of mountvirtfs.  Move it to where initscripts
+	    # will overwrite it when initscripts is upgraded.
+	    mv /etc/init.d/devpts.sh /etc/init.d/mountvirtfs
+            update-rc.d mountvirtfs start 02 S > /dev/null
+	else
+	    # Just get the old file out of the way.
+	    chmod ugo-x /etc/init.d/devpts.sh
+	    mv /etc/init.d/devpts.sh /etc/init.d/devpts.sh.dpkg-old
+	fi
+    fi
+    update-rc.d devpts.sh remove > /dev/null
+
+    # Remove obsolete mountkernfs conffile.
+    if [ -f /etc/init.d/mountkernfs ] ; then
+	if [ ! -f /etc/init.d/mountvirtfs ] \
+	   && dpkg --compare-versions "$2" eq 2.3.2.ds1-11; then
+	    # Initscripts is << 2.85-10, and this is the old equivalent
+	    # of mountvirtfs.  Move it to where initscripts
+	    # will overwrite it when initscripts is upgraded.
+            mv /etc/init.d/mountkernfs /etc/init.d/mountvirtfs
+            update-rc.d mountvirtfs start 02 S > /dev/null
+	else
+	    chmod ugo-x /etc/init.d/mountkernfs
+	    mv /etc/init.d/mountkernfs /etc/init.d/mountkernfs.dpkg-old
+	fi
     fi
+    update-rc.d mountkernfs remove > /dev/null
 
     # NSS authentication trouble guard
     if dpkg --compare-versions $2 lt 2.3.2-2; then

-- 
Make sure your vote will count.
http://www.verifiedvoting.org/



Reply to: