xbps-triggers: new virtualpkg trigger to (un)register vpkgs from xbps.conf.

This commit is contained in:
Juan RP 2011-12-15 14:28:16 +01:00
parent 53ea4d6829
commit d879b9b58f
2 changed files with 42 additions and 1 deletions

View file

@ -0,0 +1,41 @@
#!/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
if [ "${TARGET}" = "post-install" ]; then
echo "Enabled $PKGNAME virtual packages to $CONF_FILE."
echo "include(./$CONF_FILE/virtualpkg.d/$PKGNAME.conf)" >> $CONF_FILE
else
sed -i "/include.*$PKGNAME.conf.*/d" $CONF_FILE
echo "Disabled $PKGNAME virtual packages from $CONF_FILE."
fi
;;
*)
exit 1
;;
esac
exit 0

View file

@ -1,6 +1,6 @@
# Template file for 'xbps-triggers'
pkgname=xbps-triggers
version=0.30
version=0.32
short_desc="XBPS triggers"
maintainer="Juan RP <xtraeme@gmail.com>"
homepage="http://code.google.com/p/xbps"