]> git.donarmstrong.com Git - debbugs.git/blobdiff - scripts/process
Merge branch 'don/processcleanup' into control.at.submit
[debbugs.git] / scripts / process
index 05ade0aa01c464c08675ed03adbeb0bf69a6689f..c8b30b54181d5fe512cef3b162af8debadeae2d4 100755 (executable)
@@ -210,6 +210,7 @@ if (@bodylines and $bodylines[0] =~ /^-----BEGIN PGP SIGNED/) {
 
 #psuedoheaders
 my %pheader;
+my @control_bits;
 # extract pseudo-headers
 for my $phline (@bodylines)
 {
@@ -221,9 +222,13 @@ for my $phline (@bodylines)
     $fv =~ s/\s*$//;
     print {$debugfh} ">$fn|$fv|\n";
     $fn = lc $fn;
-    # Don't lc owner or forwarded
-    $fv = lc $fv unless $fn =~ /^(?:owner|forwarded|usertags|version|source-version)$/;
-    $pheader{$fn} = $fv;
+    if ($fn =~ /^control$/) {
+       push @control_bits,$fv;
+    } else {
+       # Don't lc owner or forwarded
+       $fv = lc $fv unless $fn =~ /^(?:owner|forwarded|usertags|version|source-version)$/;
+       $pheader{$fn} = $fv;
+    }
     print {$debugfh} ">$fn~$fv<\n";
 }
 
@@ -440,8 +445,12 @@ if ($codeletter eq 'D' || $codeletter eq 'F')
        writebug($ref, $data);
 
        my $hash = get_hashname($ref);
-        open(O,"db-h/$hash/$ref.report") || die "read original report: $!";
-        my $orig_report= join('',<O>); close(O);
+       my $orig_report_fh = IO::File->new("db-h/$hash/$ref.report") or
+           die "Unable to read original report: $!";
+       my $orig_report;
+       { local $/; $orig_report = <$orig_report_fh>;}
+       close($orig_report_fh) or
+           die "Unable to close original report filehandle: $!";
         if ($codeletter eq 'F') {
            &htmllog("Reply","sent",$replyto,"You have marked $gBug as forwarded.");
             &sendmessage(create_mime_message(