summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Moldovan <ionic@ionic.de>2015-04-02 02:10:12 +0200
committerMihai Moldovan <ionic@ionic.de>2015-04-02 02:10:12 +0200
commit6b011cad6a6d59535d1d1fe810a5ba5774e2ec5b (patch)
tree58f2576ea07e1cb64bddc83f7e2d001118fb3ce2
parent178c291d22ce4a410643c3b9e073f3afd1726ad3 (diff)
downloadbuildscripts-6b011cad6a6d59535d1d1fe810a5ba5774e2ec5b.tar.gz
buildscripts-6b011cad6a6d59535d1d1fe810a5ba5774e2ec5b.tar.bz2
buildscripts-6b011cad6a6d59535d1d1fe810a5ba5774e2ec5b.zip
bin/build-rpm-package: do not create a subshell in build_packages(), so that TMP_MOCK_CFG_DIR is actually modified in the main process.
-rwxr-xr-xbin/build-rpm-package10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/build-rpm-package b/bin/build-rpm-package
index e6f42a9..ecf699c 100755
--- a/bin/build-rpm-package
+++ b/bin/build-rpm-package
@@ -560,7 +560,15 @@ clear_pkgdist() {
}
build_packages() {
- echo "$RPM_BUILD_FOR" | sed -e 's/ /\n/g' | while read line; do
+ # Do spawn a subshell here. Functions like get_extra_repository() need to
+ # change global variables in the main process.
+ typeset -a RPM_BUILD_FOR_ARR
+ typeset OLDIFS="${IFS}"
+ IFS=" "
+ read -a RPM_BUILD_FOR_ARR <<< "${RPM_BUILD_FOR}"
+ IFS="${OLDIFS}"
+
+ for line in "${RPM_BUILD_FOR_ARR[@]}"; do
l_DIST="$(echo ${line/: /:} | cut -d":" -f1 | tr [:upper:] [:lower:])"
l_CODENAMES="${CODENAMES:-$(echo ${line/: /:} | cut -d":" -f2- | sed -e 's/,/ /g' | tr [:upper:] [:lower:])}"
echo "$RPM_DISTS_SUPPORTED" | grep $l_DIST >/dev/null && {