From 5a7b10e867542e5411d60a7a0e7440ced3c5f956 Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Wed, 1 Apr 2015 08:34:15 +0200 Subject: bin/build-rpm-package: write out end of yum configuration marker, reset IFS to old value and return temporary file path as promised. --- bin/build-rpm-package | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'bin') diff --git a/bin/build-rpm-package b/bin/build-rpm-package index 8409321..20f3d7d 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -360,6 +360,8 @@ create_mock_config () { # MOCK_BASE CUSTOM_REPO COMPONENT TARGET echo "${full_repo[${i}]}" >> "${TMP_MOCK_CFG_FILE}" done fi + + echo "${line}" >> "${TMP_MOCK_CFG_FILE}" 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 @@ -368,6 +370,12 @@ create_mock_config () { # MOCK_BASE CUSTOM_REPO COMPONENT TARGET echo "${line}" >> "${TMP_MOCK_CFG_FILE}" fi done < "/etc/mock/${MOCK_BASE}" + + # Reset input field separator to original value. + IFS="${OLDIFS}" + + # Strictly speaking not necessary, but do it anyway. + printf "${TMP_MOCK_CFG_FILE}" } get_extra_repository () { -- cgit v1.2.3