1 |
commit: fa9e85bbe7c513193756a2d13ce63a609138753d |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Jun 30 04:13:20 2011 +0000 |
4 |
Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Jun 30 04:13:20 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fa9e85bb |
7 |
|
8 |
ebuild(1): pass Package instance to setcpv |
9 |
|
10 |
This should improve repo-level support, for bug #370693. |
11 |
|
12 |
--- |
13 |
bin/ebuild | 22 +++++++++++++++++++--- |
14 |
1 files changed, 19 insertions(+), 3 deletions(-) |
15 |
|
16 |
diff --git a/bin/ebuild b/bin/ebuild |
17 |
index 9ad17e8..68e52e3 100755 |
18 |
--- a/bin/ebuild |
19 |
+++ b/bin/ebuild |
20 |
@@ -76,6 +76,8 @@ from portage import _shell_quote |
21 |
from portage import _unicode_decode |
22 |
from portage import _unicode_encode |
23 |
from portage.const import VDB_PATH |
24 |
+from _emerge.Package import Package |
25 |
+from _emerge.RootConfig import RootConfig |
26 |
|
27 |
if not opts.ignore_default_opts: |
28 |
default_opts = portage.settings.get("EBUILD_DEFAULT_OPTS", "").split() |
29 |
@@ -171,6 +173,7 @@ if not portage.catpkgsplit(cpv): |
30 |
|
31 |
if ebuild.startswith(vdb_path): |
32 |
mytree = "vartree" |
33 |
+ pkg_type = "installed" |
34 |
|
35 |
portage_ebuild = portage.db[portage.root][mytree].dbapi.findname(cpv, myrepo=myrepo) |
36 |
|
37 |
@@ -180,6 +183,7 @@ if ebuild.startswith(vdb_path): |
38 |
|
39 |
else: |
40 |
mytree = "porttree" |
41 |
+ pkg_type = "ebuild" |
42 |
|
43 |
portage_ebuild = portage.portdb.findname(cpv, myrepo=myrepo) |
44 |
|
45 |
@@ -253,14 +257,26 @@ if "test" in pargs: |
46 |
|
47 |
tmpsettings.features.discard("fail-clean") |
48 |
|
49 |
-# Apply package.env settings. This allows per-package FEATURES and other |
50 |
-# variables (possibly PORTAGE_TMPDIR) to be available as soon as possible. |
51 |
try: |
52 |
- tmpsettings.setcpv(cpv, mydb=portage.db[portage.root][mytree].dbapi) |
53 |
+ metadata = dict(zip(Package.metadata_keys, |
54 |
+ portage.db[portage.settings["ROOT"]][mytree].dbapi.aux_get( |
55 |
+ cpv, Package.metadata_keys))) |
56 |
except KeyError: |
57 |
# aux_get failure, message should have been shown on stderr. |
58 |
sys.exit(1) |
59 |
|
60 |
+root_config = RootConfig(portage.settings, |
61 |
+ portage.db[portage.settings["ROOT"]], None) |
62 |
+ |
63 |
+pkg = Package(built=(pkg_type != "ebuild"), cpv=cpv, |
64 |
+ metadata=metadata, root_config=root_config, |
65 |
+ type_name=pkg_type) |
66 |
+ |
67 |
+# Apply package.env and repo-level settings. This allows per-package |
68 |
+# FEATURES and other variables (possibly PORTAGE_TMPDIR) to be |
69 |
+# available as soon as possible. |
70 |
+tmpsettings.setcpv(pkg) |
71 |
+ |
72 |
def stale_env_warning(): |
73 |
if "clean" not in pargs and \ |
74 |
"noauto" not in tmpsettings.features and \ |