diff options
| author | fuzzyray <fuzzyray@gentoo.org> | 2007-03-10 22:55:32 +0000 |
|---|---|---|
| committer | fuzzyray <fuzzyray@gentoo.org> | 2007-03-10 22:55:32 +0000 |
| commit | 40071bb1a1135c45cc899b903ee70ea8a43ce0f4 (patch) | |
| tree | ffa004ab778d3d79376adde6165f4a7e3f366e19 /trunk | |
| parent | afdcabf1af64f44e93a0049ec30bb9739a341525 (diff) | |
| download | gentoolkit-40071bb1a1135c45cc899b903ee70ea8a43ce0f4.tar.gz | |
Add --depth option to equery depgraph to limit the depth of the dependency graph. (Bug #115807)
svn path=/; revision=355
Diffstat (limited to 'trunk')
| -rw-r--r-- | trunk/ChangeLog | 4 | ||||
| -rwxr-xr-x | trunk/src/equery/equery | 14 | ||||
| -rw-r--r-- | trunk/src/equery/equery.1 | 5 |
3 files changed, 18 insertions, 5 deletions
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 <fuzzyray@gentoo.org> + * equery: Add --depth option to equery depgraph to limit the depth of + the dependency graph. (Bug #115807) + 2007-03-09 Paul Varner <fuzzyray@gentoo.org> * 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("<local-opts>") + " 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 <local\-opts> 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 <local\-opts> pkgspec This command outputs the number of files in the specified package, as well as their total size in an appropriate unit. |
