From 3157d58bfe997575f30a8ccd1facddc82e76f5da Mon Sep 17 00:00:00 2001 From: dms Date: Sun, 10 Dec 2000 12:49:56 +0000 Subject: [PATCH] - 'find *bin*ssh*' should work. - temp dir unified. git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@188 c11ca15a-4712-0410-83d8-924469b57eb5 --- src/Modules/Debian.pl | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/Modules/Debian.pl b/src/Modules/Debian.pl index 8fd7667..30ce90b 100644 --- a/src/Modules/Debian.pl +++ b/src/Modules/Debian.pl @@ -170,12 +170,6 @@ sub searchContents { $query =~ s/\\([\^\$])/$1/g; # hrm? $query =~ s/^\s+|\s+$//g; - ### EGREP DOES NOT SUPPORT THIS TYPE OF EXPRESSION!!! -### $query =~ s/\*/\\S*/g; - if ($query =~ /\*/) { - &main::msg($main::who, "We don't support * yet."); - return; - } if (!&main::validExec($query)) { &main::msg($main::who, "search string looks fuzzy."); @@ -199,20 +193,23 @@ sub searchContents { my $found = 0; my %contents; - my $search; + my $grepRE; my $front = 0; ### TODO: search properly if /usr/bin/blah is done. if ($query =~ s/\$$//) { &main::DEBUG("search-regex found."); - $search = "$query\[ \t]"; + $grepRE = "$query\[ \t]"; } elsif ($query =~ s/^\^//) { &main::DEBUG("front marker regex found."); $front = 1; - $search = $query; + $grepRE = $query; } else { - $search = "$query.*\[ \t]"; + $grepRE = "$query.*\[ \t]"; } + ### fix up grepRE for "*". + $grepRE =~ s/\*/\.\*/g; + my @files; foreach (keys %urlcontents) { s/##DIST/$dist/g; @@ -229,8 +226,8 @@ sub searchContents { my $files = join(' ', @files); - &main::status("search regex => '$search'."); - open(IN,"zegrep -h '$search' $files |"); + &main::status("search regex => '$grepRE'."); + open(IN,"zegrep -h '$grepRE' $files |"); while () { if (/^\.?\/?(.*?)[\t\s]+(\S+)\n$/) { my ($file,$package) = ("/".$1,$2); @@ -263,11 +260,7 @@ sub searchContents { return; } - if (! -d "Temp/") { - mkdir("Temp",0755); - } - - my $file = "temp/$main::who.txt"; + my $file = "$main::param{tempDir}/$main::who.txt"; if (!open(OUT,">$file")) { &main::ERROR("Debian: cannot write file for dcc send."); return; @@ -842,6 +835,11 @@ sub generateIndex { next; } + if (/^woody$/i) { + &main::DEBUG("Copying old index of woody to -old"); + system("cp $idx $idx-old"); + } + &main::DEBUG("gIndeX: calling DebianDownload($dist, ...)."); &DebianDownload($dist, %urlpackages); -- 2.39.5