summaryrefslogtreecommitdiff
path: root/devel/pear-PHPUnit3/files/pear-deinstall.in
blob: ccbf7b82cb25069a141cf72c42247186bc8b4a67 (plain) (blame)
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
#!/bin/sh
#
# $FreeBSD$
#
# Remove package declaration from PEAR's registry and optionally delete
# a non-standard channel.

if [ x$2 != xDEINSTALL -a x$2 != xPOST-DEINSTALL ]; then
    exit
fi
PKG_NAME=${1%%-[0-9._]*}
PACKAGE=$(echo $PKG_NAME | sed 's/pear-//')

PEAR=${PKG_PREFIX}/bin/pear
CHANNEL=%%CHANNEL%%

if [ "$2" = "DEINSTALL" ]; then
	if [ "x${CHANNEL}" != "x" ]; then
		${PEAR} uninstall -r -n ${CHANNEL}/${PACKAGE} || true
	else
		${PEAR} uninstall -r -n ${PACKAGE} || true
	fi
else
	if [ "x${CHANNEL}" != "x" ]; then
		${PEAR} channel-delete ${CHANNEL}
	fi
fi