2 # mailcap to elinks.conf converter (aka quick hack)
3 # version 1.00 by <grin@tolna.net>
4 # Released under GPLv2 or later
6 # Usage: mailcap-convert.pl /etc/mailcap >> ~/.elinks/elinks.conf
9 print "association \"-=BEGIN DEBIAN CONVERT=-\" \"\" \"\" 23 1\n";
13 @fields = split /;\s*/;
14 # change %s to % in the command
15 $fields[1] =~ s/%s/%/g;
17 my @out = ( "External association", $fields[0], $fields[1] );
19 for( my $i=2; $i<=$#fields; $i++ ) {
20 if( $fields[$i] =~ m/description="?([^"]+)"?/ ) {
23 } elsif( $fields[$i] =~ m/nametemplate=(.+)/ ) {
24 # extension for the mime type
26 $ext =~ s/%s\.(.+)$/$1/;
27 &new_ext
($ext,$fields[0]);
32 print "association \"-=END DEBIAN CONVERT=-\" \"\" \"\" 23 1\n";
38 print "\"$aref->[$i]\" ";