# HG changeset patch # User Daniel Hahler # Date 1459951779 -7200 # Node ID e1f787e8d77c6c6c580558a258c43e706ceee7d0 # Parent df3b0ca480139292e5a6524d264889cc045d0a07 Make pattern for removal of existing lines more specific Explicitly match the file name in the second tab-delimited column. Also, add a "|| true" to handle the case where no lines would be selected by grep (e.g. after `touch tags` and only updating a single file). diff -r df3b0ca48013 -r e1f787e8d77c plat/unix/update_tags.sh --- a/plat/unix/update_tags.sh Fri Mar 25 20:41:38 2016 -0700 +++ b/plat/unix/update_tags.sh Wed Apr 06 16:09:39 2016 +0200 @@ -73,8 +73,10 @@ if [ -f "$TAGS_FILE" ]; then if [ "$UPDATED_SOURCE" != "" ]; then echo "Removing references to: $UPDATED_SOURCE" - echo "grep -v \"$UPDATED_SOURCE\" \"$TAGS_FILE\" > \"$TAGS_FILE.temp\"" - grep -v "$UPDATED_SOURCE" "$TAGS_FILE" > "$TAGS_FILE.temp" + tab=" " + cmd="grep -Ev '^[^$tab]+$tab$UPDATED_SOURCE$tab' '$TAGS_FILE' > '$TAGS_FILE.temp'" + echo "$cmd" + eval "$cmd" || true INDEX_WHOLE_PROJECT=0 fi fi