xbps-triggers: virtualpkg: better regexp, do nothing in update case.

This commit is contained in:
Juan RP 2011-12-16 10:34:46 +01:00
parent 2f1019234e
commit b93f2d45cd
2 changed files with 8 additions and 4 deletions

View file

@ -25,11 +25,15 @@ run)
[ -z "$CONF_FILE" ] && CONF_FILE=etc/xbps/xbps.conf
[ ! -w $CONF_FILE ] && exit 0
if [ "${TARGET}" = "post-install" -a "$UPDATE" = "no" ]; then
if [ "${TARGET}" = "post-install" ]; then
if [ "$UPDATE" = "yes" ]; then
# do nothing
exit 0
fi
echo "Enabled $PKGNAME virtual packages to $CONF_FILE."
echo "include(/etc/xbps/virtualpkg.d/$PKGNAME.conf)" >> $CONF_FILE
echo "include(/etc/xbps/virtualpkg.d/$PKGNAME.conf)" >> ./$CONF_FILE
else
sed -i "/include.*$PKGNAME.conf.*/d" $CONF_FILE
sed -i "/^include.*${PKGNAME}\.conf.*$/d" ./$CONF_FILE
echo "Disabled $PKGNAME virtual packages from $CONF_FILE."
fi
;;

View file

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