xbps-triggers: use the virtualpkg trigger to convert vpkg files to the XBPS 0.33 format.
This commit is contained in:
parent
73cc5a1633
commit
e96e0577b2
2 changed files with 21 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Template file for 'xbps-triggers'
|
||||
pkgname=xbps-triggers
|
||||
version=0.74
|
||||
version=0.75
|
||||
revision=1
|
||||
noarch=yes
|
||||
bootstrap=yes
|
||||
|
|
Loading…
Reference in a new issue