Merge pull request #3001 from Gottox/conf_files-glob
globs files defined in conf_files=
This commit is contained in:
commit
bd307bb9e2
5 changed files with 31 additions and 47 deletions
18
common/environment/install/extglob.sh
Normal file
18
common/environment/install/extglob.sh
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# This provides the extglob function to expand wildcards in the destdir
|
||||||
|
|
||||||
|
expand_destdir() {
|
||||||
|
local result= glob= file=
|
||||||
|
|
||||||
|
(
|
||||||
|
set -f
|
||||||
|
for glob in $@; do
|
||||||
|
files=$(echo "${PKGDESTDIR}/${glob}")
|
||||||
|
set +f
|
||||||
|
for file in $files; do
|
||||||
|
result+="${blank}${file#$PKGDESTDIR/}"
|
||||||
|
blank=" "
|
||||||
|
done
|
||||||
|
done
|
||||||
|
echo "$result"
|
||||||
|
)
|
||||||
|
}
|
1
common/environment/pkg/extglob.sh
Symbolic link
1
common/environment/pkg/extglob.sh
Symbolic link
|
@ -0,0 +1 @@
|
||||||
|
../install/extglob.sh
|
|
@ -30,9 +30,7 @@ genpkg() {
|
||||||
fi
|
fi
|
||||||
cd $pkgdir
|
cd $pkgdir
|
||||||
|
|
||||||
if [ -n "$preserve" ]; then
|
_preserve=${preserve:+-p}
|
||||||
_preserve="-p"
|
|
||||||
fi
|
|
||||||
if [ -s ${PKGDESTDIR}/rdeps ]; then
|
if [ -s ${PKGDESTDIR}/rdeps ]; then
|
||||||
_deps="$(cat ${PKGDESTDIR}/rdeps)"
|
_deps="$(cat ${PKGDESTDIR}/rdeps)"
|
||||||
fi
|
fi
|
||||||
|
@ -46,48 +44,15 @@ genpkg() {
|
||||||
_gitrevs="$(cat ${XBPS_STATEDIR}/gitrev)"
|
_gitrevs="$(cat ${XBPS_STATEDIR}/gitrev)"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$provides" ]; then
|
# Stripping whitespaces
|
||||||
local _provides=
|
local _provides="$(echo $provides)"
|
||||||
for f in ${provides}; do
|
local _conflicts="$(echo $conflicts)"
|
||||||
_provides="${_provides} ${f}"
|
local _replaces="$(echo $replaces)"
|
||||||
done
|
local _reverts="$(echo $reverts)"
|
||||||
fi
|
local _mutable_files="$(echo $mutable_files)"
|
||||||
if [ -n "$conflicts" ]; then
|
local _conf_files="$(expand_destdir "$conf_files")"
|
||||||
local _conflicts=
|
local _alternatives="$(echo $alternatives)"
|
||||||
for f in ${conflicts}; do
|
local _tags="$(echo $tags)"
|
||||||
_conflicts="${_conflicts} ${f}"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
if [ -n "$replaces" ]; then
|
|
||||||
local _replaces=
|
|
||||||
for f in ${replaces}; do
|
|
||||||
_replaces="${_replaces} ${f}"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
if [ -n "$reverts" ]; then
|
|
||||||
local _reverts=
|
|
||||||
for f in ${reverts}; do
|
|
||||||
_reverts="${_reverts} ${f}"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
if [ -n "$mutable_files" ]; then
|
|
||||||
local _mutable_files=
|
|
||||||
for f in ${mutable_files}; do
|
|
||||||
_mutable_files="${_mutable_files} ${f}"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
if [ -n "$conf_files" ]; then
|
|
||||||
local _conf_files=
|
|
||||||
for f in ${conf_files}; do
|
|
||||||
_conf_files="${_conf_files} ${f}"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
if [ -n "$alternatives" ]; then
|
|
||||||
local _alternatives=
|
|
||||||
for f in ${alternatives}; do
|
|
||||||
_alternatives="${_alternatives} ${f}"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
msg_normal "Creating $binpkg for repository $pkgdir ...\n"
|
msg_normal "Creating $binpkg for repository $pkgdir ...\n"
|
||||||
|
|
||||||
|
|
|
@ -25,8 +25,8 @@ hook() {
|
||||||
done
|
done
|
||||||
|
|
||||||
# Check that configuration files really exist.
|
# Check that configuration files really exist.
|
||||||
for f in ${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
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue