~ubuntu-branches/ubuntu/oneiric/nvidia-common/oneiric

« back to all changes in this revision

Viewing changes to debian/nvidia-common.postinst

  • Committer: Bazaar Package Importer
  • Author(s): Alberto Milone
  • Date: 2011-06-04 12:13:27 UTC
  • Revision ID: james.westby@ubuntu.com-20110604121327-hojgytoy6f4ev5sy
Tags: 1:0.2.30+1
Add epoch to override the sync. The packages in Debian and Ubuntu
have the same name but different code and scope (LP: #792576).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
set -e
3
 
 
4
 
 
 
1
#!/bin/sh -e
5
2
. /usr/share/debconf/confmodule
6
3
 
7
 
exists()
8
 
{
9
 
        test -e "$1" || test -L "$1"
10
 
}
11
 
 
12
 
if [ "$1" = "configure" ]
13
 
then
14
 
 
15
 
        if [ -x "/usr/bin/nvidia-installer" ]
16
 
        then
17
 
                db_fset nvidia-common/uninstall-nvidia-installer seen false
18
 
                db_input high nvidia-common/uninstall-nvidia-installer
19
 
                db_go
20
 
                db_get nvidia-common/uninstall-nvidia-installer
21
 
                if [ "$RET" = "true" ]
22
 
                then
23
 
                        nvidia-installer --uninstall --no-runlevel-check --no-x-check --ui=none || true
24
 
                elif [ ! -x "/usr/bin/nvidia-installer" ]
25
 
                then
26
 
                        : # the user may have removed it inbetween
27
 
                else
28
 
                        echo "ERROR: Please run 'nvidia-installer --uninstall' manually or delete it." >&2
29
 
                        exit 1
30
 
                fi
31
 
        fi
32
 
 
33
 
        if exists "/usr/bin/nvidia-installer" || exists "/usr/bin/nvidia-uninstall"
34
 
        then
35
 
                db_fset nvidia-common/delete-nvidia-installer seen false
36
 
                db_input high nvidia-common/delete-nvidia-installer
37
 
                db_go
38
 
                db_get nvidia-common/delete-nvidia-installer
39
 
                if [ "$RET" = "true" ]
40
 
                then
41
 
                        rm -f /usr/bin/nvidia-installer /usr/bin/nvidia-uninstall
42
 
                else
43
 
                        echo "ERROR: Please run 'nvidia-installer --uninstall' manually or delete it." >&2
44
 
                        exit 1
45
 
                fi
46
 
        fi
47
 
 
 
4
db_fset nvidia-common/obsolete-driver seen false
 
5
db_fget nvidia-common/obsolete-driver seen || true
 
6
 
 
7
if [ "$RET" != "true" ]; then
 
8
    LATEST=$(nvidia-detector | tail -n 1)
 
9
    if [ "${LATEST}" != "none" ]; then 
 
10
        db_subst nvidia-common/obsolete-driver latest "$LATEST"
 
11
        db_input high nvidia-common/obsolete-driver || true
 
12
        db_go || true
 
13
    fi
48
14
fi
49
15
 
50
 
 
51
16
#DEBHELPER#
52
17
 
53
 
exit 0
54