severity 518247 important
user [email protected]
usertags 518247 ubuntu-patch karmic
thanks

Hola agi,

Please find attached a patch that addresses the removal of update-modules,
and also drops the irnet alias from the irda-utils modprobe.d file, while
renaming the config file to use a .conf extension as expected by recent
versions of module-init-tools (and required by future versions).

I'm not dropping the file entirely as suggested by Marco, because I can't
actually find any detailed evidence that the other directives are indeed
obsolete.

Cheers,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
[email protected]                                     [email protected]
diff -u irda-utils-0.9.18/debian/preinst irda-utils-0.9.18/debian/preinst
--- irda-utils-0.9.18/debian/preinst
+++ irda-utils-0.9.18/debian/preinst
@@ -8,6 +8,9 @@
 CONFIG_OLD="/etc/irda.conf"
 MODULES_24_OLD="/etc/modutils/irda"
 MODULES_26_OLD="/etc/modprobe.d/irda"
+MODULES_26_NEWER="/etc/modprobe.d/$PACKAGE"
+MODULES_26="${MODULES_26_NEWER}.conf"
+MODULES_24="/etc/modutils/$PACKAGE"
 INIT_OLD="/etc/init.d/irda"
 PREV="$2"
 
@@ -15,6 +18,18 @@
 
 . /usr/share/debconf/confmodule || exit 0
 
+if dpkg --compare-versions "$2" lt-nl 0.9.18-8.1ubuntu2
+then
+	if [ -e $MODULES_26_NEWER ]
+	then
+		mv $MODULES_26_NEWER $MODULES_26
+	fi
+	if [ -e $MODULES_24 ]
+	then
+		rm $MODULES_24
+	fi
+fi
+
 # save data from $CONFIG_OLD to debconf
 if [ -f "$CONFIG_OLD" ]; then # package version < 0.9.16-5
     ENABLE="true"
diff -u irda-utils-0.9.18/debian/changelog irda-utils-0.9.18/debian/changelog
--- irda-utils-0.9.18/debian/changelog
+++ irda-utils-0.9.18/debian/changelog
@@ -1,3 +1,28 @@
+irda-utils (0.9.18-8.1ubuntu3) karmic; urgency=low
+
+  * Per Debian bug #518247, drop 'alias irnet' from
+    /etc/modprobe.d/irda-utils.conf because it's never needed.
+
+ -- Steve Langasek <[email protected]>  Thu, 28 May 2009 09:37:03 +0000
+
+irda-utils (0.9.18-8.1ubuntu2) karmic; urgency=low
+
+  [ Daniele Napolitano ]
+  * debian/postinst: remove call to update-modules, which was deprecated long
+    ago and is no longer shipped by module-init-tools.  LP: #340718.
+  * debian/postinst: invoke MAKEDEV, not /dev/MAKEDEV, since the latter is
+    obsolete.
+
+  [ Steve Langasek ]
+  * debian/postinst, debian/postrm: rename /etc/modprobe.d/irda-utils to
+    /etc/modprobe.d/irda-utils.conf, as required by current
+    module-init-tools.  LP: #340873.
+  * debian/preinst: handle migrating the modprobe.d filename on upgrade.
+  * debian/preinst: remove config file for Linux 2.4 kernels on upgrade.
+  * debian/postinst, debian/postrm: drop obsolete handling of modutils.
+
+ -- Steve Langasek <[email protected]>  Tue, 26 May 2009 10:53:59 +0000
+
 irda-utils (0.9.18-8.1ubuntu1) intrepid; urgency=low
 
   * Merge from debian unstable, remaining changes:
diff -u irda-utils-0.9.18/debian/postinst irda-utils-0.9.18/debian/postinst
--- irda-utils-0.9.18/debian/postinst
+++ irda-utils-0.9.18/debian/postinst
@@ -5,43 +5,15 @@
 
 PACKAGE="irda-utils"
 CONFIG="/etc/default/$PACKAGE"
