Mercurial > trustbridge
comparison 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 |
comparison
equal
deleted
inserted
replaced
1257:551b274ec4d1 | 1258:469c1a04b678 |
---|---|
153 local -a temp_dirs | 153 local -a temp_dirs |
154 if [ "${lock_dir:-}" ]; then | 154 if [ "${lock_dir:-}" ]; then |
155 # $lock_dir is generate by the shar | 155 # $lock_dir is generate by the shar |
156 temp_dirs+=("${instcfg[PREFIX]}/$lock_dir") | 156 temp_dirs+=("${instcfg[PREFIX]}/$lock_dir") |
157 fi | 157 fi |
158 if [ "${TMPEXTRACT_DIR:-}" ]; then | |
159 temp_dirs+=("$TMPEXTRACT_DIR") | |
160 fi | |
161 | |
158 if [ "${lock_dir:-}" ]; then | 162 if [ "${lock_dir:-}" ]; then |
159 temp_dirs+=("$extra_bin_path") | 163 temp_dirs+=("$extra_bin_path") |
160 fi | 164 fi |
161 | 165 |
162 for dir in "${temp_dirs[@]-}" ; do | 166 for dir in "${temp_dirs[@]-}" ; do |
322 getxt "checking for uudecode ...\n" | 326 getxt "checking for uudecode ...\n" |
323 provide_uudecode_maybe | 327 provide_uudecode_maybe |
324 | 328 |
325 getxt "unpacking files ...\n" | 329 getxt "unpacking files ...\n" |
326 OLDWD="$PWD" | 330 OLDWD="$PWD" |
327 cd "${instcfg[PREFIX]}" | 331 |
332 if [ $UPDATE -eq 1 ]; then | |
333 # Trustbridge might be running. Install into temporary dir | |
334 # and move the directory into the installation prefix afterwards | |
335 TMPEXTRACT_DIR=$(mktemp -d) | |
336 cd "$TMPEXTRACT_DIR" | |
337 else | |
338 cd "${instcfg[PREFIX]}" | |
339 fi | |
328 | 340 |
329 set +u | 341 set +u |
330 set -- '-c' | 342 set -- '-c' |
331 # ---------------------------------------------------------------------- | 343 # ---------------------------------------------------------------------- |
332 # regular shar archive inserted here: | 344 # regular shar archive inserted here: |
333 ###SHAR### | 345 ###SHAR### |
334 # ---------------------------------------------------------------------- | 346 # ---------------------------------------------------------------------- |
335 | 347 |
348 if [ $UPDATE -eq 1 ]; then | |
349 cp -fr "$TMPEXTRACT_DIR/bin" "${instcfg[PREFIX]}" | |
350 cp -fr "$TMPEXTRACT_DIR/share" "${instcfg[PREFIX]}" | |
351 fi | |
352 | |
336 cd "$OLDWD" | 353 cd "$OLDWD" |
337 | 354 |
338 getxt "Preparing trustbridge-tray-starter ...\n" | 355 getxt "Preparing trustbridge-tray-starter ...\n" |
339 sed -i "/^PREFIX=/c\PREFIX='${instcfg[PREFIX]}'" \ | 356 sed -i "/^PREFIX=/c\PREFIX='${instcfg[PREFIX]}'" \ |
340 "${instcfg[PREFIX]}/bin/trustbridge-tray-starter.sh" | 357 "${instcfg[PREFIX]}/bin/trustbridge-tray-starter.sh" |