The following commit has been merged in the master branch:
commit cdda61c176ca894b2792aecff6ba6e13c51e5416
Author: David Paleino <[email protected]>
Date:   Wed Feb 17 19:17:37 2010 +0100

    debian/scripts/postinst-dkms: really make sure the error is thrown when 
nothing is found. (Closes: #568591)

diff --git a/debian/scripts/postinst-dkms b/debian/scripts/postinst-dkms
index ac5df8e..706a9a6 100644
--- a/debian/scripts/postinst-dkms
+++ b/debian/scripts/postinst-dkms
@@ -5,21 +5,23 @@ DKMS_NAME=#MODULE_NAME#
 DKMS_PACKAGE_NAME=$DKMS_NAME-dkms
 DKMS_CVERSION=$(dpkg-query -W -f='${Version}' $DKMS_PACKAGE_NAME | awk -F "-" 
'{print $1}' | cut -d\: -f2)
 
+postinst_found=0
+
 case "$1" in
        configure)
                for DKMS_POSTINST in /usr/lib/dkms/common.postinst 
/usr/share/$DKMS_PACKAGE_NAME/postinst; do
                        if [ -f $DKMS_POSTINST ]; then
                                $DKMS_POSTINST $DKMS_NAME $DKMS_CVERSION 
/usr/share/$DKMS_PACKAGE_NAME "" $2
-                               if [ "$?" -ne 0 ]; then
-                                       exit $?
-                               fi
+                               postinst_found=1
+                               break
                        fi
-                       echo "WARNING: $DKMS_POSTINST does not exist."
                done
-               echo "ERROR: DKMS version is too old and $DKMS_PACKAGE_NAME was 
not"
-               echo "built with legacy DKMS support."
-               echo "You must either rebuild $DKMS_PACKAGE_NAME with legacy 
postinst"
-               echo "support or upgrade DKMS to a more current version."
-               exit 1
+               if [ "$postinst_found" -eq 0 ]; then
+                       echo "ERROR: DKMS version is too old and 
$DKMS_PACKAGE_NAME was not"
+                       echo "built with legacy DKMS support."
+                       echo "You must either rebuild $DKMS_PACKAGE_NAME with 
legacy postinst"
+                       echo "support or upgrade DKMS to a more current 
version."
+                       exit 1
+               fi
        ;;
 esac

-- 
Dynamic Kernel Module Support

_______________________________________________
Pkg-dkms-commits mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/pkg-dkms-commits

Reply via email to