diff options
author | Daniel Stenberg <daniel@haxx.se> | 2005-11-14 13:52:31 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2005-11-14 13:52:31 +0000 |
commit | 414fb4ed633d56933807ddcc785cde7c1a772dca (patch) | |
tree | 29c585c216173ab895f781301790c4c83c8e2beb /apps/wps/wpsbuild.pl | |
parent | f59df8bf3ca48265ebff09fb10b4f40b336e346a (diff) | |
download | rockbox-414fb4ed633d56933807ddcc785cde7c1a772dca.tar.gz rockbox-414fb4ed633d56933807ddcc785cde7c1a772dca.zip |
xameius ipod WPS and my first take at a script that generates a .cfg file for
the WPS. This is only a first step. There are lots of more things to do.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7856 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/wps/wpsbuild.pl')
-rwxr-xr-x | apps/wps/wpsbuild.pl | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/apps/wps/wpsbuild.pl b/apps/wps/wpsbuild.pl new file mode 100755 index 0000000000..2eb76c6b06 --- /dev/null +++ b/apps/wps/wpsbuild.pl | |||
@@ -0,0 +1,55 @@ | |||
1 | #!/usr/bin/perl | ||
2 | |||
3 | my $wpslist=$ARGV[0]; | ||
4 | |||
5 | if(!$wpslist) { | ||
6 | print "Usage: wpsbuilds.pl [WPSLIST]\n"; | ||
7 | exit; | ||
8 | } | ||
9 | |||
10 | sub buildcfg { | ||
11 | my $cfg = $wps; | ||
12 | |||
13 | $cfg =~ s/\.wps/.cfg/; | ||
14 | |||
15 | open(CFG, ">$cfg"); | ||
16 | |||
17 | print CFG <<MOO | ||
18 | \# $cfg generated by wpsbuild.pl | ||
19 | \# | ||
20 | wps: /.rockbox/wps/$wps | ||
21 | font: /.rockbox/fonts/$font | ||
22 | statusbar: $statusbar | ||
23 | MOO | ||
24 | ; | ||
25 | close(CFG); | ||
26 | } | ||
27 | |||
28 | open(WPS, "<$wpslist"); | ||
29 | while(<WPS>) { | ||
30 | my $l = $_; | ||
31 | if($l =~ /^ *\#/) { | ||
32 | # skip comment | ||
33 | next; | ||
34 | } | ||
35 | if($l =~ /^ *<wps>/i) { | ||
36 | $within = 1; | ||
37 | next; | ||
38 | } | ||
39 | if($within) { | ||
40 | if($l =~ /^ *<\/wps>/i) { | ||
41 | buildcfg(); | ||
42 | $within = 0; | ||
43 | } | ||
44 | elsif($l =~ /^Name: (.*)/i) { | ||
45 | $wps = $1; | ||
46 | } | ||
47 | elsif($l =~ /^Font: (.*)/i) { | ||
48 | $font = $1; | ||
49 | } | ||
50 | elsif($l =~ /^Statusbar: (.*)/i) { | ||
51 | $statusbar = $1; | ||
52 | } | ||
53 | } | ||
54 | } | ||
55 | |||