diff --git a/srcpkgs/xbps-triggers/files/virtualpkg b/srcpkgs/xbps-triggers/files/virtualpkg new file mode 100755 index 00000000000..c668ffeff88 --- /dev/null +++ b/srcpkgs/xbps-triggers/files/virtualpkg @@ -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 diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template index 4cf57617f94..03e24b9c875 100644 --- a/srcpkgs/xbps-triggers/template +++ b/srcpkgs/xbps-triggers/template @@ -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 " homepage="http://code.google.com/p/xbps"