From 13c5edbe44af88028a120e22108ac4c1125abc9a Mon Sep 17 00:00:00 2001 From: Anja Rabich Date: Tue, 2 Sep 2025 16:35:46 +0200 Subject: [PATCH] fix: change awk mode from append to write Co-authored-by: Benjamin Lipp --- marzipan/README.md | 2 +- marzipan/TODO.md | 3 ++- marzipan/src/__init__.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/marzipan/README.md b/marzipan/README.md index 5354c6b..c8963f4 100644 --- a/marzipan/README.md +++ b/marzipan/README.md @@ -1,7 +1,7 @@ # Rewriting analyze.sh in Python * `../analyze.sh` is the old script -* `src/analyze.sh` is the new script +* `src/__init__.py` is the new script * call the old script from the Rosenpass repository's root directory with `./analyze.sh` * call the new script: diff --git a/marzipan/TODO.md b/marzipan/TODO.md index c612daf..d96e0ef 100644 --- a/marzipan/TODO.md +++ b/marzipan/TODO.md @@ -28,10 +28,11 @@ * ~~standalone function parse_result_line is no longer necessary~~ * ~~is the clean function still necessary?~~ * ~~implement better main function for click~~ +* ~~why does analyze fail when the target/proverif directory is not empty?~~ ## Next Steps -* why does analyze fail when the target/proverif directory is not empty? + * return an exit status that is meaningful for CI * exception handling in analyze() and in run_proverif() * refactor filtering in run_proverif (see karo's comment) diff --git a/marzipan/src/__init__.py b/marzipan/src/__init__.py index 14b27d0..d86eb7c 100644 --- a/marzipan/src/__init__.py +++ b/marzipan/src/__init__.py @@ -74,7 +74,7 @@ def cpp(file, cpp_prep): def awk(repo_path, cpp_prep, awk_prep): params = ["awk", "-f", str(pkgs.os.path.join(repo_path, "marzipan/marzipan.awk")), cpp_prep] - with open(awk_prep, 'a+') as file: + with open(awk_prep, 'w') as file: exc(params, stderr=pkgs.sys.stderr, stdout=file) file.write("\nprocess main")