[releng/alatiera/slightly-buggy-version-cmp: 2/3] fixup! downloadsites: copy the logic to compare versions from ftpadmin
- From: Jordan Petridis <jpetridis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [releng/alatiera/slightly-buggy-version-cmp: 2/3] fixup! downloadsites: copy the logic to compare versions from ftpadmin
- Date: Mon, 25 Jan 2021 06:54:49 +0000 (UTC)
commit 9394d9c633e26d8efb3a1722b5039b1db6148749
Author: Jordan Petridis <jpetridis gnome org>
Date: Mon Jan 25 08:51:25 2021 +0200
fixup! downloadsites: copy the logic to compare versions from ftpadmin
tools/smoketesting/downloadsites.py | 4 ++++
1 file changed, 4 insertions(+)
---
diff --git a/tools/smoketesting/downloadsites.py b/tools/smoketesting/downloadsites.py
index 9a35ad2..543eab0 100644
--- a/tools/smoketesting/downloadsites.py
+++ b/tools/smoketesting/downloadsites.py
@@ -191,6 +191,9 @@ def version_cmp(a, b):
Logic actually carbon copied from ftpadmin
https://gitlab.gnome.org/Infrastructure/sysadmin-bin/-/blob/78880cd100f6a73acc9dbd8c0dc3cb9a52e6fc23/ftpadmin#L88-141
"""
+ assert(a is not None)
+ assert(b is not None)
+
A = re_version.findall(a.lstrip('0'))
B = re_version.findall(b.lstrip('0'))
@@ -231,6 +234,7 @@ def get_latest_version(versions, max_version=None):
if max_version is specified, gets the latest version number before
max_version"""
latest = None
+ versions = [ v.rstrip(os.path.sep) for v in versions ]
for version in versions:
if ( latest is None or version_cmp(version, latest) > 0 ) \
and ( max_version is None or version_cmp(version, max_version) < 0 ):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]