summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2009-06-18 21:20:11 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2009-06-18 21:20:11 +0200
commit2587c396df6b5016679a44e7bacf2e238eaf66fa (patch)
tree08e53c1cff4f94c3ad57ba6bec1af16c712a4b87
parent0bf4415311a185d76926ae198188a8dbb0b7b9ff (diff)
apt-why: Removed the old code
-rwxr-xr-xbin/apt-why99
1 files changed, 0 insertions, 99 deletions
diff --git a/bin/apt-why b/bin/apt-why
index aa011c6..f78d2c4 100755
--- a/bin/apt-why
+++ b/bin/apt-why
@@ -45,105 +45,6 @@ recurse($packagename, 0);
__END__
-sub revdeps {
- my $rdepsref = shift;
- my $depsref;
- my $parent;
-
- foreach(@$rdepsref) {
- undef($parent);
- $parent->{name} = $_->{ParentPkg}{Name};
- $parent->{ver} = $_->{ParentVer}{VerStr};
- $parent->{current_state} = $cache->{$_->{ParentPkg}{Name}}->{CurrentState};
- $parent->{selected_state} = $cache->{$_->{ParentPkg}{Name}}->{SelectedState};
- $parent->{deptype} = $_->{DepType};
- $parent->{targetname} = $_->{TargetPkg}{Name};
- if ($_->{TargetVer}) {
- $parent->{depsign} = $_;
- $parent->{depver} = $_;
- }
- $depsref->{$parent->{name}} = $parent;
- }
- return($depsref);
-}
-
-sub why {
- my $revdeps = revdeps(shift);
- my $why;
- foreach(keys(%$revdeps)) {
- if ($revdeps->{$_}->{current_state} eq 'Installed' and $revdeps->{$_}->{deptype} !~ /^(Conflicts|Replaces|Obsoletes)$/) {
- $why->{$_} = $revdeps->{$_};
- }
- }
- return($why);
-}
-
-sub why_not {
- my $revdeps = revdeps(shift);
- my $why_not;
- foreach(keys(%$revdeps)) {
- if ($revdeps->{$_}->{current_state} eq 'Installed' and $revdeps->{$_}->{deptype} =~ /^(Conflicts|Replaces|Obsoletes)$/) {
- $why_not->{$_} = $revdeps->{$_};
- }
- }
- return($why_not);
-}
-
-sub short_states {
- my $pkg = shift;
- my $state = '';
- switch($pkg->{selected_state}) {
- case('Unkwnon') {
- $state .= ' ';
- } case('Install') {
- $state .= 'i';
- } case('Hold') {
- $state .= 'h';
- } case('DeInstall') {
- $state .= 'r';
- } case('Purge') {
- $state .= 'p';
- }
- }
- switch($pkg->{current_state}) {
- case('Installed') {
- $state .= 'i';
- } case('UnPacked') {
- $state .= 'u';
- } case('HalfConfigured') {
- $state .= 'f';
- } case('HalfInstalled') {
- $state .= 'h';
- } case('ConfigFiles') {
- $state .= 'c';
- } case('NotInstalled') {
- $state .= ' ';
- }
- }
- return($state);
-}
-
-
-sub print_deps {
- my $deps = shift;
- foreach(keys(%$deps)) {
- printf "%-2s %-30s %-15s %s\n", short_states($deps->{$_}), $deps->{$_}->{name}, $deps->{$_}->{deptype}, $deps->{$_}->{targetname};
- }
-}
-
-print "State: $package->{CurrentState}\n";
-if ($package->{Flags} =~ /Essential/) {
- print "Essential: yes\n";
-}
-
-if ($not) {
- print_deps(why_not($package->{RevDependsList}));
-} else {
- print_deps(why($package->{RevDependsList}));
-}
-
-__END__
-
=head1 NAME
apt-why - filtered reverse dependency displayer using AptPkg::Cache