Skip to content

Commit

Permalink
Avoid a nasty crash if a package has a malformed version string
Browse files Browse the repository at this point in the history
  • Loading branch information
sheepman4267 committed Nov 4, 2024
1 parent aeeeb0b commit 7e1cdaa
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions pisi/atomicoperations.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,14 @@ def check_operation(self):

# is this an upgrade?
# determine and report the kind of upgrade: version, release
if pkg_version > iversion:
ctx.ui.info(_("Upgrading to new upstream version"))
self.operation = UPGRADE
elif pkg_release > irelease:
try:
if pkg_version > iversion:
ctx.ui.info(_("Upgrading to new upstream version"))
self.operation = UPGRADE
except TypeError as e:
ctx.ui.error(_("Malformed package version, falling back to distribution release"))
ctx.ui.debug(str(e))
if pkg_release > irelease:
ctx.ui.info(_("Upgrading to new distribution release"))
self.operation = UPGRADE

Expand Down

0 comments on commit 7e1cdaa

Please sign in to comment.