]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
shellcheck: Fix new warnings
authorDavid Goulet <dgoulet@torproject.org>
Tue, 10 Jan 2023 14:11:52 +0000 (09:11 -0500)
committerDavid Goulet <dgoulet@torproject.org>
Tue, 10 Jan 2023 14:11:58 +0000 (09:11 -0500)
Nothing important, mostly false positive except one case.

Signed-off-by: David Goulet <dgoulet@torproject.org>
scripts/ci/ci-driver.sh
scripts/maint/code-format.sh
src/test/test_include.sh
src/test/test_rebind.sh

index ef31da1ca35620b2e0025b8b4323efbe8235304d..93d764f2621fa27157613cfcb203ba6c647a96a5 100755 (executable)
@@ -375,7 +375,6 @@ if [[ "$RUN_STAGE_BUILD" = "yes" ]] ; then
             hooray "Distcheck was successful. Nothing further will be done."
             # We have to exit early here, since we can't do any other tests.
             cp tor-*.tar.gz "${CI_SRCDIR}"/artifacts
-            exit 0
         else
             error "Diagnostics:"
             runcmd make show-distdir-testlog || true
@@ -383,6 +382,7 @@ if [[ "$RUN_STAGE_BUILD" = "yes" ]] ; then
             die "Unable to continue."
         fi
         end_section Distcheck
+        exit 0
     fi
 fi
 
index d8f597d70d270b11064a91582f200b08881940cc..5998e96f6810ce8e47ab43b43eb675a9faf988c4 100755 (executable)
@@ -160,11 +160,17 @@ if [[ $GITIDX = 1 ]]; then
     # partially staged.
     note "Stashing unstaged changes"
     git stash -q --keep-index
+    # For some reasons, shellcheck is not seeing that we can call this
+    # function from the trap below.
+    # shellcheck disable=SC2317
     function restoregit() {
         note "Restoring git state"
         git stash pop -q
     }
 else
+    # For some reasons, shellcheck is not seeing that we can call this
+    # function from the trap below.
+    # shellcheck disable=SC2317
     function restoregit() {
         true
     }
index 6cf695fe44655555e020aa719e0df75079569bac..10d3bc502d8a7f42784c1f92521c4fe478e1e602 100755 (executable)
@@ -48,6 +48,9 @@ if "${TOR_BINARY}" --list-modules | grep -q "relay: no"; then
 fi
 
 tmpdir=
+# For some reasons, shellcheck is not seeing that we can call this
+# function from the trap below.
+# shellcheck disable=SC2317
 clean () {
   if [ -n "$tmpdir" ] && [ -d "$tmpdir" ]; then
     rm -rf "$tmpdir"
index 879008c1c12d3eeccb93ed3ad8a5df7890ea44a8..aae2a9a6a0cb3db1d793ce71c46c25975e963edd 100755 (executable)
@@ -46,6 +46,9 @@ if "${TOR_BINARY}" --list-modules | grep -q "relay: no"; then
 fi
 
 tmpdir=
+# For some reasons, shellcheck is not seeing that we can call this
+# function from the trap below.
+# shellcheck disable=SC2317
 clean () {
   if [ -n "$tmpdir" ] && [ -d "$tmpdir" ]; then
     rm -rf "$tmpdir"