summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-10-05 08:02:10 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-10-05 08:02:10 +0000
commitaf48260399151e575bc40c7a648e3a2e0037e04e (patch)
treed160abd09f39d08fcfe8c4b3d88fd7a6a91f5728
parent8dd2ff50c68d313af7fd559af6d8ee2ff2fe6d42 (diff)
downloadrockbox-af48260399151e575bc40c7a648e3a2e0037e04e.zip
rockbox-af48260399151e575bc40c7a648e3a2e0037e04e.tar.gz
rockbox-af48260399151e575bc40c7a648e3a2e0037e04e.tar.bz2
rockbox-af48260399151e575bc40c7a648e3a2e0037e04e.tar.xz
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
-rw-r--r--apps/filetypes.c6
-rw-r--r--apps/plugins/viewers.config33
-rwxr-xr-xtools/buildzip.pl36
3 files changed, 47 insertions, 28 deletions
diff --git a/apps/filetypes.c b/apps/filetypes.c
index 721d532..9235e22 100644
--- a/apps/filetypes.c
+++ b/apps/filetypes.c
@@ -188,7 +188,7 @@ char* filetype_get_plugin(const struct entry* file)
return NULL;
snprintf(plugin_name, sizeof(plugin_name),
- VIEWERS_DIR "/%s.rock",filetypes[ix].plugin);
+ "%s/%s.rock", ROCKBOX_DIR, filetypes[ix].plugin);
return plugin_name;
}
@@ -453,9 +453,13 @@ static int add_plugin(char *plugin)
if (!plugin)
return 0;
+#if 0
+ /* starting now, Oct 2005, the plugins are given without extension in the
+ viewers.config file */
cp=strrchr(plugin, '.');
if (cp)
*cp='\0';
+#endif
for (i=first_soft_filetype; i < cnt_filetypes; i++)
{
diff --git a/apps/plugins/viewers.config b/apps/plugins/viewers.config
index da8b086..b29835e 100644
--- a/apps/plugins/viewers.config
+++ b/apps/plugins/viewers.config
@@ -1,17 +1,16 @@
-ch8,chip8.rock,70 70 7f 7f 70 70
-txt,viewer.rock,55 55 55 55 55 55
-nfo,viewer.rock,55 55 55 55 55 55
-jpg,jpeg.rock,18 24 3C 3C 24 18
-ucl,rockbox_flash.rock,2A 7F 41 41 7F 2A
-rvf,video.rock,5D 7F 5D 7F 5D 7F
-mp3,vbrfix.rock,10 08 58 38 04 02
-m3u,search.rock,00 00 00 00 00 00
-txt,sort.rock, 00 00 00 00 00 00
-gb,rockboy.rock, 0C 2A 59 7A 2E 0C
-gbc,rockboy.rock, 0C 2A 59 7A 2E 0C
-m3u,iriverify.rock,00 00 00 00 00 00
-mid,midi2wav.rock, 20 70 70 3F 00 00
-rsp,searchengine.rock, 0e 11 11 31 7e 60
-ss,sudoku.rock, 55 55 55 55 55 55
-wav,wav2wv.rock, 00 00 00 00 00 00
-
+ch8,viewers/chip8,70 70 7f 7f 70 70
+txt,viewers/viewer,55 55 55 55 55 55
+nfo,viewers/viewer,55 55 55 55 55 55
+jpg,viewers/jpeg,18 24 3C 3C 24 18
+ucl,viewers/rockbox_flash,2A 7F 41 41 7F 2A
+rvf,viewers/video,5D 7F 5D 7F 5D 7F
+mp3,viewers/vbrfix,10 08 58 38 04 02
+m3u,viewers/search,00 00 00 00 00 00
+txt,viewers/sort, 00 00 00 00 00 00
+gb,viewers/rockboy, 0C 2A 59 7A 2E 0C
+gbc,viewers/rockboy, 0C 2A 59 7A 2E 0C
+m3u,viewers/iriverify,00 00 00 00 00 00
+mid,viewers/midi2wav, 20 70 70 3F 00 00
+rsp,viewers/searchengine, 0e 11 11 31 7e 60
+ss,rocks/sudoku, 55 55 55 55 55 55
+wav,viewers/wav2wv, 00 00 00 00 00 00
diff --git a/tools/buildzip.pl b/tools/buildzip.pl
index b5e4435..3d6a421 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`;
}
}
}