2011-12-15 13:28:16 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Enables or disables a virtual package to xbps.conf.
|
|
|
|
#
|
|
|
|
# Arguments: $ACTION = [run/targets]
|
|
|
|
# $TARGET = [post-install/pre-remove]
|
|
|
|
# $PKGNAME
|
|
|
|
# $VERSION
|
|
|
|
# $UPDATE = [yes/no]
|
|
|
|
#
|
|
|
|
ACTION="$1"
|
|
|
|
TARGET="$2"
|
|
|
|
PKGNAME="$3"
|
|
|
|
VERSION="$4"
|
|
|
|
UPDATE="$5"
|
|
|
|
CONF_FILE="$6"
|
|
|
|
|
|
|
|
export PATH="$PATH:/usr/local/bin"
|
|
|
|
|
|
|
|
case "$ACTION" in
|
|
|
|
targets)
|
|
|
|
echo "post-install post-remove"
|
|
|
|
;;
|
|
|
|
run)
|
|
|
|
[ -z "$CONF_FILE" ] && CONF_FILE=etc/xbps/xbps.conf
|
|
|
|
[ ! -w $CONF_FILE ] && exit 0
|
|
|
|
|
2012-07-27 09:52:44 +00:00
|
|
|
sed -i "/^include.*\/etc\/xbps\/virtualpkg.d\/.*/d" ./$CONF_FILE
|
|
|
|
for f in etc/xbps/virtualpkg.d/*.conf; do
|
|
|
|
echo "include(/$f)" >> ./$CONF_FILE
|
|
|
|
done
|
2011-12-15 13:28:16 +00:00
|
|
|
;;
|
|
|
|
*)
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
exit 0
|