diff options
author | Daniel Stenberg <daniel@haxx.se> | 2005-12-13 10:20:23 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2005-12-13 10:20:23 +0000 |
commit | e07b0bb1e025c442062e17925c4e12f5061df5a1 (patch) | |
tree | 3a19677bd43cf37dc98355dd2134c8197ade97c7 /tools/buildzip.pl | |
parent | 48983b23cc94eba8e54d6101255802cb7232fa26 (diff) | |
download | rockbox-e07b0bb1e025c442062e17925c4e12f5061df5a1.tar.gz rockbox-e07b0bb1e025c442062e17925c4e12f5061df5a1.zip |
Made the script more generic to allow other package creation tools to get
passed to it using the command line. Note that this makes the script use
'xargs'.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8227 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools/buildzip.pl')
-rwxr-xr-x | tools/buildzip.pl | 51 |
1 files changed, 38 insertions, 13 deletions
diff --git a/tools/buildzip.pl b/tools/buildzip.pl index 1942071565..eabf739d0d 100755 --- a/tools/buildzip.pl +++ b/tools/buildzip.pl | |||
@@ -10,24 +10,49 @@ | |||
10 | 10 | ||
11 | $ROOT=".."; | 11 | $ROOT=".."; |
12 | 12 | ||
13 | if($ARGV[0] eq "-r") { | ||
14 | $ROOT=$ARGV[1]; | ||
15 | shift @ARGV; | ||
16 | shift @ARGV; | ||
17 | } | ||
18 | 13 | ||
14 | |||
15 | my $ziptool="zip"; | ||
16 | my $output="rockbox.zip"; | ||
19 | my $verbose; | 17 | my $verbose; |
20 | if($ARGV[0] eq "-v") { | 18 | my $exe; |
21 | $verbose =1; | 19 | my $target; |
22 | shift @ARGV; | 20 | |
21 | while(1) { | ||
22 | if($ARGV[0] eq "-r") { | ||
23 | $ROOT=$ARGV[1]; | ||
24 | shift @ARGV; | ||
25 | shift @ARGV; | ||
26 | } | ||
27 | |||
28 | elsif($ARGV[0] eq "-z") { | ||
29 | $ziptool=$ARGV[1]; | ||
30 | shift @ARGV; | ||
31 | shift @ARGV; | ||
32 | } | ||
33 | |||
34 | elsif($ARGV[0] eq "-o") { | ||
35 | $output=$ARGV[1]; | ||
36 | shift @ARGV; | ||
37 | shift @ARGV; | ||
38 | } | ||
39 | |||
40 | elsif($ARGV[0] eq "-v") { | ||
41 | $verbose =1; | ||
42 | shift @ARGV; | ||
43 | } | ||
44 | else { | ||
45 | $target = $ARGV[0]; | ||
46 | $exe = $ARGV[1]; | ||
47 | last; | ||
48 | } | ||
23 | } | 49 | } |
24 | 50 | ||
51 | |||
25 | my $firmdir="$ROOT/firmware"; | 52 | my $firmdir="$ROOT/firmware"; |
26 | 53 | ||
27 | my $target = $ARGV[0]; | ||
28 | my $cppdef = $target; | 54 | my $cppdef = $target; |
29 | 55 | ||
30 | my $exe = $ARGV[1]; | ||
31 | 56 | ||
32 | sub filesize { | 57 | sub filesize { |
33 | my ($filename)=@_; | 58 | my ($filename)=@_; |
@@ -198,10 +223,10 @@ sub buildzip { | |||
198 | buildlangs(".rockbox/langs"); | 223 | buildlangs(".rockbox/langs"); |
199 | 224 | ||
200 | `rm -f $zip`; | 225 | `rm -f $zip`; |
201 | `find .rockbox | zip $zip -@ >/dev/null`; | 226 | `find .rockbox | xargs $ziptool $zip >/dev/null`; |
202 | 227 | ||
203 | if($image) { | 228 | if($image) { |
204 | `zip $zip $image`; | 229 | `$ziptool $zip $image`; |
205 | } | 230 | } |
206 | 231 | ||
207 | # remove the .rockbox afterwards | 232 | # remove the .rockbox afterwards |
@@ -222,7 +247,7 @@ sub runone { | |||
222 | my ($type, $target)=@_; | 247 | my ($type, $target)=@_; |
223 | 248 | ||
224 | # build a full install zip file | 249 | # build a full install zip file |
225 | buildzip("rockbox.zip", $target, | 250 | buildzip($output, $target, |
226 | ($type eq "player")?0:1); | 251 | ($type eq "player")?0:1); |
227 | }; | 252 | }; |
228 | 253 | ||