File: preinst

package info (click to toggle)
motifnls 2.1-2
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 112 kB
  • ctags: 3
  • sloc: sh: 37; makefile: 36
file content (43 lines) | stat: -rw-r--r-- 1,098 bytes parent folder | download | duplicates (4)
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
#!/bin/sh -e
#
# Debian package preinst
# Version 1.1
#
# Robert Leslie <rob@mars.org>

case "$1" in
  install)
    ;;

  upgrade)
    if [ "1.0-1" = "$2" ]
    then
      # The old motifnls package installed files into /usr/lib/X11/nls.
      # However, /usr/lib/X11 is symlinked to /usr/X11R6/lib/X11, which
      # also happens to be the "correct" path for installing files, while
      # /usr/lib/X11 is not.

      # There is a problem with dpkg in upgrading packages in that it fails
      # to recognize when /usr/lib/X11 and /usr/X11R6/lib/X11 are the same.
      # It therefore unpacks this package and immediately removes all its
      # files as a side-effect of removing files from the old package.

      # Until (or unless) this is fixed, we must make an explicit distinction
      # for dpkg between the two directories, and later remove it.

      # This is horrible, horrible, horrible, sigh.

      cd /usr/lib
      rm -rf X11/nls
      mv X11 .X11.tmp
    fi
    ;;

  abort-upgrade)
    ;;

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