File: postinst

package info (click to toggle)
oss-compat 2%2Bdeb7u2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 64 kB
  • sloc: sh: 52; makefile: 2
file content (54 lines) | stat: -rw-r--r-- 1,838 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/sh
set -e

case "$1" in
  configure)
    case "`uname -s`" in
      Linux)
        # There are three points to consider when upgrading or installing:
        #   - current versions of module-init-tools require configuration
        #     files to have a .conf suffix;
        #   - policy requires changes to configuration to be preserved
        #   - policy forbids including configuration outside of /etc
        curconffile=/etc/modprobe.d/oss-compat.conf
        oldconffile=/etc/modprobe.d/oss-compat
        if [ ! -f ${curconffile} -o -L ${curconffile} ]; then
          if [ -L ${curconffile} ]; then
            # Upgrading from previous testing/unstable version
            curlinktgt=$(readlink -f ${curconffile})
            rm -f ${curconffile}
            cp ${curlinktgt} ${curconffile}
          elif [ -L ${oldconffile} ]; then
            # Upgrading from stable, link
            curlinktgt=$(readlink -f ${oldconffile})
            cp ${curlinktgt} ${curconffile}
          elif [ -f ${oldconffile} ]; then
            # Upgrading from stable, file
            cp ${oldconffile} ${curconffile}
          else
            # Installing from scratch
            cp /lib/oss-compat/linux ${curconffile}
          fi
        fi
        # Cleanup stable configuration link
        [ -L ${oldconffile} ] && rm -f ${oldconffile}
        # Wheezy configuration file (using install directives)
        [ -f ${curconffile} ] && [ "$(md5sum ${curconffile} | cut -d\  -f1)" = "88222606b0a3ba8b0825c5000c754e6f" ] && cp /lib/oss-compat/linux ${curconffile}

        if lsmod | grep -q "^snd " ; then
          modprobe snd || true
        fi
      ;;
    esac
  ;;
  abort-upgrade|abort-remove|abort-deconfigure)
  ;;
  *)
    echo "postinst called with unknown argument \`$1'" >&2
    exit 1
  ;;
esac

#DEBHELPER#

exit 0