common: expand_destdir rewrite
This commit is contained in:
parent
18e288fd2c
commit
82b736b616
3 changed files with 15 additions and 12 deletions
|
@ -1,15 +1,18 @@
|
||||||
# This provides the extglob function to expand wildcards in the destdir
|
# This provides the extglob function to expand wildcards in the destdir
|
||||||
|
|
||||||
expand_destdir() {
|
expand_destdir() {
|
||||||
local glob_list= result= glob= file=
|
local result= glob= file=
|
||||||
|
|
||||||
for glob; do
|
(
|
||||||
glob_list+=" $DESTDIR/$glob"
|
set -f
|
||||||
done
|
for glob in $@; do
|
||||||
shopt -s extglob
|
files=$(echo "${PKGDESTDIR}/${glob}")
|
||||||
for file in $glob_list; do
|
set +f
|
||||||
result+=" ${file#$DESTDIR/}"
|
for file in $files; do
|
||||||
done
|
result+="${blank}${file#$PKGDESTDIR/}"
|
||||||
shopt -u extglob
|
blank=" "
|
||||||
echo $result
|
done
|
||||||
|
done
|
||||||
|
echo "$result"
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ genpkg() {
|
||||||
local _replaces="$(echo $replaces)"
|
local _replaces="$(echo $replaces)"
|
||||||
local _reverts="$(echo $reverts)"
|
local _reverts="$(echo $reverts)"
|
||||||
local _mutable_files="$(echo $mutable_files)"
|
local _mutable_files="$(echo $mutable_files)"
|
||||||
local _conf_files="$(expand_destdir $conf_files)"
|
local _conf_files="$(expand_destdir "$conf_files")"
|
||||||
local _alternatives="$(echo $alternatives)"
|
local _alternatives="$(echo $alternatives)"
|
||||||
local _tags="$(echo $tags)"
|
local _tags="$(echo $tags)"
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ hook() {
|
||||||
done
|
done
|
||||||
|
|
||||||
# Check that configuration files really exist.
|
# Check that configuration files really exist.
|
||||||
for f in $(expand_destdir ${conf_files}); do
|
for f in $(expand_destdir "${conf_files}"); do
|
||||||
if [ ! -f "${PKGDESTDIR}/${f}" ]; then
|
if [ ! -f "${PKGDESTDIR}/${f}" ]; then
|
||||||
msg_red "${pkgver}: '$f' configuration file not in PKGDESTDIR!\n"
|
msg_red "${pkgver}: '$f' configuration file not in PKGDESTDIR!\n"
|
||||||
error=1
|
error=1
|
||||||
|
|
Loading…
Reference in a new issue