From a8fe13f19fd5631f7b9f8d7ffcf2fcfd85562464 Mon Sep 17 00:00:00 2001 From: Mihai Moldovan Date: Wed, 1 Apr 2015 06:44:56 +0200 Subject: bin/build-rpm-package: finally create the temporary dir and file. --- bin/build-rpm-package | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'bin') diff --git a/bin/build-rpm-package b/bin/build-rpm-package index 7be653e..de2e02d 100755 --- a/bin/build-rpm-package +++ b/bin/build-rpm-package @@ -271,6 +271,19 @@ create_mock_config () { # MOCK_BASE CUSTOM_REPO COMPONENT TARGET echo "Error: TARGET parameter must be either full or base." >&2 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_NAME}-mock-$(repeat_str "X" "24")")" + if [ "$?" -ne "0" ]; then + echo "Error: creating mock temporary config directory failed. Aborting." >&2 + exit -1 + fi + + TMP_MOCK_CFG_FILE="$(mktemp --tmpdir="${TEMP_BASE}" "$(basename "${TMP_MOCK_CFG_DIR}")/${MOCK_BASE}-${RPM_EXTRA_REPO_MOCK_CONFIG_BASE_NAME}-${COMPONENT}-${TARGET}.$(repeat_str "X" "24").cfg")" + if [ "$?" -ne "0" ]; then + echo "Error: creating mock temporary config file failed. Aborting." >&2 + exit -1 + fi } get_extra_repository () { -- cgit v1.2.3