summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 && {