From 51e11c2096c969e16fcf06c804b09347ce039c5b Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 19 Jun 2009 18:16:23 +0200 Subject: apt-why: Added --all option to consider all available packages --- bin/apt-why | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/apt-why b/bin/apt-why index d27fef5..2d200e8 100755 --- a/bin/apt-why +++ b/bin/apt-why @@ -10,9 +10,11 @@ use Getopt::Long; my $cache = AptPkg::Cache->new; my $max_depth = 5; +my $all = 0; my @deptypes; my @default_deptypes = ('Depends', 'Recommends', 'Suggests'); GetOptions( + 'all!' => \$all, 'deptype=s' => \@deptypes, 'depth=i' => \$max_depth, ); @@ -31,7 +33,7 @@ sub revdeps { my $rdeps = $package->{RevDependsList}; foreach (@$rdeps) { if ( - $cache->{$_->{ParentPkg}{Name}}->{CurrentState} eq 'Installed' + ($all or $cache->{$_->{ParentPkg}{Name}}->{CurrentState} eq 'Installed') and "$_->{DepType}" ~~ @deptypes ) { next if ($_->{ParentPkg}{Name} ~~ @known); @@ -65,12 +67,16 @@ B [ I ] I =head1 DESCRIPTION B recursively displays I's reverse dependency, thus -showing which packages require I on the system. +showing which installed packages require I on the system. =head1 OPTIONS =over +=item B<--all> + +Consider all packages, not just installed ones + =item B<--depth>=I (default: 5) Specify the maximum recursion depth -- cgit v1.2.3