Fixes to support displaying post-merge dependencies (Bug #99191)
authorfuzzyray <fuzzyray@gentoo.org>
Wed, 1 Mar 2006 18:47:06 +0000 (18:47 -0000)
committerfuzzyray <fuzzyray@gentoo.org>
Wed, 1 Mar 2006 18:47:06 +0000 (18:47 -0000)
svn path=/; revision=283

trunk/ChangeLog
trunk/src/equery/equery
trunk/src/gentoolkit/package.py

index c74fc7d4fecfc0931ecca4e830df523d8a6086ea..6f958b4aaa6942017e4038dc3132897e4bc7f952 100644 (file)
@@ -1,3 +1,15 @@
+2006-03-01 Paul Varner <fuzzyray@gentoo.org>
+       * 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 <genone@gentoo.org>
        * euse: add/remove use flags even if there is no USE= statement in make.conf
        (bug #95432)
index 3a7099d54766e91ef2c3fd10c020e70f1830d1b9..5dcb6dccc5edd855b7993f990793f0fe0999bdd6 100755 (executable)
@@ -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
index 1e5b6cb5dd22f868938549eb8dff90c4571a93c9..50788fb2639637a464354a437ee124bce0cc6462 100644 (file)
@@ -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")