From: Ian Jackson Date: Tue, 28 Jul 2009 18:02:08 +0000 (+0100) Subject: Recompress the tsv (and err make it work again??) X-Git-Tag: 3.0~24 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.db-test.git;a=commitdiff_plain;h=2189c69cead5cb3717ef9f06beebd9bca519ad79 Recompress the tsv (and err make it work again??) --- diff --git a/pctb/commod-update-receiver b/pctb/commod-update-receiver index 7814de8..2c02c11 100755 --- a/pctb/commod-update-receiver +++ b/pctb/commod-update-receiver @@ -146,18 +146,24 @@ if (!$gunzchild) { exec 'gunzip'; die $!; } +my $dedupedtsv= pipethrough_prep(); + while () { - 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"