summaryrefslogtreecommitdiffstats
path: root/wps/wpsbuild.pl
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-11-14 14:24:17 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-11-14 14:24:17 +0000
commit792c998e7ad936ad36086c6063b1db0dc6b53078 (patch)
tree23fb2564d1800cdf3ebff99f44e170b55278acff /wps/wpsbuild.pl
parent98b9fb379fa3575300ddac69d332536a987d6f90 (diff)
downloadrockbox-792c998e7ad936ad36086c6063b1db0dc6b53078.tar.gz
rockbox-792c998e7ad936ad36086c6063b1db0dc6b53078.tar.bz2
rockbox-792c998e7ad936ad36086c6063b1db0dc6b53078.zip
we start the WPS collection in this new module
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7858 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'wps/wpsbuild.pl')
-rwxr-xr-xwps/wpsbuild.pl55
1 files changed, 55 insertions, 0 deletions
diff --git a/wps/wpsbuild.pl b/wps/wpsbuild.pl
new file mode 100755
index 0000000000..2eb76c6b06
--- /dev/null
+++ b/wps/wpsbuild.pl
@@ -0,0 +1,55 @@
+#!/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;
+ }
+ }
+}
+