[tor-commits] [tor/main] Correct syntax & formatting in test_pratracker.sh
dgoulet at torproject.org
dgoulet at torproject.org
Wed Aug 25 15:07:57 UTC 2021
commit bbbeed942f10b8076d56d3fc6c700b14e4e957d3
Author: skaluzka <skaluzka at protonmail.com>
Date: Sun Aug 22 20:36:36 2021 +0200
Correct syntax & formatting in test_pratracker.sh
Use 4 spaces for indentations.
Use the same syntax for all functions.
No real code changes (except removal of unnecessary ";" from
"exit 1" command).
---
scripts/maint/practracker/test_practracker.sh | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/scripts/maint/practracker/test_practracker.sh b/scripts/maint/practracker/test_practracker.sh
index e29b9106de..bb734ad9cd 100755
--- a/scripts/maint/practracker/test_practracker.sh
+++ b/scripts/maint/practracker/test_practracker.sh
@@ -1,15 +1,15 @@
#!/bin/sh
-# Fail if any subprocess fails unexpectedly
+# Fail this script if any subprocess fails unexpectedly.
set -e
umask 077
unset TOR_DISABLE_PRACTRACKER
TMPDIR=""
-clean () {
+clean() {
if [ -n "$TMPDIR" ] && [ -d "$TMPDIR" ]; then
- rm -rf "$TMPDIR"
+ rm -rf "$TMPDIR"
fi
}
trap clean EXIT HUP INT TERM
@@ -27,7 +27,7 @@ PRACTRACKER_DIR="scripts/maint/practracker"
TMPDIR="$(mktemp -d -t pracktracker.test.XXXXXX)"
if test -z "${TMPDIR}" || test ! -d "${TMPDIR}" ; then
echo >&2 "mktemp failed."
- exit 1;
+ exit 1
fi
DATA="${PRACTRACKER_DIR}/testdata"
@@ -43,6 +43,7 @@ run_practracker() {
--terse \
"${DATA}/" "$@" || echo "practracker exit status: $?"
}
+
compare() {
# we can't use cmp because we need to use -b for windows
diff -b -u "$@" > "${TMPDIR}/test-diff" || true
More information about the tor-commits
mailing list