diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/apt-why | 10 |
1 files changed, 8 insertions, 2 deletions
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<apt-why> [ I<options> ] I<package> =head1 DESCRIPTION B<apt-why> recursively displays I<package>'s reverse dependency, thus -showing which packages require I<package> on the system. +showing which installed packages require I<package> on the system. =head1 OPTIONS =over +=item B<--all> + +Consider all packages, not just installed ones + =item B<--depth>=I<integer> (default: 5) Specify the maximum recursion depth |