File: perl-5.6-base.postinst

package info (click to toggle)
perl-transition 6.3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 76 kB
  • ctags: 2
  • sloc: sh: 230; makefile: 22
file content (32 lines) | stat: -rwxr-xr-x 709 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
#!/bin/sh -e

#DEBHELPER#

if [ "$1" = configure ]
then
    # we don't ship this anymore
    rm -f /usr/bin/patchls

    # see if we need to bother messing with alternatives
    [ -L /etc/alternatives/perl ] || exit 0

    # update-alternatives is currently a perl program
    if [ ! -x /usr/bin/perl ]
    then
	echo "Error: no /usr/bin/perl, can't clean up old alternatives."
	exit 0
    fi

    # u-a may destroy the target
    preserve=/usr/bin/perl.preserve-during-upgrade
    ln /usr/bin/perl $preserve

    $preserve -S update-alternatives --auto perl
    $preserve -S update-alternatives --remove perl /usr/bin/perl-5.6

    # restore
    rm -f /usr/bin/perl
    mv $preserve /usr/bin/perl
fi

exit 0