mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2024-12-22 07:00:28 +00:00
buildrepo: parse APKBUILDs in subshell
so we dont leak functions like 'build' and other variables.
This commit is contained in:
parent
447974ea29
commit
d0e15dd5b6
22
buildrepo.in
22
buildrepo.in
@ -46,9 +46,9 @@ all_exist() {
|
||||
done
|
||||
return 0
|
||||
}
|
||||
|
||||
build() {
|
||||
local repo="$1" i needbuild
|
||||
|
||||
list_needbuild() {
|
||||
local repo="$1" i=
|
||||
|
||||
cd "$aportsdir/$repo" || return 0
|
||||
|
||||
@ -78,14 +78,20 @@ build() {
|
||||
|
||||
# try link or copy the files if they are in the ports dir
|
||||
if all_exist $pkgs; then
|
||||
echo ">>> Copying " $pkgs
|
||||
echo ">>> Copying " $pkgs >&2
|
||||
cp -p -l $pkgs "$repodir/$repo/$CARCH"/ 2>/dev/null \
|
||||
|| cp -p $pkgs "$repodir/$repo/$CARCH"/ \
|
||||
|| needbuild="$needbuild $i"
|
||||
|| echo "$i"
|
||||
else
|
||||
needbuild="$needbuild $i"
|
||||
echo "$i"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
do_build() {
|
||||
local repo="$1" i=
|
||||
cd "$aportsdir/$repo" || return 0
|
||||
local needbuild="$(list_needbuild $repo)"
|
||||
|
||||
# build the postponed packages if any
|
||||
if [ -n "$needbuild" ]; then
|
||||
@ -146,9 +152,9 @@ shift $(($OPTIND - 1))
|
||||
|
||||
while [ $# -gt 0 ]; do
|
||||
if [ -n "$logprefix" ]; then
|
||||
build $1 >$logprefix.$1.log 2>&1 || exit 1
|
||||
do_build $1 >$logprefix.$1.log 2>&1 || exit 1
|
||||
else
|
||||
build $1 || exit 1
|
||||
do_build $1 || exit 1
|
||||
fi
|
||||
deprepo="$deprepo $1"
|
||||
shift
|
||||
|
Loading…
Reference in New Issue
Block a user