From: Frank Lichtenheld Date: Mon, 3 Mar 2008 14:02:13 +0000 (+0100) Subject: [UBUNTU] Packages::DoSearchContents: Don't die when no information is available X-Git-Url: https://git.deb.at/w?a=commitdiff_plain;h=212937d8ba5c5fd37a077b4677f4041cf3072bc2;p=deb%2Fpackages.git [UBUNTU] Packages::DoSearchContents: Don't die when no information is available Issue a real error message if no contents database is available for the suite in question. This isn't exposed on the Debian site since we actually have _some_ contents for every suite (experimental has contents for debian-ports.org). But on the Ubuntu site we have no information at all for *-backports and *-updates. (cherry picked from commit 3eda9fe5cb2a6fe0fc67493c2147d8a3ff2d904d) --- diff --git a/lib/Packages/DoSearchContents.pm b/lib/Packages/DoSearchContents.pm index 272b235..2316706 100644 --- a/lib/Packages/DoSearchContents.pm +++ b/lib/Packages/DoSearchContents.pm @@ -58,6 +58,10 @@ sub do_search_contents { # full filename search is tricky my $ffn = $mode eq 'filename'; + unless (-e "$DBDIR/contents/reverse_$suite.db") { + fatal_error($cat->g("No contents information available for this suite")); + return; + } my $reverses = tie my %reverses, 'DB_File', "$DBDIR/contents/reverse_$suite.db", O_RDONLY, 0666, $DB_BTREE or die "Failed opening reverse DB: $!";