~droetker/ubuntu/saucy/bumblebee/fix-for-1250745

« back to all changes in this revision

Viewing changes to debian/bumblebee-nvidia.postrm

  • Committer: Package Import Robot
  • Author(s): Vincent Cheng
  • Date: 2013-05-03 03:04:38 UTC
  • Revision ID: package-import@ubuntu.com-20130503030438-uvmvja55iicztpxf
Tags: upstream-3.2.1
ImportĀ upstreamĀ versionĀ 3.2.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# postrm script for bumblebee-nvidia
 
3
#
 
4
# see: dh_installdeb(1)
 
5
 
 
6
set -e
 
7
 
 
8
case "$1" in
 
9
  purge|remove|abort-install)
 
10
  # Ubuntu and Debian's packaging of nvidia's proprietary driver differ greatly
 
11
  # Also, do not rely solely on dpkg-vendor (see LP: #1061769)
 
12
    if (which dpkg-vendor >/dev/null && dpkg-vendor --derives-from Ubuntu) || \
 
13
      [ -e /etc/dpkg/origins/ubuntu ]; then
 
14
 
 
15
      # == Ubuntu specific section ==
 
16
      # Restore the alternatives in case bumblebee is installed on a
 
17
      # non-Optimus system that requires the nvidia driver
 
18
      for arch in x86_64-linux-gnu i386-linux-gnu; do
 
19
        update-alternatives --force --auto ${arch}_gl_conf 2>/dev/null || true
 
20
      done
 
21
 
 
22
      # versions before Oneiric without multiarch
 
23
      update-alternatives --force --auto gl_conf 2>/dev/null || true
 
24
 
 
25
    else
 
26
 
 
27
      # == Debian specific section ==
 
28
      # Restore the alternatives in case bumblebee is installed on a
 
29
      # non-Optimus system that requires the nvidia driver
 
30
      update-alternatives --force --auto glx 2>/dev/null || true
 
31
 
 
32
    fi
 
33
 
 
34
    ldconfig
 
35
    ;;
 
36
  upgrade|failed-upgrade|abort-upgrade|disappear)
 
37
    ;;
 
38
  *)
 
39
    echo "postrm called with unknown argument \`$1'" >&2
 
40
    exit 1
 
41
    ;;
 
42
esac
 
43
 
 
44
#DEBHELPER#
 
45
 
 
46
exit 0