freebsd-ports/lang/ruby16-shim-ruby18/pkg-install
Akinori MUSHA 40e9f7052c Update lang/ruby, lang/ruby-devel and lang/ruby16-shim-ruby18 to the
latest snapshots as of 2003-04-19.

ruby-bigdecimal (formerly known as ruby-bigfloat) and ruby-zlib are
now part of ruby 1.8.
2003-04-19 15:57:37 +00:00

59 lines
850 B
Bash

#!/bin/sh
#
# $FreeBSD$
PKGNAME=$1
PKG_DBDIR=${PKG_DBDIR:-/var/db/pkg}
die () {
echo $* >&2
exit 1
}
delete_modules () {
modules="
bigfloat
dl
erb
fileutils
fnmatch
optparse
racc-runtime
strscan
testunit
zlib
"
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