Changeset 24265 for lang/perl/misc/tgz2cgi/tgz2cgi.pl
- Timestamp:
- 11/19/08 15:56:35 (5 years ago)
- Files:
-
- 1 modified
-
lang/perl/misc/tgz2cgi/tgz2cgi.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/perl/misc/tgz2cgi/tgz2cgi.pl
r24262 r24265 4 4 use warnings; 5 5 use Getopt::Long; 6 use MIME::Base64; 6 7 7 8 my $title = 'CGI Self Extractor'; … … 36 37 #! /usr/bin/perl 37 38 39 use MIME::Base64; 40 38 41 sub abort { 39 42 print $_[0]; … … 63 66 EOT 64 67 } 65 open FH, '| uudecode -o /dev/stdout | gzcat| tar xvf -'68 open FH, '| gunzip | tar xvf -' 66 69 or abort("failed to start extraction:$!"); 67 print FH << '__end_of_archive__';70 print FH decode_base64(<< '__end_of_archive__'); 68 71 __EOT__ 69 72 ; 70 73 71 open my $fh, '-|', 'uuencode - < /dev/stdin' 72 or die "failed to call uuencode:$!";73 while ( my $l = <$fh>) {74 print $l;74 binmode STDIN; 75 my $tgz = ''; 76 while (read(STDIN, my $buf, 1048576) > 0) { 77 $tgz .= $buf; 75 78 } 79 print encode_base64($tgz); 80 76 81 print << '__EOT__'; 77 82 __end_of_archive__
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)