2002-06-08 19:24:56 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# $FreeBSD$
|
|
|
|
|
|
|
|
PKGNAME=$1
|
|
|
|
PKG_DBDIR=${PKG_DBDIR:-/var/db/pkg}
|
|
|
|
|
|
|
|
die () {
|
|
|
|
echo $* >&2
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
delete_modules () {
|
|
|
|
modules="
|
2003-04-19 17:57:37 +02:00
|
|
|
bigfloat
|
2003-10-31 19:26:01 +01:00
|
|
|
devel-logger
|
2002-06-08 19:24:56 +02:00
|
|
|
dl
|
2003-10-31 19:26:01 +01:00
|
|
|
drb
|
2003-02-12 17:12:00 +01:00
|
|
|
erb
|
2002-06-08 19:24:56 +02:00
|
|
|
fileutils
|
|
|
|
fnmatch
|
2003-10-31 19:26:01 +01:00
|
|
|
gserver
|
|
|
|
openssl
|
2002-08-03 10:45:36 +02:00
|
|
|
optparse
|
2002-06-08 19:24:56 +02:00
|
|
|
racc-runtime
|
2003-12-15 07:35:48 +01:00
|
|
|
rdoc
|
2003-10-31 19:26:01 +01:00
|
|
|
rexml
|
|
|
|
soap
|
2002-06-08 19:24:56 +02:00
|
|
|
strscan
|
2003-03-03 18:03:09 +01:00
|
|
|
testunit
|
2003-10-31 19:26:01 +01:00
|
|
|
webrick
|
|
|
|
xmlrpc
|
|
|
|
yaml
|
2003-04-19 17:57:37 +02:00
|
|
|
zlib
|
2002-06-08 19:24:56 +02:00
|
|
|
"
|
|
|
|
|
|
|
|
echo "Deinstalling modules being replaced by $PKGNAME..."
|
|
|
|
|
|
|
|
cd $PKG_DBDIR || die "$PKG_DBDIR is not found"
|
|
|
|
|
|
|
|
for portname in $modules; do
|
|
|
|
for pkg in $RUBY_PKGNAMEPREFIX$portname-*; do
|
|
|
|
if [ -d $pkg ]; then
|
|
|
|
echo "---> $pkg"
|
|
|
|
/usr/sbin/pkg_delete -f $pkg
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
RUBY_PKGNAMEPREFIX=$(expr "$PKGNAME" : '\([^-]*-\)')
|
|
|
|
|
|
|
|
if [ -z $RUBY_PKGNAMEPREFIX ]; then
|
|
|
|
die "Cannot determine RUBY_PKGNAMEPREFIX from '$PKGNAME'."
|
|
|
|
fi
|
|
|
|
|
|
|
|
case $2 in
|
|
|
|
PRE-INSTALL)
|
|
|
|
delete_modules
|
|
|
|
;;
|
|
|
|
POST-INSTALL)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
die "usage: sh $0 \$PKGNAME { PRE-INSTALL | POST-INSTALL }"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit 0
|