rockbox/wps/wpsbuild.pl
Daniel Stenberg 792c998e7a we start the WPS collection in this new module
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7858 a1c6a512-1295-4272-9138-f99709370657
2005-11-14 14:24:17 +00:00

55 lines
894 B
Perl
Executable file

#!/usr/bin/perl
my $wpslist=$ARGV[0];
if(!$wpslist) {
print "Usage: wpsbuilds.pl [WPSLIST]\n";
exit;
}
sub buildcfg {
my $cfg = $wps;
$cfg =~ s/\.wps/.cfg/;
open(CFG, ">$cfg");
print CFG <<MOO
\# $cfg generated by wpsbuild.pl
\#
wps: /.rockbox/wps/$wps
font: /.rockbox/fonts/$font
statusbar: $statusbar
MOO
;
close(CFG);
}
open(WPS, "<$wpslist");
while(<WPS>) {
my $l = $_;
if($l =~ /^ *\#/) {
# skip comment
next;
}
if($l =~ /^ *<wps>/i) {
$within = 1;
next;
}
if($within) {
if($l =~ /^ *<\/wps>/i) {
buildcfg();
$within = 0;
}
elsif($l =~ /^Name: (.*)/i) {
$wps = $1;
}
elsif($l =~ /^Font: (.*)/i) {
$font = $1;
}
elsif($l =~ /^Statusbar: (.*)/i) {
$statusbar = $1;
}
}
}