File: sg3-utils.preinst

package info (click to toggle)
sg3-utils 1.21-2.1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 2,656 kB
  • ctags: 2,422
  • sloc: ansic: 41,751; makefile: 371; sh: 155
file content (48 lines) | stat: -rw-r--r-- 1,141 bytes parent folder | download | duplicates (3)
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
#! /bin/sh
# preinst script for sg-utils
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <new-preinst> `install'
#        * <new-preinst> `install' <old-version>
#        * <new-preinst> `upgrade' <old-version>
#        * <old-preinst> `abort-upgrade' <new-version>
#
# For details see /usr/share/doc/packaging-manual/

case "$1" in
    install|upgrade)
      kernel_version=`/bin/uname -r`;
      major_version=`echo $kernel_version | sed 's/\.[0-9]\+$//'`;
      minor_version=`echo $kernel_version | sed 's/.*\.\([0-9]\+\)/\1/'`;

      case $major_version in
	2.[0-3])
	    echo "You are running linux kernel version $kernel_version."
	    echo "sg3_utils will not work on kernels older than 2.4."
	    echo "If you want to run code with older kernels, please"
	    echo "install sg_utils instead."
	    exit 0;
        ;;
	*)
      esac
    ;;

    abort-upgrade)
    ;;

    *)
        echo "preinst called with unknown argument \`$1'" >&2
        exit 0
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0