Sync xbps-triggers with upstream
This commit is contained in:
parent
331a7c2565
commit
3989ce51e2
2 changed files with 49 additions and 16 deletions
|
@ -19,32 +19,65 @@ UPDATE="$5"
|
|||
|
||||
export PATH="usr/bin:usr/sbin:/usr/sbin:/usr/bin:/sbin:/bin"
|
||||
|
||||
# {install,remove}_binfmts: legacy installation style
|
||||
install_binfmts() {
|
||||
echo "$binfmts" | while read -r line; do
|
||||
set -- $line
|
||||
_bin="$1"; shift
|
||||
_bname="${_bin##*/}"
|
||||
update-binfmts --package "${PKGNAME}" --install "${_bname}" "${_bin}" "$@"
|
||||
done
|
||||
}
|
||||
|
||||
remove_binfmts() {
|
||||
echo "$binfmts" | while read -r line; do
|
||||
set -- $line
|
||||
_bin="$1"; shift
|
||||
_bname="${_bin##*/}"
|
||||
if [ -f "var/lib/binfmts/${_bname}" ]; then
|
||||
update-binfmts --package "${PKGNAME}" --remove "${_bname}" "${_bin}"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# {,un}import_binfmts: new installation style
|
||||
import_binfmts() {
|
||||
for _fmt in $import_binfmts; do
|
||||
update-binfmts --import "$_fmt"
|
||||
done
|
||||
}
|
||||
|
||||
unimport_binfmts() {
|
||||
for _fmt in $import_binfmts; do
|
||||
if [ -f "var/lib/binfmts/${_fmt}" ]; then
|
||||
update-binfmts --unimport "$_fmt"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
case "$ACTION" in
|
||||
targets)
|
||||
echo "post-install pre-remove"
|
||||
;;
|
||||
run)
|
||||
[ -x /usr/bin/update-binfmts ] || exit 0
|
||||
[ -z "${binfmts}" ] && exit 0
|
||||
|
||||
case "$TARGET" in
|
||||
post-install)
|
||||
echo "$binfmts" | tr '\' '&' 2> /dev/null | while read line; do
|
||||
line=$(echo $line | tr '&' '\' 2> /dev/null)
|
||||
set -- ${line}
|
||||
_bin="$1"; shift; _args="$@"; _bname="$(basename ${_bin})"
|
||||
update-binfmts --package ${PKGNAME} --install ${_bname} ${_bin} ${_args}
|
||||
done
|
||||
if [ -n "${binfmts}" ]; then
|
||||
install_binfmts
|
||||
fi
|
||||
if [ -n "${import_binfmts}" ]; then
|
||||
import_binfmts
|
||||
fi
|
||||
;;
|
||||
pre-remove)
|
||||
echo "$binfmts" | tr '\' '&' 2> /dev/null | while read line; do
|
||||
line=$(echo $line | tr '&' '\' 2> /dev/null)
|
||||
set -- ${line}
|
||||
_bin="$1"; shift; _args="$@"; _bname="$(basename ${_bin})"
|
||||
if [ -f /var/lib/binfmts/${_bname} ]; then
|
||||
update-binfmts --package ${PKGNAME} --remove ${_bname} ${_bin}
|
||||
fi
|
||||
done
|
||||
if [ -n "${binfmts}" ]; then
|
||||
remove_binfmts
|
||||
fi
|
||||
if [ -n "${import_binfmts}" ]; then
|
||||
unimport_binfmts
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
exit 1
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Template file for 'xbps-triggers'
|
||||
pkgname=xbps-triggers
|
||||
version=0.127
|
||||
version=0.128
|
||||
revision=1
|
||||
bootstrap=yes
|
||||
short_desc="XBPS triggers for Void Linux"
|
||||
|
|
Loading…
Add table
Reference in a new issue