]> git.donarmstrong.com Git - infobot.git/commitdiff
we don't stop if debianDownload fails unless none of the files exist locally
authordms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Sun, 20 Aug 2000 13:58:26 +0000 (13:58 +0000)
committerdms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Sun, 20 Aug 2000 13:58:26 +0000 (13:58 +0000)
git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@54 c11ca15a-4712-0410-83d8-924469b57eb5

src/Modules/Debian.pl

index f2e50f076ea587a3c3c0b1814f33e6ab1409ca04..8eb2fe9e058a96332267628eae68421b7e4fbb80 100644 (file)
@@ -161,8 +161,7 @@ sub searchContents {
        # download contents file.
        &main::DEBUG("deb: download 1.");
        if (!&DebianDownload($dist, %urls)) {
-           &main::ERROR("Debian: could not download files.");
-           return;
+           &main::WARN("Debian: could not download files.");
        }
     }
 
@@ -172,7 +171,18 @@ sub searchContents {
     my $found = 0;
     my %contents;
     my $search = "$query.*\[ \t]";
-    my $files = join(' ', keys %urlcontents);
+    foreach (keys %urlcontents) {
+       next unless ( -f $_);
+       push(@files,$_);
+    }
+
+    if (!scalar @files) {
+       &main::ERROR("sC: no files?");
+       &main::msg($main::who, "failed.");
+       return;
+    }
+
+    my $files = join(' ', @files);
     $files =~ s/##DIST/$dist/g;
 
     open(IN,"zegrep -h '$search' $files |");