]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Make version number in rust lib confirm to Rust specifics
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 29 Oct 2025 11:31:12 +0000 (12:31 +0100)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Wed, 29 Oct 2025 12:41:33 +0000 (13:41 +0100)
Signed-off-by: Otto Moerbeek <otto.moerbeek@open-xchange.com>
builder-support/helpers/update-rust-library-version.py

index ca722384f79103a6f54b7dc09d3cd82c13309547..88904293804959dab1ba38d58010a9944eb2a1c7 100755 (executable)
@@ -4,6 +4,7 @@
 import shutil
 import sys
 import tempfile
+import re
 
 def main():
     if len(sys.argv) != 4:
@@ -14,6 +15,8 @@ def main():
     package_name = sys.argv[2]
     version = sys.argv[3]
 
+    # convert the serial so that it conforms to Rust rules: x.x.x-whatever
+    version = re.sub(r'([0-9]+\.[0-9]+\.[0-9]+)\.', r'\1-', version)
     with tempfile.NamedTemporaryFile(mode='w+t', encoding='utf-8', delete=False) as generated_fp:
         with open(file_name, 'r', encoding='utf-8') as cargo_file:
             in_rust_package_section = False