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 7814de8afb7dd4696c525bbd5354ce401256bdfd..2c02c11bcb74603ada8f65b062988699d66ec00a 100755 (executable)
@@ -146,18 +146,24 @@ if (!$gunzchild) {
     exec 'gunzip'; die $!;
 }
 
     exec 'gunzip'; die $!;
 }
 
+my $dedupedtsv= pipethrough_prep();
+
 while (<GZ>) {
 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 $?");
 
 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',
 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"
 $mcontent->add_part($mdatafile);
 
 open M, "|/usr/sbin/sendmail -t -oi -oee -odb"