my ($aref,$prefix) = @_;
$aref->{"${prefix}name"}= 'ypp-sc-tools yarrg';
$aref->{"${prefix}fixes"}= 'lastpage';
- $aref->{"${prefix}version"}= `git-describe --tags HEAD`; $? and die $?;
+
+ my $version= `git-describe --tags HEAD`; $? and die $?;
+ chomp($version);
+ $aref->{"${prefix}version"}= $version;
return $aref;
}
sub cgipostform ($$$) {
my ($ua, $url, $form) = @_;
- my $req= HTTP::Request::Common::POST($url,
+ my $req= HTTP::Request::Common::POST($url,
Content => $form,
Content_Type => 'form-data');
if ($url =~ m,^\.?/,) {
}
#system 'printenv >&2';
}, "$url", "$url");
+ $out =~ s/\r\n/\n/g;
$out =~ m,^Content-Type: text/plain.*\n\n, or die "$out ?";
return $';
} else {
my $dest= $ENV{'YPPSC_YAARG_SUBMIT'};
my $respcontent= cgipostform($ua, "$dest/commod-update-receiver", \%o);
-
- print $respcontent();
+ $respcontent =~ m/^OK\b/ or die "$respcontent ?";
}
sub main__uploadpctb () {
}
foreach my $vn (sort keys %o) {
- my $mpart= MIME::Entity->build(Type => 'text/plain',
+ my $mpart= MIME::Entity->build(Top => 0,
+ Type => 'text/plain',
Charset => 'utf-8',
- Disposition => 'inline',
+ Disposition => 'attachment',
+ Filename => $vn,
Data => $o{$vn});
$mcontent->add_part($mpart);
}
GZ->error and die $!;
$?=0; close GZ; $? and fail("gunzip for check failed code $?");
-my $mdatafile= MIME::Entity->build(Type => 'application/octet-stream',
+my $mdatafile= MIME::Entity->build(Top => 0,
+ Type => 'application/octet-stream',
Disposition => 'attachment',
Encoding => 'base64',
- File => $datafile);
+ Filename => 'deduped.tsv.gz',
+ Path => $datafile);
$mcontent->add_part($mdatafile);
-open M, "|/usr/sbin/sendmail -t -oi -oee -odq"
+open M, "|/usr/sbin/sendmail -t -oi -oee -odb"
or fail("fork sendmail failed! ($!)");
$mcontent->print(\*M);
M->error and fail("write sendmail failed! ($!)");
$?=0; close M; $? and fail("sendmail failed code $?");
+
+print header(-type=>'text/plain', -charset=>'us-ascii'),
+ "OK\n"
+ or die $!;