mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2024-12-22 15:02:59 +00:00
abump: source APKBUILD in subshell
As demonstrated in b7813c3
(abump: demonstrate abump environment
polution, 2022-10-15), sourcing APKBUILDs in abump polutes it's
environment.
Address that by sourcing the APKBUILD in a subshell as well as some of
the checks following it that need the information from the APKBUILD.
That information is not used any later, it's not an issue that it's
discarded outside of the subshell.
This commit is contained in:
parent
b7813c377c
commit
15b6128a45
5
abump.in
5
abump.in
@ -44,6 +44,10 @@ do_bump() {
|
|||||||
a=$(aports_buildscript "$name" ) \
|
a=$(aports_buildscript "$name" ) \
|
||||||
|| die "can't find APKBUILD for $name"
|
|| die "can't find APKBUILD for $name"
|
||||||
|
|
||||||
|
# sourcing APKBUILDs should not affect the environment of abump
|
||||||
|
# so do that in a subshell, along with any checks that need the
|
||||||
|
# information from the APKBUILD.
|
||||||
|
(
|
||||||
# verify APKBUILD
|
# verify APKBUILD
|
||||||
. "$a" || exit 1
|
. "$a" || exit 1
|
||||||
name=${name#*/}
|
name=${name#*/}
|
||||||
@ -54,6 +58,7 @@ do_bump() {
|
|||||||
if [ "$pkgver" = "$ver" ] && git diff-index --quiet HEAD -- "$a"; then
|
if [ "$pkgver" = "$ver" ] && git diff-index --quiet HEAD -- "$a"; then
|
||||||
die "version is already $ver"
|
die "version is already $ver"
|
||||||
fi
|
fi
|
||||||
|
)
|
||||||
|
|
||||||
cd "${a%/*}"
|
cd "${a%/*}"
|
||||||
section=${PWD%/*}
|
section=${PWD%/*}
|
||||||
|
Loading…
Reference in New Issue
Block a user