diff options
author | Stefan Kangas <stefan@marxist.se> | 2021-11-10 13:06:24 +0100 |
---|---|---|
committer | Stefan Kangas <stefan@marxist.se> | 2021-11-10 13:06:58 +0100 |
commit | e3f5f5d8672567d0b29dd83005bd5a399cab90c3 (patch) | |
tree | 86ed5bd9da9cd2ebb87c35ccfe8a4c5f6b5ed302 /admin | |
parent | 99abafdd0d77aa53f9d4d24c543d5aca54f9c8a1 (diff) | |
download | emacs-e3f5f5d8672567d0b29dd83005bd5a399cab90c3.tar.gz |
* admin/automerge: Fix quoting of some variables.
Diffstat (limited to 'admin')
-rwxr-xr-x | admin/automerge | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/admin/automerge b/admin/automerge index 7d71f290086..227a404b7a3 100755 --- a/admin/automerge +++ b/admin/automerge @@ -37,7 +37,7 @@ die () # write error to stderr and exit { - [ $# -gt 0 ] && echo "$PN: $@" >&2 + [ $# -gt 0 ] && echo "$PN: $*" >&2 exit 1 } @@ -133,7 +133,7 @@ else tempfile=/tmp/$PN.$$ fi -trap "rm -f $tempfile 2> /dev/null" EXIT +trap 'rm -f $tempfile 2> /dev/null' EXIT [ -e Makefile ] && [ "$build" ] && { @@ -153,7 +153,7 @@ trap "rm -f $tempfile 2> /dev/null" EXIT rev=$(git rev-parse HEAD) -[ $(git rev-parse @{u}) = $rev ] || die "Local state does not match origin" +[ "$(git rev-parse @{u})" = "$rev" ] || die "Local state does not match origin" merge () @@ -162,12 +162,12 @@ merge () if $emacs --batch -Q -l ./admin/gitmerge.el \ --eval "(setq gitmerge-minimum-missing $nmin)" -f gitmerge \ - >| $tempfile 2>&1; then + >| "$tempfile" 2>&1; then echo "merged ok" return 0 else - grep -E "Nothing to merge|Number of missing commits" $tempfile && \ + grep -E "Nothing to merge|Number of missing commits" "$tempfile" && \ exit 0 cat "$tempfile" 1>&2 @@ -191,13 +191,13 @@ git diff --stat --cached origin/master | grep -q "etc/NEWS " && \ echo "Running autoreconf..." -autoreconf -i -I m4 2>| $tempfile +autoreconf -i -I m4 2>| "$tempfile" retval=$? ## Annoyingly, autoreconf puts the "installing `./foo' messages on stderr. if [ "$quiet" ]; then - grep -v 'installing `\.' $tempfile 1>&2 + grep -v 'installing `\.' "$tempfile" 1>&2 else cat "$tempfile" 1>&2 fi @@ -236,7 +236,7 @@ echo "Tests finished ok" echo "Checking for remote changes..." git fetch || die "fetch error" -[ $(git rev-parse @{u}) = $rev ] || { +[ "$(git rev-parse @{u})" = "$rev" ] || { echo "Upstream has changed" @@ -245,7 +245,7 @@ git fetch || die "fetch error" ## Ref eg https://lists.gnu.org/r/emacs-devel/2014-12/msg01435.html ## Instead, we throw away what we just did, and do the merge again. echo "Resetting..." - git reset --hard $rev + git reset --hard "$rev" echo "Pulling..." git pull --ff-only || die "pull error" |