From: dms <dms@c11ca15a-4712-0410-83d8-924469b57eb5>
Date: Mon, 18 Dec 2000 13:35:40 +0000 (+0000)
Subject: stop searching if found>100
X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=0bb50bd58a8d13112ac41baadf873f80a933ee2f;p=infobot.git

stop searching if found>100


git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@208 c11ca15a-4712-0410-83d8-924469b57eb5
---

diff --git a/src/Modules/Debian.pl b/src/Modules/Debian.pl
index 30ce90b..89e249e 100644
--- a/src/Modules/Debian.pl
+++ b/src/Modules/Debian.pl
@@ -117,7 +117,7 @@ sub DebianDownload {
 	    }
 
 	    if (!&main::ftpGet($host,$path,$thisfile,$file)) {
-		&main::DEBUG("deb: down: ftpGet($host,$path,$thisfile,$file) == BAD.");
+		&main::WARN("deb: down: $file == BAD.");
 		$bad++;
 		next;
 	    }
@@ -204,11 +204,11 @@ sub searchContents {
 	$front = 1;
 	$grepRE = $query;
     } else {
-	$grepRE = "$query.*\[ \t]";
+	$grepRE = "$query*\[ \t]";
     }
 
     ### fix up grepRE for "*".
-    $grepRE =~ s/\*/\.\*/g;
+    $grepRE =~ s/\*/.*/g;
 
     my @files;
     foreach (keys %urlcontents) {
@@ -226,7 +226,6 @@ sub searchContents {
 
     my $files = join(' ', @files);
 
-    &main::status("search regex => '$grepRE'.");
     open(IN,"zegrep -h '$grepRE' $files |");
     while (<IN>) {
 	if (/^\.?\/?(.*?)[\t\s]+(\S+)\n$/) {
@@ -243,6 +242,8 @@ sub searchContents {
 	    $contents{$package}{$file} = 1;
 	    $found++;
 	}
+
+	last if ($found > 100);
     }
     close IN;