Don't copy too many files either. Wait with the copying until the WPS in question is known to be included.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@19829 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2009-01-23 20:46:49 +00:00
parent 08444b6a86
commit 34314b1993

View file

@ -191,7 +191,7 @@ sub copywps
if($wpslist =~ /(.*)WPSLIST/) { if($wpslist =~ /(.*)WPSLIST/) {
$dir = $1; $dir = $1;
# system("cp $dir/$wps .rockbox/wps/"); # system("cp $dir/$wps .rockbox/wps/");
# print "$req_t_wps $req_g_wps\n"; #print "$req_t_wps $req_g_wps\n";
if (-e "$dir/$req_t_wps" ) { if (-e "$dir/$req_t_wps" ) {
system("cp $dir/$req_t_wps $rbdir/wps/$wps"); system("cp $dir/$req_t_wps $rbdir/wps/$wps");
@ -302,7 +302,7 @@ MOO
($main_height, $main_width, $main_depth) = getlcdsizes(); ($main_height, $main_width, $main_depth) = getlcdsizes();
($remote_height, $remote_width, $remote_depth) = getlcdsizes(1); ($remote_height, $remote_width, $remote_depth) = getlcdsizes(1);
#print "LCD: ${main_height}x${main_width}x${main_depth}\n"; #print "LCD: ${main_width}x${main_height}x${main_depth}\n";
$has_remote = 1 if ($remote_height && $remote_width && $remote_depth); $has_remote = 1 if ($remote_height && $remote_width && $remote_depth);
my $isrwps; my $isrwps;
@ -366,9 +366,9 @@ while(<WPS>) {
} }
$wpslist =~ /(.*)WPSLIST/; $wpslist =~ /(.*)WPSLIST/;
my $wpsdir = $1; my $wpsdir = $1;
# If this WPS installable on this platform, one of the following # If this WPS installable on this platform, one of the following
# two files will be present # two files will be present
foreach my $d (@depthlist) { foreach my $d (@depthlist) {
next if ($d > $rdepth); next if ($d > $rdepth);
$req_g = $rwidth . "x" . $rheight . "x" . $d; $req_g = $rwidth . "x" . $rheight . "x" . $d;
@ -385,8 +385,8 @@ while(<WPS>) {
} }
$req_t_wps = $wps_prefix . ".txt" . ".wps"; $req_t_wps = $wps_prefix . ".txt" . ".wps";
#print "LCD: $wps wants $height x $width\n"; #print "LCD: $wps wants $width x $height\n";
#print "LCD: is $rheight x $rwidth\n"; #print "LCD: is $rwidth x $rheight\n";
#print "gwps: $wpsdir/$req_g_wps" . "\n"; #print "gwps: $wpsdir/$req_g_wps" . "\n";
if (-e "$wpsdir/$req_g_wps" || -e "$wpsdir/$req_t_wps" ) { if (-e "$wpsdir/$req_g_wps" || -e "$wpsdir/$req_t_wps" ) {
@ -396,6 +396,20 @@ while(<WPS>) {
# #
#print "Size requirement is fine!\n"; #print "Size requirement is fine!\n";
mkdirs() if (-e "$wpsdir/$req_g_wps"); mkdirs() if (-e "$wpsdir/$req_g_wps");
# Do the copying before building the .cfg - buildcfg()
# mangles some filenames
if ($backdrop) {
copybackdrop();
}
if ($iconset) {
copythemeicon();
}
if ($viewericon) {
copythemeviewericon();
}
if ($font) {
copythemefont();
}
if(!$isrwps) { if(!$isrwps) {
# We only make .cfg files for <wps> sections: # We only make .cfg files for <wps> sections:
buildcfg(); buildcfg();
@ -413,7 +427,7 @@ while(<WPS>) {
# name of the rwps. Use $isrwps to figure out what type it is. # name of the rwps. Use $isrwps to figure out what type it is.
$wps = $wps_prefix = $1; $wps = $wps_prefix = $1;
$wps_prefix =~ s/\.(r|)wps//; $wps_prefix =~ s/\.(r|)wps//;
# print $wps_prefix . "\n"; #print $wps_prefix . "\n";
} }
elsif($l =~ /^RWPS: *(.*)/i) { elsif($l =~ /^RWPS: *(.*)/i) {
$rwps = $1; $rwps = $1;
@ -438,7 +452,9 @@ while(<WPS>) {
} }
elsif($l =~ /^Font: *(.*)/i) { elsif($l =~ /^Font: *(.*)/i) {
$font = $1; $font = $1;
copythemefont(); }
elsif($l =~ /^Font\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
$font = $1;
} }
elsif($l =~ /^Foreground Color: *(.*)/i) { elsif($l =~ /^Foreground Color: *(.*)/i) {
$fgcolor = $1; $fgcolor = $1;
@ -446,10 +462,6 @@ while(<WPS>) {
elsif($l =~ /^Background Color: *(.*)/i) { elsif($l =~ /^Background Color: *(.*)/i) {
$bgcolor = $1; $bgcolor = $1;
} }
elsif($l =~ /^Font\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
$font = $1;
copythemefont();
}
elsif($l =~ /^Statusbar: *(.*)/i) { elsif($l =~ /^Statusbar: *(.*)/i) {
$statusbar = $1; $statusbar = $1;
} }
@ -458,11 +470,9 @@ while(<WPS>) {
} }
elsif($l =~ /^Backdrop: *(.*)/i) { elsif($l =~ /^Backdrop: *(.*)/i) {
$backdrop = $1; $backdrop = $1;
copybackdrop();
} }
elsif($l =~ /^Backdrop\.${main_width}x${main_height}x$main_depth: *(.*)/i) { elsif($l =~ /^Backdrop\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
$backdrop = $1; $backdrop = $1;
copybackdrop();
} }
elsif($l =~ /^line selector start color: *(.*)/i) { elsif($l =~ /^line selector start color: *(.*)/i) {
$lineselectstart = $1; $lineselectstart = $1;
@ -478,19 +488,15 @@ while(<WPS>) {
} }
elsif($l =~ /^iconset: *(.*)/i) { elsif($l =~ /^iconset: *(.*)/i) {
$iconset = $1; $iconset = $1;
copythemeicon();
} }
elsif($l =~ /^iconset\.${main_width}x${main_height}x$main_depth: *(.*)/i) { elsif($l =~ /^iconset\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
$iconset = $1; $iconset = $1;
copythemeicon();
} }
elsif($l =~ /^viewers iconset: *(.*)/i) { elsif($l =~ /^viewers iconset: *(.*)/i) {
$viewericon = $1; $viewericon = $1;
copythemeviewericon();
} }
elsif($l =~ /^viewers iconset\.${main_width}x${main_height}x$main_depth: *(.*)/i) { elsif($l =~ /^viewers iconset\.${main_width}x${main_height}x$main_depth: *(.*)/i) {
$viewericon = $1; $viewericon = $1;
copythemeviewericon();
} }
elsif($l =~ /^line selector text color: *(.*)/i) { elsif($l =~ /^line selector text color: *(.*)/i) {
$lineselecttextcolor = $1; $lineselecttextcolor = $1;