From 8dc1f27b44241cf75fdfc9361b4ede3bfca25195 Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Sun, 13 Jan 2008 21:03:23 +0000 Subject: [PATCH] Improve missing package detection on Debian --- software/debian-lib.pl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/software/debian-lib.pl b/software/debian-lib.pl index ad28b31bf..c35ef123c 100644 --- a/software/debian-lib.pl +++ b/software/debian-lib.pl @@ -41,6 +41,16 @@ return lc($_[0]) =~ /^[a-e]/ ? "A-E" : sub package_info { local $qm = quotemeta($_[0]); + +# First check if it is really installed, and not just known to the package +# system in some way +local $out = &backquote_command("dpkg --list $qm 2>&1", 1); +local @lines = split(/\r?\n/, $out); +if ($lines[$#lines] !~ /^.[ih]/) { + return ( ); + } + +# Get full status local $out = &backquote_command("dpkg --print-avail $qm 2>&1", 1); return () if ($? || $out =~ /Package .* is not available/i); local @rv = ( $_[0], &alphabet_name($_[0]) );