From b00b97e3ea1d3279c772321a92fea3139ba76d47 Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Wed, 1 Apr 2015 08:27:58 +0200 Subject: bin/build-rpm-package: add the repos and do pass-through correctly. --- bin/build-rpm-package | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'bin/build-rpm-package') diff --git a/bin/build-rpm-package b/bin/build-rpm-package index 1db9c77..8409321 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -343,11 +343,27 @@ create_mock_config () { # MOCK_BASE CUSTOM_REPO COMPONENT TARGET REPO_START=1 elif [ "${REPO_START}" -eq "1" ] && [[ "${line}" =~ ${TMP_REGEX_END} ]]; then # Time to insert whatever is required. + printf '\n' >> "${TMP_MOCK_CFG_FILE}" + # Extras repo. + typeset -i i=0 + for ((i = 0; i < ${#extra_repo[@]}; ++i)); do + echo "${extra_repo[${i}]}" >> "${TMP_MOCK_CFG_FILE}" + done + + # Full repo if required. + if [ "${TARGET}" = "full" ]; then + printf '\n' >> "${TMP_MOCK_CFG_FILE}" + + typeset -i i=0 + for ((i = 0; i < ${#full_repo[@]}; ++i)); do + echo "${full_repo[${i}]}" >> "${TMP_MOCK_CFG_FILE}" + done + fi elif [ "${REPO_START}" -eq "0" ] && [[ "${line}" =~ ${TMP_REGEX_END} ]]; then echo "Error: Parsing mock base config file failed: unexpected end of yum configuration, no start found." >&2 exit -1 - elif [ "${REPO_START}" -eq "0" ]; then + else # Write-through. echo "${line}" >> "${TMP_MOCK_CFG_FILE}" fi -- cgit v1.2.3