summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage/dbapi/bintree.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py
index 51c093658..a8027ee6c 100644
--- a/pym/portage/dbapi/bintree.py
+++ b/pym/portage/dbapi/bintree.py
@@ -24,7 +24,7 @@ from portage.cache.mappings import slot_dict_class
from portage.const import CACHE_PATH
from portage.dbapi.virtual import fakedbapi
from portage.dep import Atom, use_reduce, paren_enclose
-from portage.exception import AlarmSignal, InvalidPackageName, \
+from portage.exception import AlarmSignal, InvalidData, InvalidPackageName, \
PermissionDenied, PortageException
from portage.localization import _
from portage import _movefile
@@ -219,6 +219,13 @@ def _pkgindex_cpv_map_latest_build(pkgindex):
for d in pkgindex.packages:
cpv = d["CPV"]
+ try:
+ cpv = _pkg_str(cpv)
+ except InvalidData:
+ writemsg(_("!!! Invalid remote binary package: %s\n") % cpv,
+ noiselevel=-1)
+ continue
+
btime = d.get('BUILD_TIME', '')
try:
btime = int(btime)
@@ -1003,7 +1010,12 @@ class binarytree(object):
noiselevel=-1)
continue
mycat = mycat.strip()
- fullpkg = mycat+"/"+mypkg[:-5]
+ try:
+ fullpkg = _pkg_str(mycat+"/"+mypkg[:-5])
+ except InvalidData:
+ writemsg(_("!!! Invalid remote binary package: %s\n") % mypkg,
+ noiselevel=-1)
+ continue
if fullpkg in metadata:
# When using this old protocol, comparison with the remote