-MODFILE_24="/etc/modutils/$PACKAGE"
-MODFILE_26="/etc/modprobe.d/$PACKAGE"
+MODFILE_26="/etc/modprobe.d/${PACKAGE}.conf"
 
 set -e
 . /usr/share/debconf/confmodule
 
 
 write_config_modules () {
-    if [ ! -e $MODFILE_24 ]; then
-        cat <<EOF > $MODFILE_24
-alias tty-ldisc-11 irtty
-alias char-major-161 ircomm-tty
-alias char-major-60 ircomm_tty
-
-
-# For dongles
-alias irda-dongle-0 tekram
-alias irda-dongle-1 esi
-alias irda-dongle-2 actisys
-alias irda-dongle-3 actisys
-alias irda-dongle-4 girbil
-alias irda-dongle-5 litelink
-alias irda-dongle-6 airport
-alias irda-dongle-7 old_belkin
-alias irda-dongle-11 ma600
-
-
-# For FIR device
-EOF
-    fi
-
     if [ ! -e $MODFILE_26 ]; then
         cat <<EOF > $MODFILE_26
-# Other aliases are defined in the modules themselves
-alias char-major-10-187 irnet
-
-
 # For FIR device
 
 EOF
@@ -58,19 +30,13 @@
 
 
     # remove old options/aliases
-    cp -a -f $MODFILE_24 $MODFILE_24.tmp
     cp -a -f $MODFILE_26 $MODFILE_26.tmp
 
     sed -e "
-        s/.*options.*//g
-        s/.*alias irda0.*//g
-    " < $MODFILE_24 > $MODFILE_24.tmp
-    cat -s $MODFILE_24.tmp > $MODFILE_24
-    rm $MODFILE_24.tmp
-
-    sed -e "
-        s/.*options.*//g
-        s/.*alias irda0.*//g
+        /.*options.*/d
+        /.*alias irda0.*/d
+	/^# Other aliases are defined/d
+	/.*alias char-major-10-187 irnet/d
     " < $MODFILE_26 > $MODFILE_26.tmp
     cat -s $MODFILE_26.tmp > $MODFILE_26
     rm $MODFILE_26.tmp
@@ -78,18 +44,13 @@
 
     # insert new options/aliases
     if [ "$DEVICE" = "serial" ]; then
-        echo "#options $firdev $firopt" >> $MODFILE_24
-        echo "#alias irda0 $firdev" >> $MODFILE_24
         echo "#options $firdev26 $firopt" >> $MODFILE_26
         echo "#alias irda0 $firdev26" >> $MODFILE_26
     else
-        echo "options $firdev $firopt" >> $MODFILE_24
-        echo "alias irda0 $firdev" >> $MODFILE_24
         echo "options $firdev26 $firopt" >> $MODFILE_26
         echo "alias irda0 $firdev26" >> $MODFILE_26
     fi
 
-    update-modules # will be removed after modutils got removed.
 }
 
 
@@ -114,7 +75,7 @@
 
 # Set IRDA device to access (e.g. /dev/ttyS1 or irda0).
 # In case of irda0, the proper module for FIR-mode has to be set in
-# $MODFILE_24 (2.4) or $MODFILE_26 (2.6)
+# $MODFILE_26
 DEVICE=
 
 # Set dongle type, e.g. none, tekram, esi, actisys, actisys+, ep7211, girbil,
@@ -181,7 +142,7 @@
 
 if [ "$1" = "configure" ]; then
 
-    cd /dev && ./MAKEDEV irda && ./MAKEDEV irnet
+    cd /dev && MAKEDEV irda && MAKEDEV irnet
 
     db_get $PACKAGE/selectdevice
     DEVICE=$RET
diff -u irda-utils-0.9.18/debian/postrm irda-utils-0.9.18/debian/postrm
--- irda-utils-0.9.18/debian/postrm
+++ irda-utils-0.9.18/debian/postrm
@@ -4,8 +4,7 @@
 # This file is hereby placed into the public domain.
 
 PACKAGE="irda-utils"
-MODULES_24="/etc/modutils/$PACKAGE"
-MODULES_26="/etc/modprobe.d/$PACKAGE"
+MODULES_26="/etc/modprobe.d/${PACKAGE}.conf"
 CONFIG="/etc/default/$PACKAGE"
 
 if [ -f /usr/share/debconf/confmodule ]; then
@@ -14,7 +13,6 @@
 
 if [ $1 = "purge" ]; then
     # remove configuration files
-    if [ -e $MODULES_24 ]; then rm $MODULES_24; fi
     if [ -e $MODULES_26 ]; then rm $MODULES_26; fi
     if [ -e $CONFIG ]; then rm $CONFIG; fi
 fi

Reply via email to