fix: change awk mode from append to write

Co-authored-by: Benjamin Lipp <blipp@rosenpass.eu>
This commit is contained in:
Anja Rabich
2025-09-02 16:35:46 +02:00
parent b1ac5d9244
commit 13c5edbe44
3 changed files with 4 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
# Rewriting analyze.sh in Python # Rewriting analyze.sh in Python
* `../analyze.sh` is the old script * `../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 old script from the Rosenpass repository's root directory with `./analyze.sh`
* call the new script: * call the new script:

View File

@@ -28,10 +28,11 @@
* ~~standalone function parse_result_line is no longer necessary~~ * ~~standalone function parse_result_line is no longer necessary~~
* ~~is the clean function still necessary?~~ * ~~is the clean function still necessary?~~
* ~~implement better main function for click~~ * ~~implement better main function for click~~
* ~~why does analyze fail when the target/proverif directory is not empty?~~
## Next Steps ## Next Steps
* why does analyze fail when the target/proverif directory is not empty?
* return an exit status that is meaningful for CI * return an exit status that is meaningful for CI
* exception handling in analyze() and in run_proverif() * exception handling in analyze() and in run_proverif()
* refactor filtering in run_proverif (see karo's comment) * refactor filtering in run_proverif (see karo's comment)

View File

@@ -74,7 +74,7 @@ def cpp(file, cpp_prep):
def awk(repo_path, cpp_prep, awk_prep): def awk(repo_path, cpp_prep, awk_prep):
params = ["awk", "-f", str(pkgs.os.path.join(repo_path, "marzipan/marzipan.awk")), cpp_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) exc(params, stderr=pkgs.sys.stderr, stdout=file)
file.write("\nprocess main") file.write("\nprocess main")