osmith has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40212?usp=email )
Change subject: log_merge: ensure we don't overwrite the log file
......................................................................
log_merge: ensure we don't overwrite the log file
Add a safety check that ensures we don't overwrite an existing log file
by accident.
Change-Id: Ieda3d95c60dfae208959b80d55a1e8c3925a9dad
---
M log_merge.sh
1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/12/40212/1
diff --git a/log_merge.sh b/log_merge.sh
index aecca4a..7560fe9 100755
--- a/log_merge.sh
+++ b/log_merge.sh
@@ -23,6 +23,10 @@
for t in $TEST_CASES; do
PREFIX="$BASE_NAME-$t"
OUTPUT="$BASE_NAME.$t.merged"
+ if [ -e "$OUTPUT" ]; then
+ >&2 echo "log_merge: ERROR: file already exists: $OUTPUT"
+ exit 1
+ fi
ttcn3_logmerge $PREFIX-*.log > "$OUTPUT"
echo "Generated $OUTPUT"
done
--
To view, visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/40212?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ieda3d95c60dfae208959b80d55a1e8c3925a9dad
Gerrit-Change-Number: 40212
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith(a)sysmocom.de>