[X2Go-Commits] [buildscripts] 03/03: 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.

git-admin at x2go.org git-admin at x2go.org
Thu Apr 2 02:10:46 CEST 2015


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository buildscripts.

commit 6b011cad6a6d59535d1d1fe810a5ba5774e2ec5b
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Thu Apr 2 02:10:12 2015 +0200

    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.
---
 bin/build-rpm-package |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

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 && {

--
Alioth's /srv/git/code.x2go.org/buildscripts.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/buildscripts.git


More information about the x2go-commits mailing list