[PATCH 3 of 6] (issue54) On update copy and remove the updated files instead of extracting

Wald Commits scm-commit at wald.intevation.org
Fri Sep 26 15:26:22 CEST 2014


# HG changeset patch
# User Andre Heinecke <andre.heinecke at intevation.de>
# Date 1411728327 -7200
# Node ID 469c1a04b678b20dd5e36bc71b48b26b12cf9917
# Parent  551b274ec4d1488b84a171b399e086aa526788a5
(issue54) On update copy and remove the updated files instead of extracting

    This avoids errors when the application is running.

diff -r 551b274ec4d1 -r 469c1a04b678 packaging/linux-installer.inc
--- a/packaging/linux-installer.inc	Fri Sep 26 12:44:19 2014 +0200
+++ b/packaging/linux-installer.inc	Fri Sep 26 12:45:27 2014 +0200
@@ -155,6 +155,10 @@
       # $lock_dir is generate by the shar
       temp_dirs+=("${instcfg[PREFIX]}/$lock_dir")
   fi
+  if [ "${TMPEXTRACT_DIR:-}" ]; then
+      temp_dirs+=("$TMPEXTRACT_DIR")
+  fi
+
   if [ "${lock_dir:-}" ]; then
       temp_dirs+=("$extra_bin_path")
   fi
@@ -324,7 +328,15 @@
 
 getxt "unpacking files ...\n"
 OLDWD="$PWD"
-cd "${instcfg[PREFIX]}"
+
+if [ $UPDATE -eq 1 ]; then
+    # Trustbridge might be running. Install into temporary dir
+    # and move the directory into the installation prefix afterwards
+    TMPEXTRACT_DIR=$(mktemp -d)
+    cd "$TMPEXTRACT_DIR"
+else
+    cd "${instcfg[PREFIX]}"
+fi
 
 set +u
 set -- '-c'
@@ -333,6 +345,11 @@
 ###SHAR###
 # ----------------------------------------------------------------------
 
+if [ $UPDATE -eq 1 ]; then
+    cp -fr "$TMPEXTRACT_DIR/bin" "${instcfg[PREFIX]}"
+    cp -fr "$TMPEXTRACT_DIR/share" "${instcfg[PREFIX]}"
+fi
+
 cd "$OLDWD"
 
 getxt "Preparing trustbridge-tray-starter ...\n"


More information about the Trustbridge-commits mailing list