From e96e0577b264d0ff0127cfdd8a05f9051e1c6ebe Mon Sep 17 00:00:00 2001 From: Juan RP Date: Tue, 25 Feb 2014 21:53:53 +0100 Subject: [PATCH] xbps-triggers: use the virtualpkg trigger to convert vpkg files to the XBPS 0.33 format. --- srcpkgs/xbps-triggers/files/virtualpkg | 25 ++++++++++++++++++++----- srcpkgs/xbps-triggers/template | 2 +- 2 files changed, 21 insertions(+), 6 deletions(-) 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