From 2537dd548c2791f42d56ddac7bfa364605c1913e Mon Sep 17 00:00:00 2001 From: Alina Lenk Date: Mon, 11 Apr 2022 00:07:35 +0200 Subject: [PATCH 2/2] generate_packets.py: Don't lazy-overwrite unless requested at configure-time See osdn #43995 Signed-off-by: Alina Lenk --- common/Makefile.am | 3 ++- common/generate_packets.py | 11 +++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/common/Makefile.am b/common/Makefile.am index 1c4fede216..8eec80b17e 100644 --- a/common/Makefile.am +++ b/common/Makefile.am @@ -169,7 +169,8 @@ packets_generate: networking/packets.def generate_packets.py --client-h ../client/packhand_gen.h \ --client-c ../client/packhand_gen.c \ --server-h ../server/hand_gen.h \ - --server-c ../server/hand_gen.c + --server-c ../server/hand_gen.c \ + $(GENERATE_PACKETS_ARGS) touch packets_generate # These files are not generated to builddir, but to srcdir */ diff --git a/common/generate_packets.py b/common/generate_packets.py index 76f0d907d0..6a18eade03 100755 --- a/common/generate_packets.py +++ b/common/generate_packets.py @@ -30,7 +30,7 @@ from itertools import chain, combinations # See get_argparser for what each of these does # Keep initial values in sync with argparser defaults is_verbose = False -lazy_overwrite = True +lazy_overwrite = False generate_stats = False generate_logs = True use_log_macro = "log_packet_detailed" @@ -108,13 +108,12 @@ def get_argparser(): script.add_argument("-v", "--verbose", action = "store_true", help = "enable log messages during code generation") - # Default behavior: Only overwrite existing output files when they + # When enabled: Only overwrite existing output files when they # actually changed. This prevents make from rebuilding all dependents # in cases where that wouldn't even be necessary. - script.add_argument("-f", "--force-overwrite", - dest = "lazy_overwrite", action = "store_false", - help = "always overwrite output files, even when" - " their contents didn't change") + script.add_argument("--lazy-overwrite", action = "store_true", + help = "only overwrite output files when their" + " contents actually changed") output.add_argument("-s", "--gen-stats", action = "store_true", help = "generate code reporting packet usage" -- 2.17.1