aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gilbert <floppym@gentoo.org>2021-11-26 12:43:45 -0500
committerMike Gilbert <floppym@gentoo.org>2021-11-26 12:43:45 -0500
commit0009404ee5f293fe7076d59a52c46827c3b77738 (patch)
treecf0da1a668b5ada14e76feb903beb306f0304e9c
parentportage/util/_dyn_libs/dyn_libs.py: fix symlink recursion issue (diff)
downloadportage-master.tar.gz
portage-master.tar.bz2
portage-master.zip
dbapi: fix logic in bintree.binarytree._parse_build_id()HEADmaster
Resolves an error when improperly named xpak files exist in PKGDIR. Bug: https://bugs.gentoo.org/818886 Signed-off-by: Mike Gilbert <floppym@gentoo.org>
-rw-r--r--lib/portage/dbapi/bintree.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/portage/dbapi/bintree.py b/lib/portage/dbapi/bintree.py
index 777fc4918..9dbf9ee8b 100644
--- a/lib/portage/dbapi/bintree.py
+++ b/lib/portage/dbapi/bintree.py
@@ -1877,11 +1877,10 @@ class binarytree:
suffixlen = len(".xpak")
hyphen = filename.rfind("-", 0, -(suffixlen + 1))
if hyphen != -1:
- build_id = filename[hyphen + 1 : -suffixlen]
- try:
- build_id = int(build_id)
- except ValueError:
- pass
+ try:
+ build_id = int(filename[hyphen + 1 : -suffixlen])
+ except ValueError:
+ pass
return build_id
def isremote(self, pkgname):