</%doc><%flags>
inherit => undef
</%flags><%perl>
-use IO::Pipe;
use CommodsWeb;
+use Commods;
$r->content_type('application/octet-stream');
$m->flush_buffer();
-$ENV{'YPPSC_YARRG_SRCBASE'}= sourcebasedir();
-my $pipe= new IO::Pipe or die $!;
-my $pid= fork(); defined $pid or die $!;
-if (!$pid) {
- $pipe->writer();
- exec '/bin/sh','-c','
- cd -P "$YPPSC_YARRG_SRCBASE"
- (
- git-ls-files -z;
- git-ls-files -z --others --exclude-from=.gitignore;
- if test -d .git; then find .git -print0; fi
- ) | (
- cpio -Hustar -o --quiet -0 -R 1000:1000 || \
- cpio -Hustar -o --quiet -0
- ) | gzip
- ';
- die $!;
-}
-$pipe->reader();
-
-my ($d, $l);
-while ($l= read $pipe, $d, 65536) {
- print $d;
+source_tarball(sourcebasedir(), sub {
+ print $_[0];
$m->flush_buffer();
-}
-waitpid $pid,0;
-defined $l or die "read pipe $!";
-$pipe->error and die "pipe error $!";
-close $pipe;
-# deliberately ignore errors
+})
</%perl>