File: posh.prerm

package info (click to toggle)
posh 0.13.2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,488 kB
  • sloc: ansic: 14,597; xml: 1,604; sh: 1,343; perl: 964; makefile: 36
file content (22 lines) | stat: -rw-r--r-- 495 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
#
# pre-removal script for the Debian GNU/Linux ash package
#
# $Id: ash.prerm,v 1.5 2001/06/26 11:34:30 herbert Exp $

set -e

remove_divert() {
	div=$(dpkg-divert --package posh --list $1)
	if [ -n "$div" ] && [ -z "${div%%*by posh}" ]; then
		distrib=${div% by posh}
		distrib=${distrib##* to }
		mv $distrib $1
		dpkg-divert --package posh --remove $1
	fi
}

if [ "$1" = remove ] || [ "$1" = deconfigure ]; then
	remove_divert /bin/sh
	remove_divert /usr/share/man/man1/sh.1.gz
fi