Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r13736 - main/trunk/pym/portage
Date: Mon, 29 Jun 2009 23:03:22
Message-Id: E1MLPse-0001Oh-DL@stork.gentoo.org
1 Author: zmedico
2 Date: 2009-06-29 23:03:19 +0000 (Mon, 29 Jun 2009)
3 New Revision: 13736
4
5 Modified:
6 main/trunk/pym/portage/__init__.py
7 Log:
8 Bug #275821 - Make emerge reject !!atom blockers for EAPI 0 and 1.
9
10
11 Modified: main/trunk/pym/portage/__init__.py
12 ===================================================================
13 --- main/trunk/pym/portage/__init__.py 2009-06-29 22:41:55 UTC (rev 13735)
14 +++ main/trunk/pym/portage/__init__.py 2009-06-29 23:03:19 UTC (rev 13736)
15 @@ -6876,7 +6876,12 @@
16 # According to GLEP 37, RDEPEND is the only dependency type that is valid
17 # for new-style virtuals. Repoman should enforce this.
18 dep_keys = ["RDEPEND", "DEPEND", "PDEPEND"]
19 - portdb = trees[myroot]["porttree"].dbapi
20 + mytrees = trees[myroot]
21 + portdb = mytrees["porttree"].dbapi
22 + parent = mytrees.get("parent")
23 + eapi = mytrees.get("eapi")
24 + if eapi is None and parent is not None:
25 + eapi = parent.metadata["EAPI"]
26 repoman = not mysettings.local_config
27 if kwargs["use_binaries"]:
28 portdb = trees[myroot]["bintree"].dbapi
29 @@ -6899,6 +6904,11 @@
30 if portage.dep._dep_check_strict:
31 raise portage.exception.ParseError(
32 "invalid atom: '%s'" % x)
33 + else:
34 + if x.blocker and x.blocker.overlap.forbid and \
35 + eapi in ("0", "1") and portage.dep._dep_check_strict:
36 + raise portage.exception.ParseError(
37 + "invalid atom: '%s'" % (x,))
38
39 if repoman and x.use and x.use.conditional:
40 evaluated_atom = portage.dep.remove_slot(x)
41 @@ -6968,8 +6978,21 @@
42 if edebug:
43 print "Virtual Parent: ", y[0]
44 print "Virtual Depstring:", depstring
45 +
46 + # Set EAPI used for validation in dep_check() recursion.
47 + virtual_eapi, = db.aux_get(cpv, ["EAPI"])
48 + prev_eapi = mytrees.get("eapi")
49 + mytrees["eapi"] = virtual_eapi
50 +
51 mycheck = dep_check(depstring, mydbapi, mysettings, myroot=myroot,
52 trees=trees, **pkg_kwargs)
53 +
54 + # Restore previous EAPI after recursion.
55 + if prev_eapi is not None:
56 + mytrees["eapi"] = prev_eapi
57 + else:
58 + del mytrees["eapi"]
59 +
60 if not mycheck[0]:
61 raise portage.exception.ParseError(
62 "%s: %s '%s'" % (y[0], mycheck[1], depstring))