[SCM] OSS compatibility package branch, master, updated. debian/0.0.4+nmu3-16-ge9fc99d

Stephen Kitt steve at sk2.org
Sun Jan 15 13:13:49 UTC 2012


The following commit has been merged in the master branch:
commit 17d4c34113e00431fd2711db032c982767de66c6
Author: Stephen Kitt <steve at sk2.org>
Date:   Sat Jan 14 11:46:14 2012 +0100

    Make /etc/modprobe.d/oss-compat.conf a file, handling the various upgrade cases, and only removing it on purge. (Closes: #649507.)

diff --git a/debian/changelog b/debian/changelog
index 02279fd..1317353 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,10 +1,12 @@
 oss-compat (1) unstable; urgency=low
 
-  * Switch to single-digit versions.
+  * Switch to single-component versions.
   * Declare the package is "Multi-Arch: foreign", thanks to Steve Langasek
     for the hint! (Closes: #651335.)
+  * Make /etc/modprobe.d/oss-compat.conf a file, handling the various
+    upgrade cases, and only removing it on purge. (Closes: #649507.)
 
- -- Stephen Kitt <steve at sk2.org>  Sat, 10 Dec 2011 14:02:45 +0100
+ -- Stephen Kitt <steve at sk2.org>  Sat, 14 Jan 2012 11:41:40 +0100
 
 oss-compat (0.0.6) unstable; urgency=low
 
diff --git a/debian/postinst b/debian/postinst
index ff3f7d2..e0fe783 100644
--- a/debian/postinst
+++ b/debian/postinst
@@ -5,11 +5,33 @@ case "$1" in
   configure)
     case "`uname -s`" in
       Linux)
-        # Remove symlink on upgrades. Newer versions of module-init-tools
-        # require a .conf suffix.
-        [ -L /etc/modprobe.d/oss-compat ] && rm -f /etc/modprobe.d/oss-compat
-
-        ln -sf /lib/oss-compat/linux /etc/modprobe.d/oss-compat.conf
+        # There are three points to consider when upgrading or installing:
+        #   - current versions of module-init-tools require configuration
+        #     files to have a .conf suffix;
+        #   - policy requires changes to configuration to be preserved
+        #   - policy forbids including configuration outside of /etc
+        curconffile=/etc/modprobe.d/oss-compat.conf
+        oldconffile=/etc/modprobe.d/oss-compat
+        if [ ! -f ${curconffile} -o -L ${curconffile} ]; then
+          if [ -L ${curconffile} ]; then
+            # Upgrading from previous testing/unstable version
+            curlinktgt=$(readlink -f ${curconffile})
+            rm -f ${curconffile}
+            cp ${curlinktgt} ${curconffile}
+          elif [ -L ${oldconffile} ]; then
+            # Upgrading from stable, link
+            curlinktgt=$(readlink -f ${oldconffile})
+            cp ${curlinktgt} ${curconffile}
+          elif [ -f ${oldconffile} ]; then
+            # Upgrading from stable, file
+            cp ${oldconffile} ${curconffile}
+          else
+            # Installing from scratch
+            cp /lib/oss-compat/linux ${curconffile}
+          fi
+        fi
+        # Cleanup stable configuration link
+        [ -L ${oldconffile} ] && rm -f ${oldconffile}
 
         if lsmod | grep -q "^snd " ; then
           modprobe snd || true
diff --git a/debian/prerm b/debian/postrm
similarity index 95%
rename from debian/prerm
rename to debian/postrm
index 9281023..3ecab99 100644
--- a/debian/prerm
+++ b/debian/postrm
@@ -2,7 +2,7 @@
 set -e
 
 case "$1" in
-  remove)
+  purge)
     rm -f /etc/modprobe.d/oss-compat.conf
   ;;
 esac

-- 
OSS compatibility package



More information about the Pkg-games-commits mailing list