aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2012-05-14 16:56:20 -0700
committerZac Medico <zmedico@gentoo.org>2012-05-14 16:56:20 -0700
commit999907a64249d9bfd2e42e477bfb9dd9a3cb535a (patch)
treeb00c0f9aafbdc03f13acad49f641ee9c98faa881 /pym/portage/dbapi/bintree.py
parentprepstrip: fix installsources breakage (diff)
downloadportage-999907a64249d9bfd2e42e477bfb9dd9a3cb535a.tar.gz
portage-999907a64249d9bfd2e42e477bfb9dd9a3cb535a.tar.bz2
portage-999907a64249d9bfd2e42e477bfb9dd9a3cb535a.zip
bintree: validate remove cpv morev2.2.0_alpha105
Diffstat (limited to 'pym/portage/dbapi/bintree.py')
-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