diff --git a/srcpkgs/xbps-triggers/files/virtualpkg b/srcpkgs/xbps-triggers/files/virtualpkg index aba53921943..7353bce4343 100755 --- a/srcpkgs/xbps-triggers/files/virtualpkg +++ b/srcpkgs/xbps-triggers/files/virtualpkg @@ -1,8 +1,6 @@ #!/bin/sh # -# This trigger is obsolete in xbps>=0.18. -# -# Enables or disables a virtual package to xbps.conf. +# This trigger converts virtualpkg conf files to the XBPS 0.33 format. # # Arguments: $ACTION = [run/targets] # $TARGET = [post-install/pre-remove] @@ -21,10 +19,27 @@ export PATH="$PATH:/usr/local/bin" case "$ACTION" in targets) - echo "post-install post-remove" + echo "post-install" ;; run) - # Do nothing, keep it just for compatibility. + for f in etc/xbps/virtualpkg.d/*.conf; do + file=$(basename $f) + file=${file%.conf} + if [ -f etc/xbps/virtualpkg.d/${file}.vpkg ]; then + continue + fi + echo "Generating virtualpkg configuration file for: ${file} ..." + cat "$f" | while read line; do + pkg=$(echo "$line"|awk '{print $2}') + vpkg=$(echo "$line"|awk '{print $6}') + vpkg="$(echo $vpkg|sed 's,",,g')" + if [ "$pkg" = "Virtual" ]; then + echo "$line" > etc/xbps/virtualpkg.d/${file}.vpkg + else + echo "virtualpkg=${vpkg}:${pkg}" >> etc/xbps/virtualpkg.d/${file}.vpkg + fi + done + done ;; *) exit 1 diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template index 7ee794cc838..831e8ed0bdf 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.74 +version=0.75 revision=1 noarch=yes bootstrap=yes