diff options
author | Christi Scarborough <christi@coraline.org> | 2005-11-18 15:33:05 +0000 |
---|---|---|
committer | Christi Scarborough <christi@coraline.org> | 2005-11-18 15:33:05 +0000 |
commit | 32a43e2ee688bf8b3c930685400a52910c512a1e (patch) | |
tree | 8675fddb2d926f0dabb65adb798033036a22c18d /wps/wpsbuild.pl | |
parent | e16ebf1a50b9692e93f44633138903418ef93526 (diff) | |
download | rockbox-32a43e2ee688bf8b3c930685400a52910c512a1e.tar.gz rockbox-32a43e2ee688bf8b3c930685400a52910c512a1e.zip |
When fixing things is it better to do it in a way that causes them to actually work. Some more bugs in wpsbuild.pl squashed. Also, themes moved to the main menu. Resetting to default themes now works properly.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7965 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'wps/wpsbuild.pl')
-rwxr-xr-x | wps/wpsbuild.pl | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/wps/wpsbuild.pl b/wps/wpsbuild.pl index fc7be294a3..d6cff68d3a 100755 --- a/wps/wpsbuild.pl +++ b/wps/wpsbuild.pl | |||
@@ -90,7 +90,7 @@ sub mkdirs { | |||
90 | my $wpsdir = $wps; | 90 | my $wpsdir = $wps; |
91 | $wpsdir =~ s/\.(r|)wps//; | 91 | $wpsdir =~ s/\.(r|)wps//; |
92 | mkdir ".rockbox/wps", 0777; | 92 | mkdir ".rockbox/wps", 0777; |
93 | mkdir ".rockbox/theme", 0777; | 93 | mkdir ".rockbox/themes", 0777; |
94 | 94 | ||
95 | if( -d ".rockbox/wps/$wpsdir") { | 95 | if( -d ".rockbox/wps/$wpsdir") { |
96 | #print STDERR "wpsbuild warning: directory wps/$wpsdir already exists!\n"; | 96 | #print STDERR "wpsbuild warning: directory wps/$wpsdir already exists!\n"; |
@@ -140,7 +140,7 @@ MOO | |||
140 | if($statusbar) { | 140 | if($statusbar) { |
141 | push @out, "statusbar: $statusbar\n"; | 141 | push @out, "statusbar: $statusbar\n"; |
142 | } | 142 | } |
143 | if($rwps && !$isrwps) { | 143 | if($rwps && $has_remote ) { |
144 | push @out, "rwps: /.rockbox/wps/$rwps\n"; | 144 | push @out, "rwps: /.rockbox/wps/$rwps\n"; |
145 | } | 145 | } |
146 | 146 | ||
@@ -148,7 +148,7 @@ MOO | |||
148 | print STDERR "wpsbuild warning: wps/$cfg already exists!\n"; | 148 | print STDERR "wpsbuild warning: wps/$cfg already exists!\n"; |
149 | } | 149 | } |
150 | else { | 150 | else { |
151 | open(CFG, ">.rockbox/theme/$cfg"); | 151 | open(CFG, ">.rockbox/themes/$cfg"); |
152 | print CFG @out; | 152 | print CFG @out; |
153 | close(CFG); | 153 | close(CFG); |
154 | } | 154 | } |
@@ -158,6 +158,8 @@ MOO | |||
158 | my ($main_height, $main_width) = getlcdsizes(); | 158 | my ($main_height, $main_width) = getlcdsizes(); |
159 | my ($remote_height, $remote_width) = getlcdsizes(1); | 159 | my ($remote_height, $remote_width) = getlcdsizes(1); |
160 | 160 | ||
161 | $has_remote = true if ($remote_height && $remote_width); | ||
162 | |||
161 | open(WPS, "<$wpslist"); | 163 | open(WPS, "<$wpslist"); |
162 | while(<WPS>) { | 164 | while(<WPS>) { |
163 | my $l = $_; | 165 | my $l = $_; |
@@ -168,6 +170,14 @@ while(<WPS>) { | |||
168 | if($l =~ /^ *<(r|)wps>/i) { | 170 | if($l =~ /^ *<(r|)wps>/i) { |
169 | $isrwps = $1; | 171 | $isrwps = $1; |
170 | $within = 1; | 172 | $within = 1; |
173 | # undef is a unary operator (!) | ||
174 | undef $wps; | ||
175 | undef $rwps; | ||
176 | undef $width; | ||
177 | undef $height; | ||
178 | undef $font; | ||
179 | undef $statusbar; | ||
180 | undef $author; | ||
171 | next; | 181 | next; |
172 | } | 182 | } |
173 | if($within) { | 183 | if($within) { |
@@ -184,6 +194,7 @@ while(<WPS>) { | |||
184 | if(!$rheight || !$rwidth) { | 194 | if(!$rheight || !$rwidth) { |
185 | printf STDERR "wpsbuild notice: No %sLCD size, skipping $wps\n", | 195 | printf STDERR "wpsbuild notice: No %sLCD size, skipping $wps\n", |
186 | $isrwps?"remote ":""; | 196 | $isrwps?"remote ":""; |
197 | $within = 0; | ||
187 | next; | 198 | next; |
188 | } | 199 | } |
189 | 200 | ||
@@ -196,7 +207,6 @@ while(<WPS>) { | |||
196 | # WPS | 207 | # WPS |
197 | # | 208 | # |
198 | #print "Size requirement is fine!\n"; | 209 | #print "Size requirement is fine!\n"; |
199 | |||
200 | mkdirs(); | 210 | mkdirs(); |
201 | if(!$isrwps) { | 211 | if(!$isrwps) { |
202 | # We only make .cfg files for <wps> sections: | 212 | # We only make .cfg files for <wps> sections: |
@@ -208,8 +218,6 @@ while(<WPS>) { | |||
208 | #print "Skip $wps due to size restraints\n"; | 218 | #print "Skip $wps due to size restraints\n"; |
209 | } | 219 | } |
210 | $within = 0; | 220 | $within = 0; |
211 | |||
212 | undef $wps, $rwps, $width, $height, $font, $statusbar, $author; | ||
213 | } | 221 | } |
214 | elsif($l =~ /^Name: (.*)/i) { | 222 | elsif($l =~ /^Name: (.*)/i) { |
215 | # Note that in the case this is within <rwps>, $wps will contain the | 223 | # Note that in the case this is within <rwps>, $wps will contain the |