From: fuzzyray Date: Sat, 10 Mar 2007 22:55:32 +0000 (-0000) Subject: Add --depth option to equery depgraph to limit the depth of the dependency graph... X-Git-Tag: gentoolkit-0.2.4.3~158 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=40071bb1a1135c45cc899b903ee70ea8a43ce0f4;p=gentoolkit.git Add --depth option to equery depgraph to limit the depth of the dependency graph. (Bug #115807) svn path=/; revision=355 --- diff --git a/trunk/ChangeLog b/trunk/ChangeLog index 1dce6d1..d774919 100644 --- a/trunk/ChangeLog +++ b/trunk/ChangeLog @@ -1,3 +1,7 @@ +2007-03-10 Paul Varner + * equery: Add --depth option to equery depgraph to limit the depth of + the dependency graph. (Bug #115807) + 2007-03-09 Paul Varner * revdep-rebuild: Add support to detect "no version information available" message from ldd (Bug #169973) diff --git a/trunk/src/equery/equery b/trunk/src/equery/equery index 0473de2..bf2c019 100755 --- a/trunk/src/equery/equery +++ b/trunk/src/equery/equery @@ -636,7 +636,8 @@ class CmdDisplayDepGraph(Command): def __init__(self): self.default_opts = { "displayUSEFlags": 1, - "fancyFormatting": 1 + "fancyFormatting": 1, + "depth": 0 } def parseArgs(self, args): @@ -660,6 +661,8 @@ class CmdDisplayDepGraph(Command): opts["displayUSEFlags"] = 0 elif x in ["-l","--linear"]: opts["fancyFormatting"] = 0 + elif x[:8] == "--depth=": + opts["depth"] = int(x[8:]) else: query = x @@ -716,7 +719,8 @@ class CmdDisplayDepGraph(Command): suffix += " (" + pp.cpv(cpv) + ")" if len(x[1]) and opts["displayUSEFlags"]: suffix += " [ " + pp.useflagon(string.join(x[1])) + " ]" - pkgtbl = self._graph(pkg, opts, stats, level+1, pkgtbl, suffix) + if (level < opts["depth"] or opts["depth"] <= 0): + pkgtbl = self._graph(pkg, opts, stats, level+1, pkgtbl, suffix) return pkgtbl def shortHelp(self): @@ -729,7 +733,9 @@ class CmdDisplayDepGraph(Command): "\n" + \ pp.localoption("") + " is either of: \n" + \ " " + pp.localoption("-U, --no-useflags") + " - do not show USE flags\n" + \ - " " + pp.localoption("-l, --linear") + " - do not use fancy formatting" + " " + pp.localoption("-l, --linear") + " - do not use fancy formatting\n" + \ + " " + pp.localoption(" --depth=n") + " - limit dependency graph to specified depth" + class CmdDisplaySize(Command): """Display disk size consumed by a package""" @@ -1212,7 +1218,7 @@ class CmdListDepends(Command): " " + pp.localoption("-a, --all-packages") + " - search in all available packages (slow)\n" + \ " " + pp.localoption("-d, --direct") + " - search direct dependencies only (default)\n" + \ " " + pp.localoption("-D, --indirect") + " - search indirect dependencies (VERY slow)\n" + \ - " " + pp.localoption("--depth=x") + " - limit indirect dependency tree to specified depth" + " " + pp.localoption("--depth=n") + " - limit indirect dependency tree to specified depth" class CmdListPackages(Command): diff --git a/trunk/src/equery/equery.1 b/trunk/src/equery/equery.1 index 89001d2..576519d 100644 --- a/trunk/src/equery/equery.1 +++ b/trunk/src/equery/equery.1 @@ -91,6 +91,9 @@ do not show USE flags. .br .B \-l, \-\-linear do not use fancy formatting +.br +.B \-\-depth=n +Limit depth of dependency graph to n levels. .PP .TP .B files pkgspec @@ -220,7 +223,7 @@ equery list \-\-full\-regex '(mozilla\-firefox|mozilla\-thunderbird)' \- list al equery list \-\-duplicates \- list all installed slotted packages .PP -.TP +.TP .B size pkgspec This command outputs the number of files in the specified package, as well as their total size in an appropriate unit.