summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-10-19 18:32:24 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2009-10-19 18:32:24 +0200
commit170ccdce77e9d04ce68791a37b96176d5a3dc5d6 (patch)
treec5cda1323f0f722196bb1c750598313291eb7541
parent8ff347ad957b2174c56747a7d9bffa53fad1b228 (diff)
A little more code beautification
-rwxr-xr-xbin/apt-why14
1 files changed, 7 insertions, 7 deletions
diff --git a/bin/apt-why b/bin/apt-why
index e0e4123..93a343f 100755
--- a/bin/apt-why
+++ b/bin/apt-why
@@ -12,7 +12,7 @@ my $max_depth = 5;
my $all = 0;
my $tabwidth;
my $tabsign = "\t";
-my @deptypes = ('Depends', 'Recommends', 'Suggests');
+my @deptypes = qw/Depends Recommends Suggests/;
GetOptions(
'all!' => \$all,
'deptype=s' => sub {@deptypes = split(/,/, $_[1])},
@@ -20,7 +20,7 @@ GetOptions(
'tabwidth=i' => \$tabwidth,
'h|?|help' => \&usage,
);
-my $packagename = shift or die("No packagename given");
+my $packagename = shift or die('No packagename given');
my @known;
sub usage {
@@ -33,13 +33,13 @@ sub revdeps {
my @return;
my $rdeps = $package->{RevDependsList};
- foreach (@{$rdeps}) {
+ foreach my $dependency (@{$rdeps}) {
if (
- not $_->{ParentPkg}{Name} ~~ @known
- and ($all or $cache->{$_->{ParentPkg}{Name}}->{CurrentState} eq 'Installed')
- and "$_->{DepType}" ~~ @deptypes
+ not $dependency->{ParentPkg}{Name} ~~ @known
+ and ($all or $cache->{$dependency->{ParentPkg}{Name}}->{CurrentState} eq 'Installed')
+ and "$dependency->{DepType}" ~~ @deptypes
) {
- push(@return, $_->{ParentPkg}{Name});
+ push(@return, $dependency->{ParentPkg}{Name});
}
}