summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-12-13 10:20:23 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-12-13 10:20:23 +0000
commite07b0bb1e025c442062e17925c4e12f5061df5a1 (patch)
tree3a19677bd43cf37dc98355dd2134c8197ade97c7
parent48983b23cc94eba8e54d6101255802cb7232fa26 (diff)
downloadrockbox-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
-rwxr-xr-xtools/buildzip.pl51
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
13if($ARGV[0] eq "-r") {
14 $ROOT=$ARGV[1];
15 shift @ARGV;
16 shift @ARGV;
17}
18 13
14
15my $ziptool="zip";
16my $output="rockbox.zip";
19my $verbose; 17my $verbose;
20if($ARGV[0] eq "-v") { 18my $exe;
21 $verbose =1; 19my $target;
22 shift @ARGV; 20
21while(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
25my $firmdir="$ROOT/firmware"; 52my $firmdir="$ROOT/firmware";
26 53
27my $target = $ARGV[0];
28my $cppdef = $target; 54my $cppdef = $target;
29 55
30my $exe = $ARGV[1];
31 56
32sub filesize { 57sub 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