792c998e7a
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7858 a1c6a512-1295-4272-9138-f99709370657
55 lines
894 B
Perl
Executable file
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;
|
|
}
|
|
}
|
|
}
|
|
|