diff options
-rwxr-xr-x | tools/buildtheme.pl | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/tools/buildtheme.pl b/tools/buildtheme.pl index 488a57d0ab..171adf2176 100755 --- a/tools/buildtheme.pl +++ b/tools/buildtheme.pl | |||
@@ -264,8 +264,9 @@ sub copyskin | |||
264 | my @filelist; | 264 | my @filelist; |
265 | my $src; | 265 | my $src; |
266 | my $dest; | 266 | my $dest; |
267 | my $sizestring; | ||
267 | 268 | ||
268 | if($wpslist =~ /(.*)OUT/) { | 269 | if($wpslist =~ /(.*)WPSFILE/) { |
269 | $dir = $1; | 270 | $dir = $1; |
270 | 271 | ||
271 | # first try the actual filename given to us | 272 | # first try the actual filename given to us |
@@ -274,6 +275,10 @@ sub copyskin | |||
274 | $src = "${dir}$skin.$ext"; | 275 | $src = "${dir}$skin.$ext"; |
275 | if ( -e $src ) | 276 | if ( -e $src ) |
276 | { | 277 | { |
278 | if ($skin =~ /\w\.(\d*x\d*x\d*).*/) | ||
279 | { | ||
280 | $sizestring = $1; | ||
281 | } | ||
277 | my $cmd = "cp $src $rbdir/wps/$themename.$ext"; | 282 | my $cmd = "cp $src $rbdir/wps/$themename.$ext"; |
278 | `$cmd`; | 283 | `$cmd`; |
279 | } | 284 | } |
@@ -287,13 +292,13 @@ sub copyskin | |||
287 | foreach my $d (@depthlist) | 292 | foreach my $d (@depthlist) |
288 | { | 293 | { |
289 | next if ($d > $depth); | 294 | next if ($d > $depth); |
290 | $src = "${dir}$skin.${width}x${height}x${d}.$ext"; | 295 | $sizestring = "${width}x${height}x${d}"; |
296 | $src = "${dir}$skin.${sizestring}.$ext"; | ||
291 | last if (-e $src); | 297 | last if (-e $src); |
292 | } | 298 | } |
293 | if (-e $src) | 299 | if (-e $src) |
294 | { | 300 | { |
295 | my $cmd = "cp $src $rbdir/wps/$themename.$ext"; | 301 | my $cmd = "cp $src $rbdir/wps/$themename.$ext"; |
296 | print "$cmd\n"; | ||
297 | `$cmd`; | 302 | `$cmd`; |
298 | } | 303 | } |
299 | elsif (-e "${dir}$skin.$ext") | 304 | elsif (-e "${dir}$skin.$ext") |
@@ -304,6 +309,35 @@ sub copyskin | |||
304 | else | 309 | else |
305 | { | 310 | { |
306 | #print STDERR "buildtheme warning: No suitable skin file for $ext\n"; | 311 | #print STDERR "buildtheme warning: No suitable skin file for $ext\n"; |
312 | return; | ||
313 | } | ||
314 | } | ||
315 | |||
316 | open(WPSFILE, "$rbdir/wps/$themename.$ext"); | ||
317 | while (<WPSFILE>) { | ||
318 | $filelist[$#filelist + 1] = $1 if (/\|([^|]*?.bmp)\|/); | ||
319 | } | ||
320 | close(WPSFILE); | ||
321 | if ($#filelist >= 0) | ||
322 | { | ||
323 | my $file; | ||
324 | if ($sizestring && -e "$dir/$themename/$sizestring") | ||
325 | { | ||
326 | foreach $file (@filelist) | ||
327 | { | ||
328 | system("cp $dir/$themename/$sizestring/$file $rbdir/wps/$themename/"); | ||
329 | } | ||
330 | } | ||
331 | elsif (-e "$dir/$themename") | ||
332 | { | ||
333 | foreach $file (@filelist) | ||
334 | { | ||
335 | system("cp $dir/$themename/$file $rbdir/wps/$themename/"); | ||
336 | } | ||
337 | } | ||
338 | else | ||
339 | { | ||
340 | print STDERR "beep, no dir to copy WPS from!\n"; | ||
307 | } | 341 | } |
308 | } | 342 | } |
309 | } | 343 | } |