summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Moldovan <ionic@ionic.de>2015-04-03 03:02:18 +0200
committerMihai Moldovan <ionic@ionic.de>2015-04-03 03:02:18 +0200
commita03cc980a44958ad24a2c588ba651f1d994673e2 (patch)
tree3ef6a753eb37a2acede7535c978c011bc465d736
parent69d4443031fa9cdc34811265738d4dcd47a4eb21 (diff)
downloadbuildscripts-a03cc980a44958ad24a2c588ba651f1d994673e2.tar.gz
buildscripts-a03cc980a44958ad24a2c588ba651f1d994673e2.tar.bz2
buildscripts-a03cc980a44958ad24a2c588ba651f1d994673e2.zip
bin/build-deb-package: change ${TEMP_CLEANUP} to lower-case variant and a bash array.
-rwxr-xr-xbin/build-deb-package12
1 files changed, 3 insertions, 9 deletions
diff --git a/bin/build-deb-package b/bin/build-deb-package
index ae9e095..3480e90 100755
--- a/bin/build-deb-package
+++ b/bin/build-deb-package
@@ -46,7 +46,7 @@ test -f "${HOME}/.buildscripts/${PREFIX}.conf" && . "${HOME}/.buildscripts/${PRE
: ${DEB_BUILD_FOR:="debian:${DEBIAN_DISTROS} ubuntu:${UBUNTU_DISTROS}"}
# These parts are not user-serviceable.
-TEMP_CLEANUP=""
+typeset -ag temp_cleanup=""
# End of non-user-serviceable part.
set -ex
@@ -54,14 +54,8 @@ set -ex
# Cleans up temporary directories and files.
# RFC SHOULD be called by trap handlers.
cleanup () {
- typeset -a temp_cleanup_arr
- typeset OLDIFS="${IFS}"
- IFS=":"
- read -a temp_cleanup_arr <<< "${TEMP_CLEANUP}"
- IFS="${OLDIFS}"
-
typeset temp_dir=""
- for temp_dir in "${temp_cleanup_arr[@]}"; do
+ for temp_dir in "${temp_cleanup[@]}"; do
if [ -d "${temp_dir}" ]; then
rm -Rf "${temp_dir}"
fi
@@ -234,7 +228,7 @@ build_packages() {
test -z "${CODENAMES}" || grep "${CODENAMES}" <<< "${line}" || break
TEMP_DIR="$(mktemp -d --tmpdir=${TEMP_BASE})"
- TEMP_CLEANUP="${TEMP_CLEANUP}:${TEMP_DIR}"
+ temp_cleanup+=("${TEMP_DIR}")
mkdir -p -- "${TEMP_DIR}/${PROJECT}"
chmod 2770 -Rf -- "${TEMP_DIR}"