[X2Go-Commits] [buildscripts] 13/14: bin/build-rpm-package: merge ${temp_cleanup} changes from bin/build-deb-package.

git-admin at x2go.org git-admin at x2go.org
Fri Apr 3 03:07:50 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 4d5b678512f675f3bfb00e08c3378d4658cf71e9
Author: Mihai Moldovan <ionic at ionic.de>
Date:   Fri Apr 3 03:06:32 2015 +0200

    bin/build-rpm-package: merge ${temp_cleanup} changes from bin/build-deb-package.
---
 bin/build-rpm-package |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/bin/build-rpm-package b/bin/build-rpm-package
index 6b30126..eccfd7e 100755
--- a/bin/build-rpm-package
+++ b/bin/build-rpm-package
@@ -61,6 +61,7 @@ test -f "${HOME}/.buildscripts/${PREFIX}.conf" && . "${HOME}/.buildscripts/${PRE
 TMP_MOCK_CFG_DIR=""
 TMP_MOCK_CFG_FILE=""
 TEMP_BASE="${HOME}/tmp/"
+typeset -ag temp_cleanup
 # End of non-user-serviceable part.
 
 set -ex
@@ -103,6 +104,14 @@ cleanup () {
 	else
 		echo "Warning: mock temporary config directory not defined. Skipping cleanup." >&2
 	fi
+
+	# Cleanup the other temporary dirs afterwards.
+	typeset temp_dir=""
+	for temp_dir in "${temp_cleanup[@]}"; do
+		if [ -n "${temp_dir}" ] && [ -d "${temp_dir}" ]; then
+			rm -Rf -- "${temp_dir}"
+		fi
+	done
 }
 
 # Run cleanup() automatically.
@@ -593,6 +602,7 @@ build_packages() {
 
 				# tar upstream sources from our Git clone
 				TEMP_DIR="$(mktemp -d --tmpdir="${TEMP_BASE}")"
+				temp_cleanup+=("${TEMP_DIR}")
 				mkdir -p -- "${TEMP_DIR}/${PROJECT}"
 				chmod -Rf -- 2770 "${TEMP_DIR}"
 

--
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