diff options
author | teor <teor@torproject.org> | 2019-11-06 15:52:18 +1000 |
---|---|---|
committer | teor <teor@torproject.org> | 2019-11-06 16:09:31 +1000 |
commit | 7f23d47f723edeea206d5438af3d109dbb4ac835 (patch) | |
tree | 3d50f855dac68ecfebab4a4416305454e300a85c /scripts/git/git-push-all.sh | |
parent | 57baea701f8852b94d8ebc3fd8e70ccc998f5036 (diff) | |
download | tor-7f23d47f723edeea206d5438af3d109dbb4ac835.tar.gz tor-7f23d47f723edeea206d5438af3d109dbb4ac835.zip |
shellcheck: Fix issues in the git-*.sh scripts
Fixes bug 32402; bugfix on 0.4.2.1-alpha.
Obviously correct changes to already reviewed code.
Diffstat (limited to 'scripts/git/git-push-all.sh')
-rwxr-xr-x | scripts/git/git-push-all.sh | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/scripts/git/git-push-all.sh b/scripts/git/git-push-all.sh index a388f01564..7c43fe24d8 100755 --- a/scripts/git/git-push-all.sh +++ b/scripts/git/git-push-all.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -SCRIPT_NAME=`basename $0` +SCRIPT_NAME=$(basename "$0") function usage() { @@ -237,7 +237,7 @@ if [ "$PUSH_SAME" -eq 0 ] && [ "$TEST_BRANCH_PREFIX" ]; then fi done if [ "$SKIP_UPSTREAM" ]; then - printf "Skipping unchanged: %s remote: %s\n" \ + printf "Skipping unchanged: %s remote: %s\\n" \ "$b" "$SKIP_UPSTREAM" else if [ "$NEW_PUSH_BRANCHES" ]; then @@ -261,18 +261,19 @@ if [ "$PUSH_DELAY" -le 0 ]; then $GIT_PUSH "$@" "$UPSTREAM_REMOTE" $PUSH_BRANCHES else # Push the branches in optimal CI order, with a delay between each push - PUSH_BRANCHES=$(echo "$PUSH_BRANCHES" | tr " " "\n" | sort -V) - MASTER_BRANCH=$(echo "$PUSH_BRANCHES" | tr " " "\n" | grep master) + PUSH_BRANCHES=$(echo "$PUSH_BRANCHES" | tr " " "\\n" | sort -V) + MASTER_BRANCH=$(echo "$PUSH_BRANCHES" | tr " " "\\n" | grep master) if [ -z "$TEST_BRANCH_PREFIX" ]; then - MAINT_BRANCHES=$(echo "$PUSH_BRANCHES" | tr " " "\n" | grep maint) - RELEASE_BRANCHES=$(echo "$PUSH_BRANCHES" | tr " " "\n" | grep release | \ - tr "\n" " ") - printf "Pushing with %ss delays, so CI runs in this order:\n%s\n%s\n%s\n" \ + MAINT_BRANCHES=$(echo "$PUSH_BRANCHES" | tr " " "\\n" | grep maint) + RELEASE_BRANCHES=$(echo "$PUSH_BRANCHES" | tr " " "\\n" | grep release | \ + tr "\\n" " ") + printf \ + "Pushing with %ss delays, so CI runs in this order:\\n%s\\n%s\\n%s\\n" \ "$PUSH_DELAY" "$MASTER_BRANCH" "$MAINT_BRANCHES" "$RELEASE_BRANCHES" else # Actually test branches based on maint branches - MAINT_BRANCHES=$(echo "$PUSH_BRANCHES" | tr " " "\n" | grep -v master) - printf "Pushing with %ss delays, so CI runs in this order:\n%s\n%s\n" \ + MAINT_BRANCHES=$(echo "$PUSH_BRANCHES" | tr " " "\\n" | grep -v master) + printf "Pushing with %ss delays, so CI runs in this order:\\n%s\\n%s\\n" \ "$PUSH_DELAY" "$MASTER_BRANCH" "$MAINT_BRANCHES" # No release branches RELEASE_BRANCHES= |