From 74de0f09efe775f258dec8a8fc7131d63d0bc6aa Mon Sep 17 00:00:00 2001 From: fuzzyray Date: Wed, 1 Mar 2006 18:47:06 +0000 Subject: [PATCH] Fixes to support displaying post-merge dependencies (Bug #99191) svn path=/; revision=283 --- trunk/ChangeLog | 12 ++++++++++++ trunk/src/equery/equery | 8 +++----- trunk/src/gentoolkit/package.py | 22 ++++++++++++++-------- 3 files changed, 29 insertions(+), 13 deletions(-) diff --git a/trunk/ChangeLog b/trunk/ChangeLog index c74fc7d..6f958b4 100644 --- a/trunk/ChangeLog +++ b/trunk/ChangeLog @@ -1,3 +1,15 @@ +2006-03-01 Paul Varner + * gentoolkit: Fix depends parsing to properly handle conjunction. (bug + #123725). Thanks to tgl for the patch. + * gentoolkit: Added function to get post-merge dependencies (PDEPEND) + (bug #99191) + * gentoolkit: Change get_dependency functions to always use the + portage tree + * equery: Added post-merge dependencies to depends and depgraph + actions. (bug #99191) + * equery: Removed requirement for package to be installed to use + depgraph action. + 2006-02-16 Marius Mauch * euse: add/remove use flags even if there is no USE= statement in make.conf (bug #95432) diff --git a/trunk/src/equery/equery b/trunk/src/equery/equery index 3a7099d..5dcb6dc 100755 --- a/trunk/src/equery/equery +++ b/trunk/src/equery/equery @@ -643,8 +643,6 @@ class CmdDisplayDepGraph(Command): matches = gentoolkit.find_packages(query, True) for pkg in matches: - if not pkg.is_installed(): - continue if not Config["piping"] and Config["verbosityLevel"] >= 3: print_info(3, pp.section("* ") + "dependency graph for " + pp.cpv(pkg.get_cpv())) else: @@ -670,7 +668,7 @@ class CmdDisplayDepGraph(Command): pkgtbl.append(cpv) - pkgdeps = pkg.get_runtime_deps() + pkg.get_compiletime_deps() + pkgdeps = pkg.get_runtime_deps() + pkg.get_compiletime_deps() + pkg.get_postmerge_deps() for x in pkgdeps: suffix = "" cpv = x[2] @@ -1041,7 +1039,7 @@ class CmdListDepends(Command): print_info(1, pp.section("* ") + "Dependencies for " + pp.cpv(pkg.get_cpv()) + ":") try: - deps = pkg.get_runtime_deps() + pkg.get_compiletime_deps() + deps = pkg.get_runtime_deps() + pkg.get_compiletime_deps() + pkg.get_postmerge_deps() except KeyError, e: # If the ebuild is not found... continue @@ -1057,7 +1055,7 @@ class CmdListDepends(Command): for pkg in packages: try: - deps = pkg.get_runtime_deps() + pkg.get_compiletime_deps() + deps = pkg.get_runtime_deps() + pkg.get_compiletime_deps() + pkg.get_postmerge_deps() except KeyError, e: # If the ebuild is not found... continue diff --git a/trunk/src/gentoolkit/package.py b/trunk/src/gentoolkit/package.py index 1e5b6cb..50788fb 100644 --- a/trunk/src/gentoolkit/package.py +++ b/trunk/src/gentoolkit/package.py @@ -65,21 +65,24 @@ class Package: def get_runtime_deps(self): """Returns a linearised list of first-level run time dependencies for this package, on the form [(comparator, [use flags], cpv), ...]""" - cd = self.get_env_var("RDEPEND").split() + # Always use the portage tree, since emerge only uses the tree when calculating dependencies + cd = self.get_env_var("RDEPEND", porttree).split() r,i = self._parse_deps(cd) return r def get_compiletime_deps(self): """Returns a linearised list of first-level compile time dependencies for this package, on the form [(comparator, [use flags], cpv), ...]""" - rd = self.get_env_var("DEPEND").split() + # Always use the portage tree, since emerge only uses the tree when calculating dependencies + rd = self.get_env_var("DEPEND", porttree).split() r,i = self._parse_deps(rd) return r def get_postmerge_deps(self): """Returns a linearised list of first-level post merge dependencies for this package, on the form [(comparator, [use flags], cpv), ...]""" - pd = self.get_env_var("PDEPEND").split() + # Always use the portage tree, since emerge only uses the tree when calculating dependencies + pd = self.get_env_var("PDEPEND", porttree).split() r,i = self._parse_deps(pd) return r @@ -104,7 +107,7 @@ class Package: r += sr i += l + 3 continue - # conjunction, like in "|| ( ( foo bar ) baz )" => recurse + # conjonction, like in "|| ( ( foo bar ) baz )" => recurse if tok == "(": sr,l = self._parse_deps(deps[i+1:],curuse,level=level+1) r += sr @@ -154,11 +157,14 @@ class Package: if len(sp): return string.join(sp[:-1],"/") - def get_env_var(self, var): + def get_env_var(self, var, tree=""): """Returns one of the predefined env vars DEPEND, RDEPEND, SRC_URI,....""" - mytree = vartree - if not self.is_installed(): - mytree = porttree + if tree == "": + mytree = vartree + if not self.is_installed(): + mytree = porttree + else: + mytree = tree r = mytree.dbapi.aux_get(self._cpv,[var]) if not r: raise FatalError("Could not find the package tree") -- 2.26.2