summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-06-19 18:16:23 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2009-06-19 18:16:23 +0200
commit51e11c2096c969e16fcf06c804b09347ce039c5b (patch)
treea5b4a78add5ac58ab9778e92b6ca0d7e01fb5c97 /bin
parentef2c53a42a329550c654e635fb204a6da03f25ec (diff)
apt-why: Added --all option to consider all available packages
Diffstat (limited to 'bin')
-rwxr-xr-xbin/apt-why10
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