diff options
author | Mihai Moldovan <ionic@ionic.de> | 2015-04-01 12:21:52 +0200 |
---|---|---|
committer | Mihai Moldovan <ionic@ionic.de> | 2015-04-01 12:21:52 +0200 |
commit | 5700080edcaba0cc3b4e1e3876a05fb3ff3311b8 (patch) | |
tree | 0e4c0b08e46ada8cacd1a035f85a21a95cd10142 /bin | |
parent | a68ef9f17a817fdf81297faa8dc76c552cae53b6 (diff) | |
download | buildscripts-5700080edcaba0cc3b4e1e3876a05fb3ff3311b8.tar.gz buildscripts-5700080edcaba0cc3b4e1e3876a05fb3ff3311b8.tar.bz2 buildscripts-5700080edcaba0cc3b4e1e3876a05fb3ff3311b8.zip |
bin/build-rpm-package: only create a new temporary mock config directory if not already existing. Fix replacement of releasever.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/build-rpm-package | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/bin/build-rpm-package b/bin/build-rpm-package index 1e77075..c344dc9 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -313,11 +313,14 @@ create_mock_config () { # MOCK_BASE CUSTOM_REPO COMPONENT TARGET exit -1 fi - # Create temporary directory for our soon-to-be temporary mock config file. - TMP_MOCK_CFG_DIR="$(mktemp -d --tmpdir="${TEMP_BASE}" "${RPM_EXTRA_REPO_MOCK_CONFIG_BASE}-mock-$(repeat_str "X" "24")")" - if [ "$?" -ne "0" ]; then - echo "Error: creating mock temporary config directory failed. Aborting." >&2 - exit -1 + # Create temporary directory for our soon-to-be temporary mock config file, + # if it does not already exist. + if [ -z "${TMP_MOCK_CFG_DIR}" ]; then + TMP_MOCK_CFG_DIR="$(mktemp -d --tmpdir="${TEMP_BASE}" "${RPM_EXTRA_REPO_MOCK_CONFIG_BASE}-mock-$(repeat_str "X" "24")")" + if [ "$?" -ne "0" ]; then + echo "Error: creating mock temporary config directory failed. Aborting." >&2 + exit -1 + fi fi TMP_MOCK_CFG_FILE="$(mktemp --tmpdir="${TEMP_BASE}" "$(basename "${TMP_MOCK_CFG_DIR}")/${MOCK_BASE%.cfg}-${RPM_EXTRA_REPO_MOCK_CONFIG_BASE}-${COMPONENT}-${TARGET}.$(repeat_str "X" "24").cfg")" @@ -360,7 +363,7 @@ create_mock_config () { # MOCK_BASE CUSTOM_REPO COMPONENT TARGET fi case "${line}" in - (*'$releasever'*) line="${line/'$releasever'/"${VERSION}"}" + (*'$releasever'*) line="${line/'$releasever'/${VERSION}}" ;; (*) ;; esac |