diff options
author | Daniel Stenberg <daniel@haxx.se> | 2005-10-05 08:02:10 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2005-10-05 08:02:10 +0000 |
commit | af48260399151e575bc40c7a648e3a2e0037e04e (patch) | |
tree | d160abd09f39d08fcfe8c4b3d88fd7a6a91f5728 /tools/buildzip.pl | |
parent | 8dd2ff50c68d313af7fd559af6d8ee2ff2fe6d42 (diff) |
Modified the viewers.config syntax slightly. The name field should now include
path of the plugin/viewer on target, but exclude the exension. Now the Sudoku
plugin acts as a normal plugin and a viewer at the same time.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7582 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'tools/buildzip.pl')
-rwxr-xr-x | tools/buildzip.pl | 36 |
1 files changed, 26 insertions, 10 deletions
diff --git a/tools/buildzip.pl b/tools/buildzip.pl index b5e4435545..3d6a42137c 100755 --- a/tools/buildzip.pl +++ b/tools/buildzip.pl @@ -76,23 +76,39 @@ sub buildzip { open VIEWERS, ">.rockbox/viewers.config" or die "can't create .rockbox/viewers.config"; mkdir ".rockbox/viewers", 0777; - for (@viewers) { - if (/,(.+).rock,/) { - my $r = "$1.rock"; - my $o = "$1.ovl"; - if(-e ".rockbox/rocks/$r") { - `mv .rockbox/rocks/$r .rockbox/viewers`; - print VIEWERS $_; + foreach my $line (@viewers) { + if ($line =~ /([^,]*),([^,]*),/) { + my ($ext, $plugin)=($1, $2); + my $r = "${plugin}.rock"; + my $o = "${plugin}.ovl"; + + my $dir = $r; + my $name; + + # strip off the last slash and file name part + $dir =~ s/(.*)\/(.*)/$1/; + # store the file name part + $name = $2; + + # print STDERR "$ext $plugin $dir $name $r\n"; + + if(-e ".rockbox/rocks/$name") { + if($dir ne "rocks") { + # target is not 'rocks' but the plugins are always in that + # dir at first! + `mv .rockbox/rocks/$name .rockbox/$r`; + } + print VIEWERS $line; } - elsif(-e ".rockbox/viewers/$r") { + elsif(-e ".rockbox/$r") { # in case the same plugin works for multiple extensions, it # was already moved to the viewers dir - print VIEWERS $_; + print VIEWERS $line; } if(-e ".rockbox/rocks/$o") { # if there's an "overlay" file for the .rock, move that as # well - `mv .rockbox/rocks/$o .rockbox/viewers`; + `mv .rockbox/rocks/$o .rockbox/$o`; } } } |