osmith has uploaded this change for review.

View Change

OBS: keep going if version can't be parsed

Don't crash in Osmocom_OBS_wireshark because the version can't be
parsed.

Fix for:
packaging.version.InvalidVersion: Invalid version: '4.1.1rc0.238'

Change-Id: I0cf6c7c2d5939dccc14107f0a8c15593ea8bc4c2
---
M scripts/obs/lib/debian.py
1 file changed, 28 insertions(+), 7 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/03/34403/1
diff --git a/scripts/obs/lib/debian.py b/scripts/obs/lib/debian.py
index 2995185..6703f8b 100644
--- a/scripts/obs/lib/debian.py
+++ b/scripts/obs/lib/debian.py
@@ -98,13 +98,19 @@
version_changelog = get_last_version_from_changelog(project)

# Don't use a lower number (OS#6173)
- if packaging.version.parse(version_changelog.split("-")[0]) > \
- packaging.version.parse(version.split("-")[0]):
- print(f"{project}: WARNING: version from changelog"
- f" ({version_changelog}) is higher than version based on git tag"
- f" ({version}), using version from changelog (git tag not pushed"
- " yet?)")
- return
+ try:
+ if packaging.version.parse(version_changelog.split("-")[0]) > \
+ packaging.version.parse(version.split("-")[0]):
+ print(f"{project}: WARNING: version from changelog"
+ f" ({version_changelog}) is higher than version based on git tag"
+ f" ({version}), using version from changelog (git tag not pushed"
+ " yet?)")
+ return
+ except packaging.version.InvalidVersion:
+ # packaging.version.parse can parse the version numbers used in Osmocom
+ # projects (where we need the above check), but not e.g. some versions
+ # from wireshark. Don't abort here if that is the case.
+ pass

if version_changelog == version:
return

To view, visit change 34403. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I0cf6c7c2d5939dccc14107f0a8c15593ea8bc4c2
Gerrit-Change-Number: 34403
Gerrit-PatchSet: 1
Gerrit-Owner: osmith <osmith@sysmocom.de>
Gerrit-MessageType: newchange