xbps-src: less forking in get_subpkgs and unset_package_funcs

This commit is contained in:
Duncaen 2019-06-12 23:51:09 +02:00 committed by Juan RP
parent f1ec7fac9f
commit dd9c7a967e
No known key found for this signature in database
GPG Key ID: AF19F6CB482F9368
1 changed files with 13 additions and 10 deletions

View File

@ -258,21 +258,24 @@ run_pkg_hooks() {
unset_package_funcs() {
local f
for f in $(typeset -F|grep -E '_package$'); do
eval unset -f $f
for f in "$(typeset -F)"; do
case "$f" in
*_package)
unset -f "$f"
;;
esac
done
}
get_subpkgs() {
local args list
local f
args="$(typeset -F|grep -E '_package$')"
set -- ${args}
while [ $# -gt 0 ]; do
list+=" ${3%_package}"; shift 3
done
for f in ${list}; do
echo "$f"
for f in $(typeset -F); do
case "$f" in
*_package)
echo "${f%_package}"
;;
esac
done
}