diff options
Diffstat (limited to 'wps/wpsbuild.pl')
-rwxr-xr-x | wps/wpsbuild.pl | 90 |
1 files changed, 50 insertions, 40 deletions
diff --git a/wps/wpsbuild.pl b/wps/wpsbuild.pl index 6a963f9a7c..cb9ccbfc80 100755 --- a/wps/wpsbuild.pl +++ b/wps/wpsbuild.pl | |||
@@ -111,10 +111,12 @@ sub mkdirs | |||
111 | sub copybackdrop | 111 | sub copybackdrop |
112 | { | 112 | { |
113 | #copy the backdrop file into the build dir | 113 | #copy the backdrop file into the build dir |
114 | $dst = $backdrop; | 114 | if ($backdrop ne '') { |
115 | $dst =~ s/(\.[0-9]*x[0-9]*x[0-9]*)//; | 115 | $dst = $backdrop; |
116 | $cmd = "cp $ROOT/$backdrop .rockbox/$dst"; | 116 | $dst =~ s/(\.[0-9]*x[0-9]*x[0-9]*)//; |
117 | `$cmd`; | 117 | $cmd = "cp $ROOT/$backdrop .rockbox/$dst"; |
118 | `$cmd`; | ||
119 | } | ||
118 | } | 120 | } |
119 | 121 | ||
120 | sub copythemefont | 122 | sub copythemefont |
@@ -132,16 +134,20 @@ sub copythemeicon | |||
132 | { | 134 | { |
133 | #copy the icon specified by the theme | 135 | #copy the icon specified by the theme |
134 | 136 | ||
135 | $iconset =~ /\/(.*icons\/(.*))/i; | 137 | if ($iconset ne '') { |
136 | `cp $ROOT/icons/$2 $1`; | 138 | $iconset =~ /\/(.*icons\/(.*))/i; |
139 | `cp $ROOT/icons/$2 $1`; | ||
140 | } | ||
137 | } | 141 | } |
138 | 142 | ||
139 | sub copythemeviewericon | 143 | sub copythemeviewericon |
140 | { | 144 | { |
141 | #copy the viewer icon specified by the theme | 145 | #copy the viewer icon specified by the theme |
142 | 146 | ||
143 | $viewericon =~ /\/(.*icons\/(.*))/i; | 147 | if ($viewericon ne '') { |
144 | `cp $ROOT/icons/$2 $1`; | 148 | $viewericon =~ /\/(.*icons\/(.*))/i; |
149 | `cp $ROOT/icons/$2 $1`; | ||
150 | } | ||
145 | } | 151 | } |
146 | 152 | ||
147 | sub copywps | 153 | sub copywps |
@@ -219,10 +225,14 @@ MOO | |||
219 | if($statusbar) { | 225 | if($statusbar) { |
220 | push @out, "statusbar: $statusbar\n"; | 226 | push @out, "statusbar: $statusbar\n"; |
221 | } | 227 | } |
222 | if($backdrop) { | 228 | if(defined($backdrop)) { |
223 | # clip resolution from filename | 229 | if ($backdrop eq '') { |
224 | $backdrop =~ s/(\.[0-9]*x[0-9]*x[0-9]*)//; | 230 | push @out, "backdrop:\n"; |
225 | push @out, "backdrop: /.rockbox/$backdrop\n"; | 231 | } else { |
232 | # clip resolution from filename | ||
233 | $backdrop =~ s/(\.[0-9]*x[0-9]*x[0-9]*)//; | ||
234 | push @out, "backdrop: /.rockbox/$backdrop\n"; | ||
235 | } | ||
226 | } | 236 | } |
227 | if($lineselectstart && $main_depth > 2) { | 237 | if($lineselectstart && $main_depth > 2) { |
228 | push @out, "line selector start color: $lineselectstart\n"; | 238 | push @out, "line selector start color: $lineselectstart\n"; |
@@ -233,10 +243,10 @@ MOO | |||
233 | if($selecttype) { | 243 | if($selecttype) { |
234 | push @out, "selector type: $selecttype\n"; | 244 | push @out, "selector type: $selecttype\n"; |
235 | } | 245 | } |
236 | if($iconset) { | 246 | if(defined($iconset)) { |
237 | push @out, "iconset: $iconset\n"; | 247 | push @out, "iconset: $iconset\n"; |
238 | } | 248 | } |
239 | if($viewericon) { | 249 | if(defined($viewericon)) { |
240 | push @out, "viewers iconset: $viewericon\n"; | 250 | push @out, "viewers iconset: $viewericon\n"; |
241 | } | 251 | } |
242 | if($lineselecttextcolor && $main_depth > 2 ) { | 252 | if($lineselecttextcolor && $main_depth > 2 ) { |
@@ -362,93 +372,93 @@ while(<WPS>) { | |||
362 | } | 372 | } |
363 | $within = 0; | 373 | $within = 0; |
364 | } | 374 | } |
365 | elsif($l =~ /^Name: (.*)/i) { | 375 | elsif($l =~ /^Name: *(.*)/i) { |
366 | # Note that in the case this is within <rwps>, $wps will contain the | 376 | # Note that in the case this is within <rwps>, $wps will contain the |
367 | # name of the rwps. Use $isrwps to figure out what type it is. | 377 | # name of the rwps. Use $isrwps to figure out what type it is. |
368 | $wps = $wps_prefix = $1; | 378 | $wps = $wps_prefix = $1; |
369 | $wps_prefix =~ s/\.(r|)wps//; | 379 | $wps_prefix =~ s/\.(r|)wps//; |
370 | # print $wps_prefix . "\n"; | 380 | # print $wps_prefix . "\n"; |
371 | } | 381 | } |
372 | elsif($l =~ /^RWPS: (.*)/i) { | 382 | elsif($l =~ /^RWPS: *(.*)/i) { |
373 | $rwps = $1; | 383 | $rwps = $1; |
374 | } | 384 | } |
375 | elsif($l =~ /^RWPS\.${main_width}x${main_height}x$main_depth: (.*)/i) { | 385 | elsif($l =~ /^RWPS\.${main_width}x${main_height}x$main_depth: *(.*)/i) { |
376 | $rwps = $1; | 386 | $rwps = $1; |
377 | } | 387 | } |
378 | elsif($l =~ /^Author: (.*)/i) { | 388 | elsif($l =~ /^Author: *(.*)/i) { |
379 | $author = $1; | 389 | $author = $1; |
380 | } | 390 | } |
381 | elsif($l =~ /^Width: (.*)/i) { | 391 | elsif($l =~ /^Width: *(.*)/i) { |
382 | $width = $1; | 392 | $width = $1; |
383 | } | 393 | } |
384 | elsif($l =~ /^Width\.${main_width}x${main_height}x$main_depth: (.*)/i) { | 394 | elsif($l =~ /^Width\.${main_width}x${main_height}x$main_depth: *(.*)/i) { |
385 | $width = $1; | 395 | $width = $1; |
386 | } | 396 | } |
387 | elsif($l =~ /^Height: (.*)/i) { | 397 | elsif($l =~ /^Height: *(.*)/i) { |
388 | $height = $1; | 398 | $height = $1; |
389 | } | 399 | } |
390 | elsif($l =~ /^Height\.${main_width}x${main_height}x$main_depth: (.*)/i) { | 400 | elsif($l =~ /^Height\.${main_width}x${main_height}x$main_depth: *(.*)/i) { |
391 | $height = $1; | 401 | $height = $1; |
392 | } | 402 | } |
393 | elsif($l =~ /^Font: (.*)/i) { | 403 | elsif($l =~ /^Font: *(.*)/i) { |
394 | $font = $1; | 404 | $font = $1; |
395 | } | 405 | } |
396 | elsif($l =~ /^Foreground Color: (.*)/i) { | 406 | elsif($l =~ /^Foreground Color: *(.*)/i) { |
397 | $fgcolor = $1; | 407 | $fgcolor = $1; |
398 | } | 408 | } |
399 | elsif($l =~ /^Background Color: (.*)/i) { | 409 | elsif($l =~ /^Background Color: *(.*)/i) { |
400 | $bgcolor = $1; | 410 | $bgcolor = $1; |
401 | } | 411 | } |
402 | elsif($l =~ /^Font\.${main_width}x${main_height}x$main_depth: (.*)/i) { | 412 | elsif($l =~ /^Font\.${main_width}x${main_height}x$main_depth: *(.*)/i) { |
403 | $font = $1; | 413 | $font = $1; |
404 | copythemefont(); | 414 | copythemefont(); |
405 | } | 415 | } |
406 | elsif($l =~ /^Statusbar: (.*)/i) { | 416 | elsif($l =~ /^Statusbar: *(.*)/i) { |
407 | $statusbar = $1; | 417 | $statusbar = $1; |
408 | } | 418 | } |
409 | elsif($l =~ /^Statusbar\.${main_width}x${main_height}x$main_depth: (.*)/i) { | 419 | elsif($l =~ /^Statusbar\.${main_width}x${main_height}x$main_depth: *(.*)/i) { |
410 | $statusbar = $1; | 420 | $statusbar = $1; |
411 | } | 421 | } |
412 | elsif($l =~ /^Backdrop: (.*)/i) { | 422 | elsif($l =~ /^Backdrop: *(.*)/i) { |
413 | $backdrop = $1; | 423 | $backdrop = $1; |
414 | copybackdrop(); | 424 | copybackdrop(); |
415 | } | 425 | } |
416 | elsif($l =~ /^Backdrop\.${main_width}x${main_height}x$main_depth: (.*)/i) { | 426 | elsif($l =~ /^Backdrop\.${main_width}x${main_height}x$main_depth: *(.*)/i) { |
417 | $backdrop = $1; | 427 | $backdrop = $1; |
418 | copybackdrop(); | 428 | copybackdrop(); |
419 | } | 429 | } |
420 | elsif($l =~ /^line selector start color: (.*)/i) { | 430 | elsif($l =~ /^line selector start color: *(.*)/i) { |
421 | $lineselectstart = $1; | 431 | $lineselectstart = $1; |
422 | } | 432 | } |
423 | elsif($l =~ /^line selector end color: (.*)/i) { | 433 | elsif($l =~ /^line selector end color: *(.*)/i) { |
424 | $lineselectend = $1; | 434 | $lineselectend = $1; |
425 | } | 435 | } |
426 | elsif($l =~ /^selector type: (.*)/i) { | 436 | elsif($l =~ /^selector type: *(.*)/i) { |
427 | $selecttype = $1; | 437 | $selecttype = $1; |
428 | } | 438 | } |
429 | elsif($l =~ /^selector type\.${main_width}x${main_height}x$main_depth: (.*)/i) { | 439 | elsif($l =~ /^selector type\.${main_width}x${main_height}x$main_depth: *(.*)/i) { |
430 | $selecttype = $1; | 440 | $selecttype = $1; |
431 | } | 441 | } |
432 | elsif($l =~ /^iconset: (.*)/i) { | 442 | elsif($l =~ /^iconset: *(.*)/i) { |
433 | $iconset = $1; | 443 | $iconset = $1; |
434 | copythemeicon(); | 444 | copythemeicon(); |
435 | } | 445 | } |
436 | elsif($l =~ /^iconset\.${main_width}x${main_height}x$main_depth: (.*)/i) { | 446 | elsif($l =~ /^iconset\.${main_width}x${main_height}x$main_depth: *(.*)/i) { |
437 | $iconset = $1; | 447 | $iconset = $1; |
438 | copythemeicon(); | 448 | copythemeicon(); |
439 | } | 449 | } |
440 | elsif($l =~ /^viewers iconset: (.*)/i) { | 450 | elsif($l =~ /^viewers iconset: *(.*)/i) { |
441 | $viewericon = $1; | 451 | $viewericon = $1; |
442 | copythemeviewericon(); | 452 | copythemeviewericon(); |
443 | } | 453 | } |
444 | elsif($l =~ /^viewers iconset\.${main_width}x${main_height}x$main_depth: (.*)/i) { | 454 | elsif($l =~ /^viewers iconset\.${main_width}x${main_height}x$main_depth: *(.*)/i) { |
445 | $viewericon = $1; | 455 | $viewericon = $1; |
446 | copythemeviewericon(); | 456 | copythemeviewericon(); |
447 | } | 457 | } |
448 | elsif($l =~ /^line selector text color: (.*)/i) { | 458 | elsif($l =~ /^line selector text color: *(.*)/i) { |
449 | $lineselecttextcolor = $1; | 459 | $lineselecttextcolor = $1; |
450 | } | 460 | } |
451 | elsif($l =~ /^filetype colours: (.*)/i) { | 461 | elsif($l =~ /^filetype colours: *(.*)/i) { |
452 | $filetylecolor = $1; | 462 | $filetylecolor = $1; |
453 | } | 463 | } |
454 | else{ | 464 | else{ |