~ubuntu-branches/ubuntu/intrepid/nvidia-graphics-drivers-173/intrepid

« back to all changes in this revision

Viewing changes to debian/nvidia-173-kernel-source.postinst

  • Committer: Bazaar Package Importer
  • Author(s): Alberto Milone (tseliot)
  • Date: 2008-09-22 12:36:29 UTC
  • Revision ID: james.westby@ubuntu.com-20080922123629-y3yz13ozrr8f91v2
Tags: 173.14.12-1-0ubuntu3
Fix (LP: #262027) Make sure to remove (in 
nvidia-173-kernel-source.postinst) any directory which
was not removed because of bug 261816

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
PKGVER=`dpkg-query -W -f='${Version}' nvidia-173-kernel-source | awk -F "-" '{print $1}'`
10
10
PKGVER=${PKGVER#*:}
11
11
 
 
12
SOURCES="/var/lib/dkms/nvidia/"
 
13
VERSION=173.15.13
 
14
STATUS=$(dpkg --compare-versions "$PKGVER" lt "$VERSION" && echo "True" || echo "False")
 
15
 
12
16
case "$1" in
13
17
        configure)
 
18
                # act only if the version of the current package is lower than $VERSION
 
19
                if [ "$STATUS" = "True" ]; then
 
20
                        echo "Cleaning up the DKMS tree"
 
21
                        for directory in $(ls $SOURCES); do
 
22
                                kind=$(echo "$directory" | awk '$1 ~ /.*[a-z].*$/ { print "alpha"; next } { print "num" }')
 
23
                                # the names of the directories containing the version of the driver are digits (e.g. 177.70)
 
24
                                if [ "$kind" = "num" ]; then
 
25
                                        comparison=$(echo "$directory" | awk -v Version="$PKGVER" '($1 != Version) { print "yes"; next } { print "no" }')
 
26
                                        # if the version is less than $VERSION
 
27
                                        if [ "$comparison" = "yes" ]; then
 
28
                                                rm -rf $SOURCES$directory 2>/dev/null
 
29
                                        fi
 
30
                                fi
 
31
                        done
 
32
                        echo "Done."
 
33
                fi
 
34
                
14
35
                echo "Removing all DKMS Modules"
15
36
                dkms remove -m nvidia -v $PKGVER --all -q > /dev/null
16
37
                echo "Done."