diff packaging/linux-installer.inc @ 1258:469c1a04b678

(issue54) On update copy and remove the updated files instead of extracting This avoids errors when the application is running.
author Andre Heinecke <andre.heinecke@intevation.de>
date Fri, 26 Sep 2014 12:45:27 +0200
parents 551b274ec4d1
children 5e0c338552b4
line wrap: on
line diff
--- 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"

http://wald.intevation.org/projects/trustbridge/