commit 3bc7c75dfa70483f19c987de8c217d0497d9d524
parent c59a0851e7c102a39cf51e59f329900ec4c911ae
Author: Florian Dold <florian@dold.me>
Date: Thu, 12 Jun 2025 23:51:29 +0200
packaging: bump versions
Diffstat:
3 files changed, 57 insertions(+), 16 deletions(-)
diff --git a/packaging/ng/buildconfig/taler-exchange.tag b/packaging/ng/buildconfig/taler-exchange.tag
@@ -1 +1 @@
-v1.0.8
+v1.0.9
diff --git a/packaging/ng/taler-pkg b/packaging/ng/taler-pkg
@@ -244,22 +244,25 @@ def publish(cfg):
print("package", deb, "not fresh, server has", server_deb)
if len(debs) == 0:
print("nothing to upload")
- return
- print("uploading debs", debs)
- if cfg.dry:
- return
- debs = [Path(f"./packages/{distro}/") / x for x in debs]
- subprocess.run(
- ["ssh", f"taler-packaging@{host}", f"rm -f '/home/taler-packaging/{distro}/'*.deb"], check=True
- )
- subprocess.run(
- ["scp", "--", *debs, f"taler-packaging@{host}:{distro}/"], check=True
- )
- subprocess.run(
- ["ssh", f"taler-packaging@{host}", f"./include-{distro}.sh"], check=True
- )
+ else:
+ print("uploading debs", debs)
+ if cfg.dry:
+ return
+ debs = [Path(f"./packages/{distro}/") / x for x in debs]
+ subprocess.run(
+ ["ssh", f"taler-packaging@{host}", f"rm -f '/home/taler-packaging/{distro}/'*.deb"], check=True
+ )
+ subprocess.run(
+ ["scp", "--", *debs, f"taler-packaging@{host}:{distro}/"], check=True
+ )
+ subprocess.run(
+ ["ssh", "-t", f"taler-packaging@{host}", f"./include-{distro}.sh"], check=True
+ )
+ # Always export!
+ # Reprepro is weird, listed packages might actually not show
+ # up in the index yet.
subprocess.run(
- ["ssh", f"taler-packaging@{host}", f"./export-{distro}.sh"], check=True
+ ["ssh", "-t", f"taler-packaging@{host}", f"./export-{distro}.sh"], check=True
)
diff --git a/packaging/ng/util/__init__.py b/packaging/ng/util/__init__.py
@@ -154,6 +154,44 @@ class Dpkg:
return epoch, upstream_rev, debian_rev
@staticmethod
+ def compare_revision_strings(rev1, rev2):
+ """Compare two debian revision strings as described at
+ https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version
+ """
+ if rev1 == rev2:
+ return 0
+ # listify pads results so that we will always be comparing ints to ints
+ # and strings to strings (at least until we fall off the end of a list)
+ list1 = Dpkg.listify(rev1)
+ list2 = Dpkg.listify(rev2)
+ if list1 == list2:
+ return 0
+ try:
+ for i, item in enumerate(list1):
+ # just in case
+ if not isinstance(item, list2[i].__class__):
+ raise DpkgVersionError(
+ 'Cannot compare %s to %s, something has gone horribly '
+ 'awry.' % (item, list2[i]))
+ # if the items are equal, next
+ if item == list2[i]:
+ continue
+ # numeric comparison
+ if isinstance(item, int):
+ if item > list2[i]:
+ return 1
+ if item < list2[i]:
+ return -1
+ else:
+ # string comparison
+ return Dpkg.dstringcmp(item, list2[i])
+ except IndexError:
+ # rev1 is longer than rev2 but otherwise equal, hence greater
+ return 1
+ # rev1 is shorter than rev2 but otherwise equal, hence lesser
+ return -1
+
+ @staticmethod
def compare_versions(ver1, ver2):
"""Function to compare two Debian package version strings,
suitable for passing to list.sort() and friends."""