From: Remi Gacogne Date: Mon, 22 Sep 2025 10:15:03 +0000 (+0200) Subject: update-rust-library-version: Not DNSdist-specific X-Git-Tag: rec-5.4.0-alpha1~258^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27ee747f17b7887e7514ec9b4f87cf7c7ecd8f77;p=thirdparty%2Fpdns.git update-rust-library-version: Not DNSdist-specific Signed-off-by: Remi Gacogne --- diff --git a/builder-support/helpers/update-rust-library-version.py b/builder-support/helpers/update-rust-library-version.py index 0cd054b8a3..ca722384f7 100755 --- a/builder-support/helpers/update-rust-library-version.py +++ b/builder-support/helpers/update-rust-library-version.py @@ -15,14 +15,14 @@ def main(): version = sys.argv[3] with tempfile.NamedTemporaryFile(mode='w+t', encoding='utf-8', delete=False) as generated_fp: - with open(file_name, "r") as cargo_file: - in_dnsdist_rust_package_section = False + with open(file_name, 'r', encoding='utf-8') as cargo_file: + in_rust_package_section = False for line in cargo_file: if line.startswith('['): - in_dnsdist_rust_package_section = False + in_rust_package_section = False elif line == f'name = "{package_name}"\n': - in_dnsdist_rust_package_section = True - elif in_dnsdist_rust_package_section and line.startswith("version ="): + in_rust_package_section = True + elif in_rust_package_section and line.startswith("version ="): generated_fp.write(f"version = \"{version}\"\n") continue generated_fp.write(line)