summaryrefslogtreecommitdiffstats
path: root/pym
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-02-18 08:45:52 +0000
committerZac Medico <zmedico@gentoo.org>2007-02-18 08:45:52 +0000
commitc547a0fa4d47c0454cbe30c1831382427451b3ef (patch)
tree30d642fa96a52576a0d530e9659a3587c9f4a537 /pym
parentead265c09529075d9587b11ec012937dd819a5db (diff)
downloadportage-c547a0fa4d47c0454cbe30c1831382427451b3ef.tar.gz
portage-c547a0fa4d47c0454cbe30c1831382427451b3ef.tar.bz2
portage-c547a0fa4d47c0454cbe30c1831382427451b3ef.zip
For bug #163990, warn about binary packages with invalid categories and do not allow them to be installed.
svn path=/main/trunk/; revision=5990
Diffstat (limited to 'pym')
-rw-r--r--pym/portage/dbapi/bintree.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py
index a03fb124c..a833f033c 100644
--- a/pym/portage/dbapi/bintree.py
+++ b/pym/portage/dbapi/bintree.py
@@ -349,6 +349,8 @@ class binarytree(object):
if (not os.path.isdir(self.pkgdir+"/All") and not getbinpkgs):
return 0
+ categories = set(self.settings.categories)
+
if not getbinpkgsonly:
pkg_paths = {}
dirs = listdir(self.pkgdir, dirsonly=True, EmptyOnError=True)
@@ -387,6 +389,14 @@ class binarytree(object):
if mycpv in pkg_paths:
# All is first, so it's preferred.
continue
+ if mycat not in categories:
+ writemsg(("!!! Binary package has an " + \
+ "unrecognized category: '%s'\n") % full_path,
+ noiselevel=-1)
+ writemsg(("!!! '%s' has a category that is not" + \
+ " listed in /etc/portage/categories\n") % mycpv,
+ noiselevel=-1)
+ continue
pkg_paths[mycpv] = mypath
self.dbapi.cpv_inject(mycpv)
self._pkg_paths = pkg_paths
@@ -418,6 +428,14 @@ class binarytree(object):
continue
mycat = self.remotepkgs[mypkg]["CATEGORY"].strip()
fullpkg = mycat+"/"+mypkg[:-5]
+ if mycat not in categories:
+ writemsg(("!!! Remote binary package has an " + \
+ "unrecognized category: '%s'\n") % fullpkg,
+ noiselevel=-1)
+ writemsg(("!!! '%s' has a category that is not" + \
+ " listed in /etc/portage/categories\n") % fullpkg,
+ noiselevel=-1)
+ continue
mykey = dep_getkey(fullpkg)
try:
# invalid tbz2's can hurt things.