ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Urlader/bin/urlader-util
(Generate patch)

Comparing Urlader/bin/urlader-util (file contents):
Revision 1.1 by root, Wed Jan 4 14:19:05 2012 UTC vs.
Revision 1.5 by root, Sun Jun 17 12:56:17 2012 UTC

6use Urlader; 6use Urlader;
7 7
8my $verbose = 1; 8my $verbose = 1;
9 9
10my $URLADER; 10my $URLADER;
11my $OUTPUT = "-"; 11my $OUTPUT;
12my $WINDOWS_ICON; 12my $WINDOWS_ICON;
13my $MODE = "pack"; 13my $MODE = "pack";
14 14
15Getopt::Long::Configure ("bundling", "no_ignore_case"); 15Getopt::Long::Configure ("bundling", "no_ignore_case");
16GetOptions( 16GetOptions(
34 34
35my $out = *STDOUT; 35my $out = *STDOUT;
36 36
37if (length $OUTPUT) { 37if (length $OUTPUT) {
38 undef $out; 38 undef $out;
39 open $out, ">:perlio", $OUTPUT 39 open $out, ">:raw:perlio", $OUTPUT
40 or die "$OUTPUT: $!"; 40 or die "$OUTPUT: $!";
41} 41}
42 42
43############################################################################# 43#############################################################################
44# for now, $MODE is --pack 44# for now, $MODE is --pack
49############################################################################# 49#############################################################################
50 50
51my $urlader_md5 = "\x00" x 16; 51my $urlader_md5 = "\x00" x 16;
52 52
53if (length $URLADER) { 53if (length $URLADER) {
54 open my $fh, "<:perlio", $URLADER 54 open my $fh, "<:raw:perlio", $URLADER
55 or die "$URLADER: $!"; 55 or die "$URLADER: $!";
56 my $urlader = do { local $/; <$fh> }; 56 my $urlader = do { local $/; <$fh> };
57 57
58 if (length $WINDOWS_ICON) { 58 if (length $WINDOWS_ICON) {
59 require Win32::Exe; 59 require Win32::Exe;
60 if (my $exe = eval { Win32::Exe->new (\$urlader) }) { 60 if (my $exe = eval { Win32::Exe->new (\$urlader) }) {
61 $exe->set_icons (Win32::Exe::IconFile->new ($WINDOWS_ICON)->icons); 61 $exe->set_icons ([Win32::Exe::IconFile->new ($WINDOWS_ICON)->icons]);
62 $exe->write (\$urlader); 62 $exe->write (\$urlader);
63 } else { 63 } else {
64 print "unable to set icon ($@)\n" if $verbose >= 2; 64 print "unable to set icon ($@)\n" if $verbose >= 2;
65 } 65 }
66 } 66 }
125 my $len = -s _; 125 my $len = -s _;
126 126
127 $datasize += $len; 127 $datasize += $len;
128 $max_uncomp = $len if $max_uncomp < $len; 128 $max_uncomp = $len if $max_uncomp < $len;
129 129
130 open my $fh2, "<", "$path/$file" 130 open my $fh2, "<:raw:perlio", "$path/$file"
131 or die "$path/$file: $!"; 131 or die "$path/$file: $!";
132 132
133 $len == sysread $fh2, my $data, $len 133 $len == sysread $fh2, my $data, $len
134 or die "$path/$file: read error"; 134 or die "$path/$file: read error";
135 135
220 220
221=back 221=back
222 222
223=head2 MODES 223=head2 MODES
224 224
225=over 4
226
225=item --pack <exe_id> <exe_ver> <path> [env-vars...] <program> [arguments...] 227=item --pack <exe_id> <exe_ver> <path> [env-vars...] <program> [arguments...]
226 228
227Packs the given directory tree, env-variable assignments, program path 229Packs the given directory tree, env-variable assignments, program path
228and arguments into an urlader archive and optionally prepend the urlader 230and arguments into an urlader archive and optionally prepend the urlader
229binary (see C<--urlader>) and output the whole blob. 231binary (see C<--urlader>) and output the whole blob.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines