aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2021-08-28 21:58:04 -0400
committerXavier Claessens <xclaesse@gmail.com>2021-08-30 14:02:42 -0400
commit38db4602d8f80c3d2aec80ed527e3eed3c41b08c (patch)
tree5f818419ac2a9e3661672b5ac8cb1ad4ab3f2c36
parent88a1bed81b7d9ad262d3b511eb20444c609db235 (diff)
downloadmeson-38db4602d8f80c3d2aec80ed527e3eed3c41b08c.zip
meson-38db4602d8f80c3d2aec80ed527e3eed3c41b08c.tar.gz
meson-38db4602d8f80c3d2aec80ed527e3eed3c41b08c.tar.bz2
wraptool: Fix version comparison
-rw-r--r--mesonbuild/wrap/wraptool.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/mesonbuild/wrap/wraptool.py b/mesonbuild/wrap/wraptool.py
index 0c3b77f..222996d 100644
--- a/mesonbuild/wrap/wraptool.py
+++ b/mesonbuild/wrap/wraptool.py
@@ -98,24 +98,24 @@ def install(options: 'argparse.Namespace') -> None:
f.write(url.read())
print(f'Installed {name} version {version} revision {revision}')
-def parse_patch_url(patch_url: str) -> T.Tuple[str, int]:
+def parse_patch_url(patch_url: str) -> T.Tuple[str, str]:
u = urlparse(patch_url)
if u.netloc != 'wrapdb.mesonbuild.com':
raise WrapException(f'URL {patch_url} does not seems to be a wrapdb patch')
arr = u.path.strip('/').split('/')
if arr[0] == 'v1':
# e.g. https://wrapdb.mesonbuild.com/v1/projects/zlib/1.2.11/5/get_zip
- return arr[-3], int(arr[-2])
+ return arr[-3], arr[-2]
elif arr[0] == 'v2':
# e.g. https://wrapdb.mesonbuild.com/v2/zlib_1.2.11-5/get_patch
tag = arr[-2]
name, version = tag.rsplit('_', 1)
version, revision = version.rsplit('-', 1)
- return version, int(revision)
+ return version, revision
else:
raise WrapException(f'Invalid wrapdb URL {patch_url}')
-def get_current_version(wrapfile: str) -> T.Tuple[str, int, str, str, str]:
+def get_current_version(wrapfile: str) -> T.Tuple[str, str, str, str, str]:
cp = configparser.ConfigParser(interpolation=None)
cp.read(wrapfile)
wrap_data = cp['wrap-file']