From cbecbfb8dbb8bcd4c08b2d48a6384db661bf4676 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 3 Jul 2009 20:54:06 +0200 Subject: apt-why: Print error message if the package does not exist --- bin/apt-why | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bin') diff --git a/bin/apt-why b/bin/apt-why index 171bba0..e6c5de6 100755 --- a/bin/apt-why +++ b/bin/apt-why @@ -50,6 +50,11 @@ sub recurse { recurse($_, $depth) foreach revdeps($name); } +unless ($cache->{$packagename}) { + print STDERR "No such package: $packagename\n"; + exit(1); +} + if ($cache->{$packagename}->{Flags} =~ /Essential/) { print "Essential: Yes\n"; } -- cgit v1.2.3