close R or die $!;
}
- sub main__upload_yaarg () {
+ sub gzip ($) {
+ my ($raw) = @_;
+ my $tf= IO::File::new_tmpfile() or die $!;
+ print $tf $raw or die $!;
+ $tf->flush or die $!;
+ $tf->seek(0,0) or die $!;
+ my $child= open GZ, "-|"; defined $child or die $!;
+ if (!$child) {
+ open STDIN, "<&", $tf;
+ exec 'gzip'; die $!;
+ }
+ my $r;
+ { undef $/; $!=0; $r= <GZ>; }
+ defined $r or die $!;
+ close GZ or die "$! $?"; die $? if $?;
+ return $r;
+ }
+
-sub main__upload () {
++sub main__uploadyaarg () {
+ my $ocean= $ENV{'YPPSC_OCEAN'}; die unless $ocean;
+ my $island= $ENV{'YPPSC_ISLAND'}; die unless $island;
+ my $content= {
+ 'data' => [ undef, 'deduped.tsv.gz',
+ Content_Type => 'application/octet-stream',
+ Content => ''
+]};
+}
+
- sub main__upload_pctb () {
++sub main__uploadpctb () {
my $ocean= $ENV{'YPPSC_OCEAN'}; die unless $ocean;
my $island= $ENV{'YPPSC_ISLAND'}; die unless $island;
die unless $pctb;