[X2Go-Commits] [buildscripts] 02/07: bin/build-rpm-package: populate arrays with data read from .repo files.
git-admin at x2go.org
git-admin at x2go.org
Wed Apr 1 08:45:25 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 2b13ca64c90372ffb28d2565fb13447240ced016
Author: Mihai Moldovan <ionic at ionic.de>
Date: Wed Apr 1 07:52:36 2015 +0200
bin/build-rpm-package: populate arrays with data read from .repo files.
---
bin/build-rpm-package | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/bin/build-rpm-package b/bin/build-rpm-package
index ba4c23b..44384bd 100755
--- a/bin/build-rpm-package
+++ b/bin/build-rpm-package
@@ -306,11 +306,32 @@ create_mock_config () { # MOCK_BASE CUSTOM_REPO COMPONENT TARGET
OLDIFS="${IFS}"
IFS="$(printf '\n')"
- # Fetch the requested lines from ${CUSTOM_REPO} and store them in an array.
+ # Fetch the requested lines from ${CUSTOM_REPO} and store them in arrays.
typeset -a extra_repo
- typeset -i FETCH_SECTION=0
+ typeset -a full_repo
+ typeset -i FETCH_EXTRA_SECTION=0
+ typeset -i FETCH_FULL_SECTION=0
+ TMP_REGEX_EXTRA="^[[:space:]]*\[[[:space:]]*${RPM_EXTRA_REPO_MOCK_CONFIG_BASE_NAME}-extras-${DISTRO}[[:space:]]*\][[:space:]]*$"
+ TMP_REGEX_FULL="^[[:space:]]*\[[[:space:]]*${RPM_EXTRA_REPO_MOCK_CONFIG_BASE_NAME}-${COMPONENT}-${DISTRO}[[:space:]]*\][[:space:]]*$"
+ TMP_REGEX_OTHER="^[[:space:]]*\[.*\][[:space:]]*$"
+
while read line; do
+ if [[ "${line}" =~ ${TMP_REGEX_EXTRA} ]]; then
+ FETCH_EXTRA_SECTION=1
+ FETCH_FULL_SECTION=0
+ elif [[ "${line}" =~ ${TMP_REGEX_FULL} ]]; then
+ FETCH_FULL_SECTION=1
+ FETCH_EXTRA_SECTION=0
+ elif [[ "${line}" =~ ${TMP_REGEX_OTHER} ]]; then
+ FETCH_FULL_SECTION=0
+ FETCH_EXTRA_SECTION=0
+ fi
+ if [ "${FETCH_EXTRA_SECTION}" -eq "1" ]; then
+ extra_repo+=("${line}")
+ elif [ "${FETCH_FULL_SECTION}" -eq "1" ]; then
+ full_repo+=("${line}")
+ fi
done < "/etc/mock/${CUSTOM_REPO}"
typeset -i REPO_START=0
--
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