From 212937d8ba5c5fd37a077b4677f4041cf3072bc2 Mon Sep 17 00:00:00 2001 From: Frank Lichtenheld Date: Mon, 3 Mar 2008 15:02:13 +0100 Subject: [PATCH] [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) --- lib/Packages/DoSearchContents.pm | 4 ++++ 1 file changed, 4 insertions(+) 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: $!"; -- 2.39.2