diff options
author | Thomas Martitz <kugel@rockbox.org> | 2010-07-25 13:44:30 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2010-07-25 13:44:30 +0000 |
commit | 67d61f2ba92714ab982254d2ee45fa5ad436f241 (patch) | |
tree | 6df6f7264a8c028e36dc07c1d78458306af8d1bc | |
parent | 6ce2c6753dd7a28731a17c946952025a803a3e4d (diff) | |
download | rockbox-67d61f2ba92714ab982254d2ee45fa5ad436f241.tar.gz rockbox-67d61f2ba92714ab982254d2ee45fa5ad436f241.zip |
$rbdir => $temp_dir where appropriate, shadowing $rbdir with the temp dir broke wpsbuild.pl (for rbdir != ".rockbox")
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27545 a1c6a512-1295-4272-9138-f99709370657
-rwxr-xr-x | tools/buildzip.pl | 140 |
1 files changed, 70 insertions, 70 deletions
diff --git a/tools/buildzip.pl b/tools/buildzip.pl index 9cf680b820..0358459c9c 100755 --- a/tools/buildzip.pl +++ b/tools/buildzip.pl | |||
@@ -309,7 +309,7 @@ sub filesize { | |||
309 | sub buildzip { | 309 | sub buildzip { |
310 | my ($image, $fonts)=@_; | 310 | my ($image, $fonts)=@_; |
311 | my $libdir = $install; | 311 | my $libdir = $install; |
312 | my $rbdir = ".rockbox"; | 312 | my $temp_dir = ".rockbox"; |
313 | 313 | ||
314 | print "buildzip: image=$image fonts=$fonts\n" if $verbose; | 314 | print "buildzip: image=$image fonts=$fonts\n" if $verbose; |
315 | 315 | ||
@@ -320,17 +320,17 @@ sub buildzip { | |||
320 | # print "Bitmap: $bitmap\nDepth: $depth\nSwcodec: $swcodec\n"; | 320 | # print "Bitmap: $bitmap\nDepth: $depth\nSwcodec: $swcodec\n"; |
321 | 321 | ||
322 | # remove old traces | 322 | # remove old traces |
323 | rmtree($rbdir); | 323 | rmtree($temp_dir); |
324 | 324 | ||
325 | glob_mkdir($rbdir); | 325 | glob_mkdir($temp_dir); |
326 | 326 | ||
327 | if(!$bitmap) { | 327 | if(!$bitmap) { |
328 | # always disable fonts on non-bitmap targets | 328 | # always disable fonts on non-bitmap targets |
329 | $fonts = 0; | 329 | $fonts = 0; |
330 | } | 330 | } |
331 | if($fonts) { | 331 | if($fonts) { |
332 | glob_mkdir("$rbdir/fonts"); | 332 | glob_mkdir("$temp_dir/fonts"); |
333 | chdir "$rbdir/fonts"; | 333 | chdir "$temp_dir/fonts"; |
334 | my $cmd = "$ROOT/tools/convbdf -f $ROOT/fonts/*bdf >/dev/null 2>&1"; | 334 | my $cmd = "$ROOT/tools/convbdf -f $ROOT/fonts/*bdf >/dev/null 2>&1"; |
335 | print($cmd."\n") if $verbose; | 335 | print($cmd."\n") if $verbose; |
336 | system($cmd); | 336 | system($cmd); |
@@ -343,30 +343,30 @@ sub buildzip { | |||
343 | } | 343 | } |
344 | 344 | ||
345 | # create the file so the database does not try indexing a folder | 345 | # create the file so the database does not try indexing a folder |
346 | open(IGNORE, ">$rbdir/database.ignore") || die "can't open database.ignore"; | 346 | open(IGNORE, ">$temp_dir/database.ignore") || die "can't open database.ignore"; |
347 | close(IGNORE); | 347 | close(IGNORE); |
348 | 348 | ||
349 | glob_mkdir("$rbdir/langs"); | 349 | glob_mkdir("$temp_dir/langs"); |
350 | glob_mkdir("$rbdir/rocks"); | 350 | glob_mkdir("$temp_dir/rocks"); |
351 | glob_mkdir("$rbdir/rocks/games"); | 351 | glob_mkdir("$temp_dir/rocks/games"); |
352 | glob_mkdir("$rbdir/rocks/apps"); | 352 | glob_mkdir("$temp_dir/rocks/apps"); |
353 | glob_mkdir("$rbdir/rocks/demos"); | 353 | glob_mkdir("$temp_dir/rocks/demos"); |
354 | glob_mkdir("$rbdir/rocks/viewers"); | 354 | glob_mkdir("$temp_dir/rocks/viewers"); |
355 | 355 | ||
356 | if ($recording) { | 356 | if ($recording) { |
357 | glob_mkdir("$rbdir/recpresets"); | 357 | glob_mkdir("$temp_dir/recpresets"); |
358 | } | 358 | } |
359 | 359 | ||
360 | if($swcodec) { | 360 | if($swcodec) { |
361 | glob_mkdir("$rbdir/eqs"); | 361 | glob_mkdir("$temp_dir/eqs"); |
362 | 362 | ||
363 | glob_copy("$ROOT/apps/eqs/*.cfg", "$rbdir/eqs/"); # equalizer presets | 363 | glob_copy("$ROOT/apps/eqs/*.cfg", "$temp_dir/eqs/"); # equalizer presets |
364 | } | 364 | } |
365 | 365 | ||
366 | glob_mkdir("$rbdir/wps"); | 366 | glob_mkdir("$temp_dir/wps"); |
367 | glob_mkdir("$rbdir/themes"); | 367 | glob_mkdir("$temp_dir/themes"); |
368 | if ($bitmap) { | 368 | if ($bitmap) { |
369 | open(THEME, ">$rbdir/themes/rockbox_default_icons.cfg"); | 369 | open(THEME, ">$temp_dir/themes/rockbox_default_icons.cfg"); |
370 | print THEME <<STOP | 370 | print THEME <<STOP |
371 | # this config file was auto-generated to make it | 371 | # this config file was auto-generated to make it |
372 | # easy to reset the icons back to default | 372 | # easy to reset the icons back to default |
@@ -382,7 +382,7 @@ STOP | |||
382 | close(THEME); | 382 | close(THEME); |
383 | } | 383 | } |
384 | 384 | ||
385 | glob_mkdir("$rbdir/codepages"); | 385 | glob_mkdir("$temp_dir/codepages"); |
386 | 386 | ||
387 | if($bitmap) { | 387 | if($bitmap) { |
388 | system("$ROOT/tools/codepages"); | 388 | system("$ROOT/tools/codepages"); |
@@ -391,28 +391,28 @@ STOP | |||
391 | system("$ROOT/tools/codepages -m"); | 391 | system("$ROOT/tools/codepages -m"); |
392 | } | 392 | } |
393 | 393 | ||
394 | glob_move('*.cp', "$rbdir/codepages/"); | 394 | glob_move('*.cp', "$temp_dir/codepages/"); |
395 | 395 | ||
396 | if($bitmap && $depth > 1) { | 396 | if($bitmap && $depth > 1) { |
397 | glob_mkdir("$rbdir/backdrops"); | 397 | glob_mkdir("$temp_dir/backdrops"); |
398 | } | 398 | } |
399 | 399 | ||
400 | glob_mkdir("$rbdir/codecs"); | 400 | glob_mkdir("$temp_dir/codecs"); |
401 | 401 | ||
402 | find(find_copyfile(qr/.*\.codec/, abs_path("$rbdir/codecs/")), 'apps/codecs'); | 402 | find(find_copyfile(qr/.*\.codec/, abs_path("$temp_dir/codecs/")), 'apps/codecs'); |
403 | 403 | ||
404 | # remove directory again if no codec was copied | 404 | # remove directory again if no codec was copied |
405 | rmdir("$rbdir/codecs"); | 405 | rmdir("$temp_dir/codecs"); |
406 | 406 | ||
407 | find(find_copyfile(qr/\.(rock|ovl|lua)/, abs_path("$rbdir/rocks/")), 'apps/plugins'); | 407 | find(find_copyfile(qr/\.(rock|ovl|lua)/, abs_path("$temp_dir/rocks/")), 'apps/plugins'); |
408 | 408 | ||
409 | open VIEWERS, "$ROOT/apps/plugins/viewers.config" or | 409 | open VIEWERS, "$ROOT/apps/plugins/viewers.config" or |
410 | die "can't open viewers.config"; | 410 | die "can't open viewers.config"; |
411 | my @viewers = <VIEWERS>; | 411 | my @viewers = <VIEWERS>; |
412 | close VIEWERS; | 412 | close VIEWERS; |
413 | 413 | ||
414 | open VIEWERS, ">$rbdir/viewers.config" or | 414 | open VIEWERS, ">$temp_dir/viewers.config" or |
415 | die "can't create $rbdir/viewers.config"; | 415 | die "can't create $temp_dir/viewers.config"; |
416 | 416 | ||
417 | foreach my $line (@viewers) { | 417 | foreach my $line (@viewers) { |
418 | if ($line =~ /([^,]*),([^,]*),/) { | 418 | if ($line =~ /([^,]*),([^,]*),/) { |
@@ -434,24 +434,24 @@ STOP | |||
434 | 434 | ||
435 | # print STDERR "$ext $plugin $dir $name $r\n"; | 435 | # print STDERR "$ext $plugin $dir $name $r\n"; |
436 | 436 | ||
437 | if(-e "$rbdir/rocks/$name") { | 437 | if(-e "$temp_dir/rocks/$name") { |
438 | if($dir ne "rocks") { | 438 | if($dir ne "rocks") { |
439 | # target is not 'rocks' but the plugins are always in that | 439 | # target is not 'rocks' but the plugins are always in that |
440 | # dir at first! | 440 | # dir at first! |
441 | move("$rbdir/rocks/$name", "$rbdir/rocks/$r"); | 441 | move("$temp_dir/rocks/$name", "$temp_dir/rocks/$r"); |
442 | } | 442 | } |
443 | print VIEWERS $line; | 443 | print VIEWERS $line; |
444 | } | 444 | } |
445 | elsif(-e "$rbdir/rocks/$r") { | 445 | elsif(-e "$temp_dir/rocks/$r") { |
446 | # in case the same plugin works for multiple extensions, it | 446 | # in case the same plugin works for multiple extensions, it |
447 | # was already moved to the viewers dir | 447 | # was already moved to the viewers dir |
448 | print VIEWERS $line; | 448 | print VIEWERS $line; |
449 | } | 449 | } |
450 | 450 | ||
451 | if(-e "$rbdir/rocks/$oname") { | 451 | if(-e "$temp_dir/rocks/$oname") { |
452 | # if there's an "overlay" file for the .rock, move that as | 452 | # if there's an "overlay" file for the .rock, move that as |
453 | # well | 453 | # well |
454 | move("$rbdir/rocks/$oname", "$rbdir/rocks/$dir"); | 454 | move("$temp_dir/rocks/$oname", "$temp_dir/rocks/$dir"); |
455 | } | 455 | } |
456 | } | 456 | } |
457 | } | 457 | } |
@@ -464,41 +464,41 @@ STOP | |||
464 | foreach my $line (@rock_targetdirs) { | 464 | foreach my $line (@rock_targetdirs) { |
465 | if ($line =~ /([^,]*),(.*)/) { | 465 | if ($line =~ /([^,]*),(.*)/) { |
466 | my ($plugin, $dir)=($1, $2); | 466 | my ($plugin, $dir)=($1, $2); |
467 | move("$rbdir/rocks/${plugin}.rock", "$rbdir/rocks/$dir/${plugin}.rock"); | 467 | move("$temp_dir/rocks/${plugin}.rock", "$temp_dir/rocks/$dir/${plugin}.rock"); |
468 | if(-e "$rbdir/rocks/${plugin}.ovl") { | 468 | if(-e "$temp_dir/rocks/${plugin}.ovl") { |
469 | # if there's an "overlay" file for the .rock, move that as | 469 | # if there's an "overlay" file for the .rock, move that as |
470 | # well | 470 | # well |
471 | move("$rbdir/rocks/${plugin}.ovl", "$rbdir/rocks/$dir"); | 471 | move("$temp_dir/rocks/${plugin}.ovl", "$temp_dir/rocks/$dir"); |
472 | } | 472 | } |
473 | if(-e "$rbdir/rocks/${plugin}.lua") { | 473 | if(-e "$temp_dir/rocks/${plugin}.lua") { |
474 | # if this is a lua script, move it to the appropriate dir | 474 | # if this is a lua script, move it to the appropriate dir |
475 | move("$rbdir/rocks/${plugin}.lua", "$rbdir/rocks/$dir/"); | 475 | move("$temp_dir/rocks/${plugin}.lua", "$temp_dir/rocks/$dir/"); |
476 | } | 476 | } |
477 | } | 477 | } |
478 | } | 478 | } |
479 | 479 | ||
480 | glob_unlink("$rbdir/rocks/*.lua"); # Clean up unwanted *.lua files (e.g. actions.lua, buttons.lua) | 480 | glob_unlink("$temp_dir/rocks/*.lua"); # Clean up unwanted *.lua files (e.g. actions.lua, buttons.lua) |
481 | 481 | ||
482 | if ($bitmap) { | 482 | if ($bitmap) { |
483 | glob_mkdir("$rbdir/icons"); | 483 | glob_mkdir("$temp_dir/icons"); |
484 | copy("$viewer_bmpdir/viewers.${icon_w}x${icon_h}x$depth.bmp", "$rbdir/icons/viewers.bmp"); | 484 | copy("$viewer_bmpdir/viewers.${icon_w}x${icon_h}x$depth.bmp", "$temp_dir/icons/viewers.bmp"); |
485 | if ($remote_depth) { | 485 | if ($remote_depth) { |
486 | copy("$viewer_bmpdir/remote_viewers.${remote_icon_w}x${remote_icon_h}x$remote_depth.bmp", "$rbdir/icons/remote_viewers.bmp"); | 486 | copy("$viewer_bmpdir/remote_viewers.${remote_icon_w}x${remote_icon_h}x$remote_depth.bmp", "$temp_dir/icons/remote_viewers.bmp"); |
487 | } | 487 | } |
488 | } | 488 | } |
489 | 489 | ||
490 | copy("$ROOT/apps/tagnavi.config", "$rbdir/"); | 490 | copy("$ROOT/apps/tagnavi.config", "$temp_dir/"); |
491 | copy("$ROOT/apps/plugins/disktidy.config", "$rbdir/rocks/apps/"); | 491 | copy("$ROOT/apps/plugins/disktidy.config", "$temp_dir/rocks/apps/"); |
492 | 492 | ||
493 | if($bitmap) { | 493 | if($bitmap) { |
494 | copy("$ROOT/apps/plugins/sokoban.levels", "$rbdir/rocks/games/sokoban.levels"); # sokoban levels | 494 | copy("$ROOT/apps/plugins/sokoban.levels", "$temp_dir/rocks/games/sokoban.levels"); # sokoban levels |
495 | copy("$ROOT/apps/plugins/snake2.levels", "$rbdir/rocks/games/snake2.levels"); # snake2 levels | 495 | copy("$ROOT/apps/plugins/snake2.levels", "$temp_dir/rocks/games/snake2.levels"); # snake2 levels |
496 | copy("$ROOT/apps/plugins/rockbox-fonts.config", "$rbdir/rocks/viewers/"); | 496 | copy("$ROOT/apps/plugins/rockbox-fonts.config", "$temp_dir/rocks/viewers/"); |
497 | } | 497 | } |
498 | 498 | ||
499 | if(-e "$rbdir/rocks/demos/pictureflow.rock") { | 499 | if(-e "$temp_dir/rocks/demos/pictureflow.rock") { |
500 | copy("$ROOT/apps/plugins/bitmaps/native/pictureflow_emptyslide.100x100x16.bmp", | 500 | copy("$ROOT/apps/plugins/bitmaps/native/pictureflow_emptyslide.100x100x16.bmp", |
501 | "$rbdir/rocks/demos/pictureflow_emptyslide.bmp"); | 501 | "$temp_dir/rocks/demos/pictureflow_emptyslide.bmp"); |
502 | my ($pf_logo); | 502 | my ($pf_logo); |
503 | if ($width < 200) { | 503 | if ($width < 200) { |
504 | $pf_logo = "pictureflow_logo.100x18x16.bmp"; | 504 | $pf_logo = "pictureflow_logo.100x18x16.bmp"; |
@@ -506,17 +506,17 @@ STOP | |||
506 | $pf_logo = "pictureflow_logo.193x34x16.bmp"; | 506 | $pf_logo = "pictureflow_logo.193x34x16.bmp"; |
507 | } | 507 | } |
508 | copy("$ROOT/apps/plugins/bitmaps/native/$pf_logo", | 508 | copy("$ROOT/apps/plugins/bitmaps/native/$pf_logo", |
509 | "$rbdir/rocks/demos/pictureflow_splash.bmp"); | 509 | "$temp_dir/rocks/demos/pictureflow_splash.bmp"); |
510 | 510 | ||
511 | } | 511 | } |
512 | 512 | ||
513 | if($image) { | 513 | if($image) { |
514 | # image is blank when this is a simulator | 514 | # image is blank when this is a simulator |
515 | if( filesize("rockbox.ucl") > 1000 ) { | 515 | if( filesize("rockbox.ucl") > 1000 ) { |
516 | copy("rockbox.ucl", "$rbdir/rockbox.ucl"); # UCL for flashing | 516 | copy("rockbox.ucl", "$temp_dir/rockbox.ucl"); # UCL for flashing |
517 | } | 517 | } |
518 | if( filesize("rombox.ucl") > 1000) { | 518 | if( filesize("rombox.ucl") > 1000) { |
519 | copy("rombox.ucl", "$rbdir/rombox.ucl"); # UCL for flashing | 519 | copy("rombox.ucl", "$temp_dir/rombox.ucl"); # UCL for flashing |
520 | } | 520 | } |
521 | 521 | ||
522 | # Check for rombox.target | 522 | # Check for rombox.target |
@@ -525,25 +525,25 @@ STOP | |||
525 | my $romfile = "rombox.$2"; | 525 | my $romfile = "rombox.$2"; |
526 | if (filesize($romfile) > 1000) | 526 | if (filesize($romfile) > 1000) |
527 | { | 527 | { |
528 | copy($romfile, "$rbdir/$romfile"); | 528 | copy($romfile, "$temp_dir/$romfile"); |
529 | } | 529 | } |
530 | } | 530 | } |
531 | } | 531 | } |
532 | 532 | ||
533 | glob_mkdir("$rbdir/docs"); | 533 | glob_mkdir("$temp_dir/docs"); |
534 | for(("COPYING", | 534 | for(("COPYING", |
535 | "LICENSES", | 535 | "LICENSES", |
536 | "KNOWN_ISSUES" | 536 | "KNOWN_ISSUES" |
537 | )) { | 537 | )) { |
538 | copy("$ROOT/docs/$_", "$rbdir/docs/$_.txt"); | 538 | copy("$ROOT/docs/$_", "$temp_dir/docs/$_.txt"); |
539 | } | 539 | } |
540 | if ($fonts) { | 540 | if ($fonts) { |
541 | copy("$ROOT/docs/profontdoc.txt", "$rbdir/docs/profontdoc.txt"); | 541 | copy("$ROOT/docs/profontdoc.txt", "$temp_dir/docs/profontdoc.txt"); |
542 | } | 542 | } |
543 | for(("sample.colours", | 543 | for(("sample.colours", |
544 | "sample.icons" | 544 | "sample.icons" |
545 | )) { | 545 | )) { |
546 | copy("$ROOT/docs/$_", "$rbdir/docs/$_"); | 546 | copy("$ROOT/docs/$_", "$temp_dir/docs/$_"); |
547 | } | 547 | } |
548 | 548 | ||
549 | # Now do the WPS dance | 549 | # Now do the WPS dance |
@@ -560,36 +560,36 @@ STOP | |||
560 | } | 560 | } |
561 | 561 | ||
562 | # until buildwps.pl is fixed, manually copy the classic_statusbar theme across | 562 | # until buildwps.pl is fixed, manually copy the classic_statusbar theme across |
563 | mkdir "$rbdir/wps/classic_statusbar", 0777; | 563 | mkdir "$temp_dir/wps/classic_statusbar", 0777; |
564 | glob_copy("$ROOT/wps/classic_statusbar/*.bmp", "$rbdir/wps/classic_statusbar"); | 564 | glob_copy("$ROOT/wps/classic_statusbar/*.bmp", "$temp_dir/wps/classic_statusbar"); |
565 | if ($swcodec) { | 565 | if ($swcodec) { |
566 | if ($depth == 16) { | 566 | if ($depth == 16) { |
567 | copy("$ROOT/wps/classic_statusbar.sbs", "$rbdir/wps"); | 567 | copy("$ROOT/wps/classic_statusbar.sbs", "$temp_dir/wps"); |
568 | } elsif ($depth > 1) { | 568 | } elsif ($depth > 1) { |
569 | copy("$ROOT/wps/classic_statusbar.grey.sbs", "$rbdir/wps/classic_statusbar.sbs"); | 569 | copy("$ROOT/wps/classic_statusbar.grey.sbs", "$temp_dir/wps/classic_statusbar.sbs"); |
570 | } else { | 570 | } else { |
571 | copy("$ROOT/wps/classic_statusbar.mono.sbs", "$rbdir/wps/classic_statusbar.sbs"); | 571 | copy("$ROOT/wps/classic_statusbar.mono.sbs", "$temp_dir/wps/classic_statusbar.sbs"); |
572 | } | 572 | } |
573 | } else { | 573 | } else { |
574 | copy("$ROOT/wps/classic_statusbar.112x64x1.sbs", "$rbdir/wps/classic_statusbar.sbs"); | 574 | copy("$ROOT/wps/classic_statusbar.112x64x1.sbs", "$temp_dir/wps/classic_statusbar.sbs"); |
575 | } | 575 | } |
576 | system("touch $rbdir/wps/rockbox_none.sbs"); | 576 | system("touch $temp_dir/wps/rockbox_none.sbs"); |
577 | if ($remote_depth != $depth) { | 577 | if ($remote_depth != $depth) { |
578 | copy("$ROOT/wps/classic_statusbar.mono.sbs", "$rbdir/wps/classic_statusbar.rsbs"); | 578 | copy("$ROOT/wps/classic_statusbar.mono.sbs", "$temp_dir/wps/classic_statusbar.rsbs"); |
579 | } else { | 579 | } else { |
580 | copy("$rbdir/wps/classic_statusbar.sbs", "$rbdir/wps/classic_statusbar.rsbs"); | 580 | copy("$temp_dir/wps/classic_statusbar.sbs", "$temp_dir/wps/classic_statusbar.rsbs"); |
581 | } | 581 | } |
582 | copy("$rbdir/wps/rockbox_none.sbs", "$rbdir/wps/rockbox_none.rsbs"); | 582 | copy("$temp_dir/wps/rockbox_none.sbs", "$temp_dir/wps/rockbox_none.rsbs"); |
583 | 583 | ||
584 | # and the info file | 584 | # and the info file |
585 | copy("rockbox-info.txt", "$rbdir/rockbox-info.txt"); | 585 | copy("rockbox-info.txt", "$temp_dir/rockbox-info.txt"); |
586 | 586 | ||
587 | # copy the already built lng files | 587 | # copy the already built lng files |
588 | glob_copy('apps/lang/*lng', "$rbdir/langs/"); | 588 | glob_copy('apps/lang/*lng', "$temp_dir/langs/"); |
589 | 589 | ||
590 | # copy the .lua files | 590 | # copy the .lua files |
591 | glob_mkdir("$rbdir/rocks/viewers/lua/"); | 591 | glob_mkdir("$temp_dir/rocks/viewers/lua/"); |
592 | glob_copy('apps/plugins/lua/*.lua', "$rbdir/rocks/viewers/lua/"); | 592 | glob_copy('apps/plugins/lua/*.lua', "$temp_dir/rocks/viewers/lua/"); |
593 | } | 593 | } |
594 | 594 | ||
595 | my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = | 595 | my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = |