File: preinst

package info (click to toggle)
dsh 0.25.10-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,132 kB
  • sloc: sh: 9,667; ansic: 1,102; makefile: 100
file content (22 lines) | stat: -rw-r--r-- 576 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
#! /bin/sh

set -e

# Handle the upgrade from the symlink shipped in the package to the symlink
# created by the postinst
# see https://bugs.debian.org/788585

# this code is based on symlink_to_dir in dpkg-maintscript-helper

# note that this also works if /etc/dsh/group/all is not a symlink
SYMLINK="/etc/dsh/group/all"
LASTVERSION="0.25.10-1.3~"

if [ "$1" = "install" -o "$1" = "upgrade" ] &&
   [ -n "$2" ] && [ -h "$SYMLINK" -o -e "$SYMLINK" ] &&
   dpkg --compare-versions -- "$2" le-nl "$LASTVERSION"; then
	mv -f "$SYMLINK" "${SYMLINK}.dpkg-backup"
fi

#DEBHELPER#