~ubuntu-branches/ubuntu/saucy/dkms/saucy

« back to all changes in this revision

Viewing changes to debian/scripts/postinst-dkms

  • Committer: Bazaar Package Importer
  • Author(s): Mario Limonciello
  • Date: 2010-03-28 00:45:36 UTC
  • mfrom: (2.1.10 sid)
  • Revision ID: james.westby@ubuntu.com-20100328004536-vuxu3pxjcxhtae6d
Tags: 2.1.1.2-2fakesync1
Fakesync with debian (LP: #534843)

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
 
4
4
DKMS_NAME=#MODULE_NAME#
5
5
DKMS_PACKAGE_NAME=$DKMS_NAME-dkms
6
 
DKMS_CVERSION=$(dpkg-query -W -f='${Version}' $DKMS_PACKAGE_NAME | awk -F "-" '{print $1}' | cut -d\: -f2)
 
6
DKMS_VERSION=#MODULE_VERSION#
 
7
 
 
8
postinst_found=0
7
9
 
8
10
case "$1" in
9
11
        configure)
10
12
                for DKMS_POSTINST in /usr/lib/dkms/common.postinst /usr/share/$DKMS_PACKAGE_NAME/postinst; do
11
13
                        if [ -f $DKMS_POSTINST ]; then
12
 
                                $DKMS_POSTINST $DKMS_NAME $DKMS_CVERSION /usr/share/$DKMS_PACKAGE_NAME "" $2
13
 
                                if [ "$?" -ne 0 ]; then
14
 
                                        exit $?
15
 
                                fi
 
14
                                $DKMS_POSTINST $DKMS_NAME $DKMS_VERSION /usr/share/$DKMS_PACKAGE_NAME "" $2
 
15
                                postinst_found=1
 
16
                                break
16
17
                        fi
17
 
                        echo "WARNING: $DKMS_POSTINST does not exist."
18
18
                done
19
 
                echo "ERROR: DKMS version is too old and $DKMS_PACKAGE_NAME was not"
20
 
                echo "built with legacy DKMS support."
21
 
                echo "You must either rebuild $DKMS_PACKAGE_NAME with legacy postinst"
22
 
                echo "support or upgrade DKMS to a more current version."
23
 
                exit 1
 
19
                if [ "$postinst_found" -eq 0 ]; then
 
20
                        echo "ERROR: DKMS version is too old and $DKMS_PACKAGE_NAME was not"
 
21
                        echo "built with legacy DKMS support."
 
22
                        echo "You must either rebuild $DKMS_PACKAGE_NAME with legacy postinst"
 
23
                        echo "support or upgrade DKMS to a more current version."
 
24
                        exit 1
 
25
                fi
24
26
        ;;
25
27
esac