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
This commit is contained in:
Daniel Stenberg 2005-12-13 10:20:23 +00:00
parent 48983b23cc
commit e07b0bb1e0

View file

@ -10,24 +10,49 @@
$ROOT="..";
if($ARGV[0] eq "-r") {
my $ziptool="zip";
my $output="rockbox.zip";
my $verbose;
my $exe;
my $target;
while(1) {
if($ARGV[0] eq "-r") {
$ROOT=$ARGV[1];
shift @ARGV;
shift @ARGV;
}
}
my $verbose;
if($ARGV[0] eq "-v") {
elsif($ARGV[0] eq "-z") {
$ziptool=$ARGV[1];
shift @ARGV;
shift @ARGV;
}
elsif($ARGV[0] eq "-o") {
$output=$ARGV[1];
shift @ARGV;
shift @ARGV;
}
elsif($ARGV[0] eq "-v") {
$verbose =1;
shift @ARGV;
}
else {
$target = $ARGV[0];
$exe = $ARGV[1];
last;
}
}
my $firmdir="$ROOT/firmware";
my $target = $ARGV[0];
my $cppdef = $target;
my $exe = $ARGV[1];
sub filesize {
my ($filename)=@_;
@ -198,10 +223,10 @@ sub buildzip {
buildlangs(".rockbox/langs");
`rm -f $zip`;
`find .rockbox | zip $zip -@ >/dev/null`;
`find .rockbox | xargs $ziptool $zip >/dev/null`;
if($image) {
`zip $zip $image`;
`$ziptool $zip $image`;
}
# remove the .rockbox afterwards
@ -222,7 +247,7 @@ sub runone {
my ($type, $target)=@_;
# build a full install zip file
buildzip("rockbox.zip", $target,
buildzip($output, $target,
($type eq "player")?0:1);
};