# HG changeset patch # User Gerhard Siegesmund # Date 1414587427 -3600 # Node ID aed756d6934e1639fc151e603c03f515ba3a609b # Parent 302b5e860fc34578aed3dd9aba215ab3fe263a9d Prevent lock and temp-File to remain after forced exit. Added trap to remove those temporary files if the script gets stopped unexpectedly (e.g. when vim is exited before the tag-file is fully generated.) Also changed /bin/sh to /bin/bash, because [[ ]] doesn't work with an standard shell. You need at least bash. diff -r 302b5e860fc3 -r aed756d6934e plat/unix/update_tags.sh --- a/plat/unix/update_tags.sh Tue Oct 21 20:21:31 2014 -0700 +++ b/plat/unix/update_tags.sh Wed Oct 29 13:57:07 2014 +0100 @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e @@ -65,6 +65,9 @@ echo "Locking tags file..." echo $$ > "$TAGS_FILE.lock" +# Remove lock and temp file if script is stopped unexpectedly. +trap "rm -f \"$TAGS_FILE.lock\" \"$TAGS_FILE.temp\"" 0 3 4 15 + if [[ -f "$TAGS_FILE" ]]; then if [[ "$UPDATED_SOURCE" != "" ]]; then echo "Removing references to: $UPDATED_SOURCE"