Browse Source

ci: Add datetime to debian version to ensure correct ordering (fixes #3140)

Stefan Profanter 4 years ago
parent
commit
f6f855d04e
1 changed files with 5 additions and 0 deletions
  1. 5 0
      tools/prepare_packaging.py

+ 5 - 0
tools/prepare_packaging.py

@@ -8,6 +8,7 @@ import subprocess
 import os
 import re
 from email.utils import formatdate
+import datetime
 
 
 dirpath = os.path.join(os.path.dirname(os.path.realpath(__file__)),"..")
@@ -43,6 +44,10 @@ changelog_version = git_describe_version[1:] if git_describe_version[0] == 'v' e
 # replace all '-' with '~' in version
 changelog_version = changelog_version.replace('-', '~')
 
+# prefix the version string with the current ISO datetime to ensure correct version ordering.
+# See https://github.com/open62541/open62541/issues/3140
+changelog_version = datetime.datetime.utcnow().replace(microsecond=0).isoformat().replace('-', '').replace(':', '') + '~' + changelog_version
+
 with open(changelog_file, 'r') as original: data = original.read()
 with open(changelog_file, 'w') as modified:
     new_entry = """open62541 ({version}) {distribution}; urgency=medium