[PATCH 1 of 4] Fixed cleanup of temporary directories

Wald Commits scm-commit at wald.intevation.org
Wed Sep 17 15:06:35 CEST 2014


# HG changeset patch
# User Sascha Wilde <wilde at intevation.de>
# Date 1410952391 -7200
# Node ID db43c9a6293530ba0203863b7eb0621ac628c9ed
# Parent  9651fabca17d73764b66cef2138ada8ed524b89b
Fixed cleanup of temporary directories.

diff -r 9651fabca17d -r db43c9a62935 packaging/linux-installer.inc.in
--- a/packaging/linux-installer.inc.in	Wed Sep 17 09:15:47 2014 +0200
+++ b/packaging/linux-installer.inc.in	Wed Sep 17 13:13:11 2014 +0200
@@ -271,12 +271,16 @@
 cleanup()
 {
   getxt "Cleaning up temporary stuff ...\n"
-  # remove temporary directories,
-  # $lock_dir is generate by the shar
-  if [ -z "${lock_dir-}" ]; then
-    exit
+
+  # remove temporary directories:
+  local -a temp_dirs
+  if [ "${lock_dir}" ]; then
+      # $lock_dir is generate by the shar
+      temp_dirs+=("${instcfg[PREFIX]}/$lock_dir")
   fi
-  for dir in "${instcfg[PREFIX]}/$lock_dir" "$extra_bin_path" ; do
+  temp_dirs+=("$extra_bin_path")
+  
+  for dir in "${temp_dirs[@]}" ; do
     [ -d "$dir" ] &&
         rm -rf "$dir"
   done


More information about the Trustbridge-commits mailing list