File: xterm.preinst

package info (click to toggle)
xterm 235-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 3,780 kB
  • ctags: 4,528
  • sloc: ansic: 48,756; sh: 3,793; perl: 1,036; makefile: 406
file content (41 lines) | stat: -rw-r--r-- 1,424 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
#!/bin/sh
# Debian xterm package pre-installation script
# Copyright 2003, 2004 Branden Robinson.
# Licensed under the GNU General Public License, version 2.  See the file
# /usr/share/common-licenses/GPL or <http://www.gnu.org/copyleft/gpl.txt>.
# Acknowledgements to Stephen Early, Mark Eichin, and Manoj Srivastava.

# $Id$

set -e

if [ "$1" = "upgrade" ] || [ "$1" = "install" ]; then
    if dpkg --compare-versions "$2" lt "4.0.1-1"; then
        # Clean up after older alternative that used different path.
        if update-alternatives --display x-terminal-emulator |
          fgrep -q /usr/bin/X11/xterm; then
            update-alternatives --remove x-terminal-emulator /usr/bin/X11/xterm
        fi
    fi

    if dpkg --compare-versions "$2" lt "204"; then
        # Clean up after older alternative that used different path.
        if update-alternatives --display x-terminal-emulator |
          fgrep -q /usr/X11R6/bin/xterm; then
            update-alternatives --remove x-terminal-emulator \
              /usr/X11R6/bin/koi8rxterm
            update-alternatives --remove x-terminal-emulator \
              /usr/X11R6/bin/uxterm
            update-alternatives --remove x-terminal-emulator \
              /usr/X11R6/bin/xterm
            update-alternatives --remove x-terminal-emulator \
              /usr/X11R6/bin/lxterm
        fi
    fi
fi

#DEBHELPER#

exit 0

# vim:set ai et sw=4 ts=4 tw=80: