summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-04-20 22:18:15 +0000
committerZac Medico <zmedico@gentoo.org>2007-04-20 22:18:15 +0000
commitc807fc36067598447e027add831af0ec1e3130a4 (patch)
treed41f333e92a35b03f0495d9fa6eeaed1cca10f29
parent5a1946a2cfa2780aa4e6563fcaa6c35d7095536e (diff)
downloadportage-c807fc36067598447e027add831af0ec1e3130a4.tar.gz
portage-c807fc36067598447e027add831af0ec1e3130a4.tar.bz2
portage-c807fc36067598447e027add831af0ec1e3130a4.zip
For bug #175344, validate LICENSE and PROVIDE inside doebuild().
svn path=/main/trunk/; revision=6423
-rw-r--r--pym/portage/__init__.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py
index 85140d2ad..8774a3d18 100644
--- a/pym/portage/__init__.py
+++ b/pym/portage/__init__.py
@@ -3529,7 +3529,9 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
set(["clean", "cleanrm", "help", "prerm", "postrm"])
mycpv = mysettings["CATEGORY"] + "/" + mysettings["PF"]
dep_keys = ["DEPEND", "RDEPEND", "PDEPEND"]
- metadata = dict(izip(dep_keys, mydbapi.aux_get(mycpv, dep_keys)))
+ misc_keys = ["LICENSE", "PROVIDE"]
+ all_keys = dep_keys + misc_keys
+ metadata = dict(izip(all_keys, mydbapi.aux_get(mycpv, all_keys)))
class FakeTree(object):
def __init__(self, mydb):
self.dbapi = mydb
@@ -3545,7 +3547,18 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
if mydo not in invalid_dep_exempt_phases:
return 1
del dep_type, mycheck
- del mycpv, dep_keys, metadata, FakeTree, dep_check_trees
+ for k in misc_keys:
+ try:
+ portage.dep.use_reduce(
+ portage.dep.paren_reduce(metadata[k]), matchall=True)
+ except portage.exception.InvalidDependString, e:
+ writemsg("%s: %s\n%s\n" % (
+ k, metadata[k], str(e)), noiselevel=-1)
+ del e
+ if mydo not in invalid_dep_exempt_phases:
+ return 1
+ del k
+ del mycpv, dep_keys, metadata, misc_keys, FakeTree, dep_check_trees
if "PORTAGE_TMPDIR" not in mysettings or \
not os.path.isdir(mysettings["PORTAGE_TMPDIR"]):