summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-01-15 22:24:20 +0000
committerZac Medico <zmedico@gentoo.org>2007-01-15 22:24:20 +0000
commit06781f2314d1760d5858e03f9028e0f368826b14 (patch)
treef079832ae889cae2aa98de15a34bb9e268c02a8a
parentf4b7dd34d80147480f73bdcd84ea825665581610 (diff)
downloadportage-06781f2314d1760d5858e03f9028e0f368826b14.tar.gz
portage-06781f2314d1760d5858e03f9028e0f368826b14.tar.bz2
portage-06781f2314d1760d5858e03f9028e0f368826b14.zip
For bug #162275, make doebuild validate *DEPEND and bail out if necessary.
svn path=/main/trunk/; revision=5653
-rw-r--r--pym/portage.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/pym/portage.py b/pym/portage.py
index 76a77e38e..d2fa9844c 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -3352,6 +3352,23 @@ def doebuild(myebuild, mydo, myroot, mysettings, debug=0, listonly=0,
return spawn(EBUILD_SH_BINARY + " depend", mysettings)
+ mycpv = mysettings["CATEGORY"] + "/" + mysettings["PF"]
+ dep_keys = ["DEPEND", "RDEPEND", "PDEPEND"]
+ metadata = dict(izip(dep_keys, mydbapi.aux_get(mycpv, dep_keys)))
+ class FakeTree(object):
+ def __init__(self, mydb):
+ self.dbapi = mydb
+ dep_check_trees = {myroot:{}}
+ dep_check_trees[myroot]["porttree"] = \
+ FakeTree(fakedbapi(settings=mysettings))
+ for dep_type in dep_keys:
+ mycheck = dep_check(metadata[dep_type], None, mysettings,
+ myuse="all", myroot=myroot, trees=dep_check_trees)
+ if not mycheck[0]:
+ writemsg("%s: %s\n%s\n" % (
+ dep_type, metadata[dep_type], mycheck[1]), noiselevel=-1)
+ return 1
+
if "PORTAGE_TMPDIR" not in mysettings or \
not os.path.isdir(mysettings["PORTAGE_TMPDIR"]):
writemsg("The directory specified in your " + \