chiark / gitweb /
Recompress the tsv (and err make it work again??)
authorIan Jackson <ian@liberator.relativity.greenend.org.uk>
Tue, 28 Jul 2009 18:02:08 +0000 (19:02 +0100)
committerIan Jackson <ian@liberator.relativity.greenend.org.uk>
Tue, 28 Jul 2009 18:02:08 +0000 (19:02 +0100)
pctb/commod-update-receiver

index 7814de8..2c02c11 100755 (executable)
@@ -146,18 +146,24 @@ if (!$gunzchild) {
     exec 'gunzip'; die $!;
 }
 
+my $dedupedtsv= pipethrough_prep();
+
 while (<GZ>) {
-    check_tsv_line($_,\&fail);
+    my @v= check_tsv_line($_,\&fail);
+    print $dedupedtsv join('\t',@v),"\n" or die $!;
 }
+
 GZ->error and die $!;
 $?=0; close GZ; $? and fail("gunzip for check failed code $?");
 
+my $launderedgz= pipethrough_run($dedupedtsv,undef,'gzip','gzip');
+
 my $mdatafile= MIME::Entity->build(Top => 0,
                                   Type => 'application/octet-stream',
                                   Disposition => 'attachment',
                                   Encoding => 'base64',
                                   Filename => 'deduped.tsv.gz',
-                                  Path => $datafile);
+                                  Data => $launderedgz);
 $mcontent->add_part($mdatafile);
 
 open M, "|/usr/sbin/sendmail -t -oi -oee -odb"