summaryrefslogtreecommitdiffstats
path: root/pym/emerge
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-07-08 07:24:12 +0000
committerZac Medico <zmedico@gentoo.org>2007-07-08 07:24:12 +0000
commitac0a630b42c12b5f0d3088d4f4c45186c82d3d57 (patch)
treeebb2ffb6ef381be03274813a702475176c81a39e /pym/emerge
parent41ccdc0ab3efce184ab6d7a0f49a490c8fda21f9 (diff)
downloadportage-ac0a630b42c12b5f0d3088d4f4c45186c82d3d57.tar.gz
portage-ac0a630b42c12b5f0d3088d4f4c45186c82d3d57.tar.bz2
portage-ac0a630b42c12b5f0d3088d4f4c45186c82d3d57.zip
For bug #184566, enable the emerge --info action to run an option pkg_info() function from each installed ebuild.
svn path=/main/trunk/; revision=7201
Diffstat (limited to 'pym/emerge')
-rw-r--r--pym/emerge/__init__.py26
1 files changed, 15 insertions, 11 deletions
diff --git a/pym/emerge/__init__.py b/pym/emerge/__init__.py
index cbecf9b22..477164e88 100644
--- a/pym/emerge/__init__.py
+++ b/pym/emerge/__init__.py
@@ -5166,7 +5166,12 @@ def action_info(settings, trees, myopts, myfiles):
# Loop through each package
# Only print settings if they differ from global settings
- header_printed = False
+ header_title = "Package Settings"
+ print header_width * "="
+ print header_title.rjust(int(header_width/2 + len(header_title)/2))
+ print header_width * "="
+ from portage.output import EOutput
+ out = EOutput()
for pkg in mypkgs:
# Get all package specific variables
auxvalues = vardb.aux_get(pkg, auxkeys)
@@ -5196,16 +5201,6 @@ def action_info(settings, trees, myopts, myfiles):
# If a difference was found, print the info for
# this package.
if diff_values:
-
- # If we have not yet printed the header,
- # print it now
- if not header_printed:
- header_title = "Package Settings"
- print header_width * "="
- print header_title.rjust(int(header_width/2 + len(header_title)/2))
- print header_width * "="
- header_printed = True
-
# Print package info
print "%s was built with the following:" % pkg
for myvar in mydesiredvars + ["USE"]:
@@ -5214,6 +5209,15 @@ def action_info(settings, trees, myopts, myfiles):
mylist.sort()
print "%s=\"%s\"" % (myvar, " ".join(mylist))
print
+ print ">>> Attempting to run pkg_info() for '%s'" % pkg
+ ebuildpath = vardb.findname(pkg)
+ if not ebuildpath or not os.path.exists(ebuildpath):
+ out.ewarn("No ebuild found for '%s'" % pkg)
+ continue
+ portage.doebuild(ebuildpath, "info", pkgsettings["ROOT"],
+ pkgsettings, debug=(settings.get("PORTAGE_DEBUG", "") == 1),
+ mydbapi=trees[settings["ROOT"]]["vartree"].dbapi,
+ tree="vartree")
def action_search(settings, portdb, vartree, myopts, myfiles, spinner):
if not myfiles: