]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Modules/Debian.pl
single line for now
[infobot.git] / src / Modules / Debian.pl
index 48ce83026ca888b939970afa819ef3c9b5c275db..d4f1576e9876f5f8cdcb5bc277048b618783e0a5 100644 (file)
@@ -140,6 +140,13 @@ sub DebianDownload {
 #              system("cp debian/Contents-potato-i386-non-US.gz debian/Contents-woody-i386-non-US.gz");
 #          }
 
+           my $exit = CORE::system("/bin/gzip -t $file >/dev/null 2>&1");
+           if ($exit) {
+               &::WARN("deb: $file is corrupted :/");
+               unlink $file;
+               next;
+           }
+
            &::DEBUG("deb: download: good.") if ($debug);
            $good++;
        } else {
@@ -150,7 +157,7 @@ sub DebianDownload {
     }
 
     # ok... lets just run this.
-    &::miscCheck();
+    &::miscCheck() if (&::whatInterface() =~ /IRC/);
 
     if ($good) {
        &generateIndex($dist);
@@ -243,9 +250,9 @@ sub searchContents {
     while (<IN>) {
        last if ($found > 100);
 
-       next unless if (/^\.?\/?(.*?)[\t\s]+(\S+)\n$/);
-
+       next unless (/^\.?\/?(.*?)[\t\s]+(\S+)\n$/);
        my ($file,$package) = ("/".$1,$2);
+
        if ($query =~ /[\/\*\\]/) {
            next unless (eval { $file =~ /$regex/ });
            return unless &checkEval($@);
@@ -394,6 +401,7 @@ sub searchAuthor {
            $package = "";
 
        } else {
+           chop;
            &::WARN("debian: invalid line: '$_' (1).");
        }
     }
@@ -503,6 +511,7 @@ sub searchDesc {
            $package = "";
 
        } else {
+           chop;
            &::WARN("debian: invalid line: '$_'. (2)");
        }
     }
@@ -589,7 +598,7 @@ sub getPackageInfo {
        # package line.
        if (/^Package: (.*)\n$/) {
            $pkg = $1;
-           if ($pkg =~ /^$package$/i) {
+           if ($pkg =~ /^\Q$package\E$/i) {
                $found++;       # we can use pkg{'package'} instead.
                $pkg{'package'} = $pkg;
            }
@@ -849,7 +858,7 @@ sub infoStats {
 # Usage: &generateIndex();
 sub generateIndex {
     my (@dists)        = @_;
-    &::status("Debian: !!! generateIndex($dists[0]) called !!!");
+    &::DEBUG("D: generateIndex($dists[0]) called!");
     if (!scalar @dists or $dists[0] eq '') {
        &::ERROR("gI: no dists to generate index.");
        return 1;
@@ -971,7 +980,7 @@ sub searchPackage {
        }
 
        if ($error) {
-           &::ERROR("could not generate index ($file)!!!");
+           &::ERROR("could not generate index ($file)!");
            return;
        }