]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Remove the openafs module from DKMS if necessary before adding
authorRuss Allbery <rra@debian.org>
Wed, 4 Nov 2009 05:44:55 +0000 (21:44 -0800)
committerRuss Allbery <rra@debian.org>
Wed, 4 Nov 2009 05:44:55 +0000 (21:44 -0800)
* In the postinst of openafs-modules-dkms, if the openafs module is
  already added in DKMS, try to remove it first before adding it.  This
  should more correctly handle the case of a user installing this
  package without the correct kernel headers, having it fail in
  postinst, and then installing the correct headers and having dpkg
  attempt to configure the package again.  Thanks, Philipp Kaluza.
  (Closes: #553542)

debian/changelog
debian/openafs-modules-dkms.postinst

index 1f137a79da5be05f6ba433ed1d9b4455e44a7518..3b10278ab050783a391752893333c4e0dc41d92a 100644 (file)
@@ -13,6 +13,13 @@ openafs (1.4.11+dfsg-5) UNRELEASED; urgency=low
       constrained processes (LP: #415766)
     - [49094ccf] Add automatic sysname detection for ARM Linux
     - [525b594a] Make ktc_curpag generally available (LP: #446521)
+  * In the postinst of openafs-modules-dkms, if the openafs module is
+    already added in DKMS, try to remove it first before adding it.  This
+    should more correctly handle the case of a user installing this
+    package without the correct kernel headers, having it fail in
+    postinst, and then installing the correct headers and having dpkg
+    attempt to configure the package again.  Thanks, Philipp Kaluza.
+    (Closes: #553542)
 
  -- Russ Allbery <rra@debian.org>  Tue, 03 Nov 2009 20:57:21 -0800
 
index 24bbe0db939589a754a028f7661d8e57af3547e7..556dbf710f3dabfba97a3664a55d8b0901d1838f 100644 (file)
@@ -7,6 +7,13 @@ package=openafs-modules-dkms
 version=`dpkg-query -W -f='${Version}' "$package" \
     | sed -e 's/[+-].*//' -e 's/\.dfsg.*//' -e 's/~//g'`
 
+# If someone installed this package without the necessary kernel headers, the
+# postinst will fail.  If they then fix this problem, the postinst will keep
+# failing since the dkms add cannot be run twice.  Try to detect this
+# situation and remove and re-add the module.
+if [ -e "/var/lib/dkms/openafs/$version" ] ; then
+    dkms remove -m openafs -v "$version" --all || true
+fi
 dkms add -m openafs -v "$version"
 if [ "$1" = 'configure' ] ; then
     dkms build -m openafs -v "$version"