]> git.pld-linux.org Git - packages/mailcap.git/commitdiff
- rel. 4; updated run-mailcap and manpages from Debian's mime-support 3.48 auto/th/mailcap-2_3-4
authorTomasz Pala <gotar@pld-linux.org>
Sat, 27 Mar 2010 19:01:28 +0000 (19:01 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    mailcap.4 -> 1.2
    mailcap.spec -> 1.61
    run-mailcap -> 1.5
    run-mailcap.man -> 1.2

mailcap.4
mailcap.spec
run-mailcap
run-mailcap.man

index f0abbce9c72421dfc733fc89e7c03310d4055c65..3ca20efde53e5b0fcbdc95daae3a00afb0671053 100644 (file)
--- a/mailcap.4
+++ b/mailcap.4
@@ -1,4 +1,5 @@
-.TH MAILCAP 4 "Release 2" "Bellcore Prototype"
+.\" Hey, Emacs!  This is an -*- nroff -*- source file.
+.TH MAILCAP 5 "Release 2" "Bellcore Prototype"
 .SH NAME
 mailcap - metamail capabilities file
 .SH DESCRIPTION
@@ -20,13 +21,9 @@ text/plain; cat %s; copiousoutput
 
 can be used to indicate that the output of the 'cat' command may be voluminous, requiring either a scrolling window, a pager, or some other appropriate coping mechanism.
 
-The "type" field (text/plain, in the above example) is simply any legal content type name, as defined by RFC 822.  In practice, this is almost any string.  It is the string that will be matched against the "Content-type" header (or the value passed in with -c) to decide if this is the mailcap entry that matches the current message.  Additionally, the type field may specify a subtype (e.g. "text/ISO-8859-1") or a wildcard to match all subtypes (e.g. "image/*").
+The "type" field (text/plain, in the above example) is simply any legal content type name, as defined by informational RFC 1524.  In practice, this is almost any string.  It is the string that will be matched against the "Content-type" header (or the value passed in with -c) to decide if this is the mailcap entry that matches the current message.  Additionally, the type field may specify a subtype (e.g. "text/ISO-8859-1") or a wildcard to match all subtypes (e.g. "image/*").
 
-The "command" field is any UNIX command ("cat %s" in the above example), and is used to specify the interpreter for the given type of message.  It will be passed to the shell via the system(3) facility.  Semicolons and backslashes within the command must be quoted with backslashes.  If the command contains "%s", those two characters will be replaced by the name of a file that contains the body of the message. If it contains "%t', those two characters will be replaced by the content-type field, including the subtype, if any.  (That is, if the content-type was "image/pbm; opt1=something-else", then "%t" would be replaced by "image/pbm".)   If the command field contains  "%{" followed by a parameter name and a closing "}", then all those characters will be replaced by the value of the named parameter, if any, from the Content-type header.   Thus, in the previous example, "%{opt1}" will be replaced by "something-else".  Finally, if the command contains "\%", those two characters will be replaced by a single % ch
-
-
-
-aracter.  (In fact, the backslash can be used to quote any character, including itself.)
+The "command" field is any UNIX command ("cat %s" in the above example), and is used to specify the interpreter for the given type of message.  It will be passed to the shell via the system(3) facility.  Semicolons and backslashes within the command must be quoted with backslashes.  If the command contains "%s", those two characters will be replaced by the name of a file that contains the body of the message. If it contains "%t", those two characters will be replaced by the content-type field, including the subtype, if any.  (That is, if the content-type was "image/pbm; opt1=something-else", then "%t" would be replaced by "image/pbm".)   If the command field contains  "%{" followed by a parameter name and a closing "}", then all those characters will be replaced by the value of the named parameter, if any, from the Content-type header.   Thus, in the previous example, "%{opt1}" will be replaced by "something-else".  Finally, if the command contains "\\%", those two characters will be replaced by a single % character.  (In fact, the backslash can be used to quote any character, including itself.)
 
 If no "%s" appears in the command field, then instead of placing the message body in a temporary file, metamail will pass the body to the command on the standard input.  This is helpful in saving /tmp file space, but can be problematic for window-oriented applications under some window systems such as MGR.
 
@@ -53,9 +50,10 @@ This flag should be given whenever the interpreter is capable of producing more
 .SH BUILT-IN CONTENT-TYPE SUPPORT
 The metamail program has built-in support for a few key content-types.  In particular, it supports the text type, the multipart and multipart/alternative type, and the message/rfc822 types.  This support is incomplete for many subtypes -- for example, it only supports US-ASCII text in general.  This kind of built-in support can be OVERRIDDEN by an entry in any mailcap file on the user's search path.  Metamail also has rudimentary built-in support for types that are totally unrecognized -- i.e. for which no mailcap entry or built-in handler exists.  For such unrecognized types, metamail will write a file with a "clean" copy of the data -- i.e. a copy in which all mail headers have been removed, and in which any 7-bit transport encoding has been decoded.
 .SH FILES
-$HOME/.mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap -- default path for mailcap files.
+$HOME/.mailcap:/etc/mailcap:/usr/share/etc/mailcap:/usr/local/etc/mailcap -- default path for mailcap files.
 .SH SEE ALSO
-metamail(1)
+.BR run-mailcap "(1)",
+.BR update-mime-database "(1)"
 .SH COPYRIGHT
 Copyright (c) 1991 Bell Communications Research, Inc. (Bellcore)
 
index c864a3952401c85c46f4a90d12fff0c473da9040..ce79b81fba6ef71fc9193c90121a483323463d8f 100644 (file)
@@ -12,7 +12,7 @@ Summary(pt_BR.UTF-8): Define aplicações auxiliares multimídia para vários pr
 Summary(tr.UTF-8):     Çeşitli programlar için çokluortam yardımcı uygulamaları tanımlar
 Name:          mailcap
 Version:       2.3
-Release:       3
+Release:       4
 License:       Public Domain
 Group:         Base
 Source0:       https://fedorahosted.org/released/mailcap/mailcap-%{fcver}.tar.gz
index c8d7c2e5464b6f3f5caca3d9acfc2fc1b96345db..851cd133c0a2b2ac8f149c041909c878d2315660 100644 (file)
@@ -11,6 +11,8 @@
 
 
 $debug=0;
+$norun=0;
+$pager=0;
 $etcmimetyp="/etc/mime.types";
 $shrmimetyp="/usr/share/etc/mime.types";
 $locmimetyp="/usr/local/etc/mime.types";
@@ -39,6 +41,8 @@ sub Usage {
     print STDERR "Options:\n";
     print STDERR "  action        specify what action to do on these files (default=view)\n";
     print STDERR "  debug         be verbose about what's going on\n";
+    print STDERR "  pager         ignore any \"copiousoutput\" directives and use a \"pager\"\n";
+    print STDERR "  norun         just print but don't execute the command (useful with --debug)\n";
     print STDERR "\n";
     print STDERR "Mime-Type:\n";
     print STDERR "  any standard mime type designation in the form <class>/<subtype> -- if\n";
@@ -357,6 +361,7 @@ foreach (@ARGV) {
 unless ($action) {
        if ($0 =~ m!(^|/)view$!)     { $action="view";   }
     elsif ($0 =~ m!(^|/)see$!)      { $action="view";   }
+    elsif ($0 =~ m!(^|/)cat$!)      { $action="cat";    }
     elsif ($0 =~ m!(^|/)edit$!)     { $action="edit";   }
     elsif ($0 =~ m!(^|/)change$!)   { $action="edit";   }
     elsif ($0 =~ m!(^|/)compose$!)  { $action="compose";}
@@ -420,14 +425,14 @@ foreach (@files) {
         $_ = "\Q$1\E"; s/\\\*/\.\*/g;
         push @matches,$entry if ($type =~ m!^$_$!i);
     }
-    @matches = grep(/\Q$action\E=/,@matches) unless $action eq "view";
+    @matches = grep(/\Q$action\E=/,@matches) unless ($action eq "view" || $action eq "cat");
 
     my $done=0;
     my $fail=0;
     foreach $match (@matches) {
         my $comm;
         print STDERR " - checking mailcap entry \"$match\"\n" if $debug;
-        if ($action eq "view") {
+        if ($action eq "view" || $action eq "cat") {
             ($comm) = ($match =~ m/^.*?;\s*(.*?)\s*($|;)/);
         } else {
             ($comm) = ($match =~ m/\Q$action\E=(.*?)\s*($|;)/);
@@ -435,17 +440,11 @@ foreach (@files) {
         next if (!$comm || $comm =~ m!(^|/)false$!i);
         print STDERR " - program to execute: $comm\n" if $debug;
 
-        if ($match =~ m/;\s*test=(.*?)\s*($|;)/) {
-            my $test;
-            print STDERR " - running test: $1 " if $debug;
-            $test   = system "$1 >/dev/null 2>&1";
-            $test >>= 8;
-            print STDERR " (result=$test=",($test!=0?"false":"true"),")\n" if $debug;
-            if ($test) {
-                $fail++;
-                next;
-            }
-        }
+       if ($action eq 'cat' && $match !~ m/;\s*copiousoutput\s*($|;)/) {
+           print STDERR " - \"copiousoutput\" is required for \"cat\" action\n" if $debug;
+           $fail++;
+           next;
+       }
 
         my($tmpfile,$tmplink);
         if ($action ne 'print' && $match =~ m/;\s*needsterminal\s*($|;)/ && ! -t STDOUT) {
@@ -456,6 +455,20 @@ foreach (@files) {
                 $fail++;
                 next;
             }
+        } elsif ($action eq 'view' && $pager && $match =~ m/;\s*copiousoutput\s*($|;)/ && $type ne 'text/plain') {
+            $comm .= " | $0 --action=$action text/plain:-";
+        }
+
+        if ($match =~ m/;\s*test=(.*?)\s*($|;)/) {
+            my $test;
+            print STDERR " - running test: $1 " if $debug;
+            $test   = system "$1 >/dev/null 2>&1";
+            $test >>= 8;
+            print STDERR " (result=$test=",($test!=0?"false":"true"),")\n" if $debug;
+            if ($test) {
+                $fail++;
+                next;
+            }
         }
 
         if ($file ne "-") {
@@ -508,8 +521,13 @@ foreach (@files) {
         $comm =~ s!$quotedprct!%!go;
 
         print STDERR " - executing: $comm\n" if $debug;
-        $res = system $comm;
-        $res = int($res/256);
+       if ($norun) {
+           print $comm,"\n";
+           $res = 0;
+       } else {
+           $res = system $comm;
+           $res = int($res/256);
+       }
         if ($res != 0) {
             print STDERR "Warning: program returned non-zero exit code \#$res\n";
             $retcode = $res;
index fb024457701f2d82bf0a65658e667b61e9bd26f0..c7dfc3b61ddc242746ca410cf49b90fef0c128e5 100644 (file)
@@ -9,7 +9,7 @@ run-mailcap, view, see, edit, compose, print \- execute programs via entries in
 file
 .SH SYNOPSIS
 .B run-mailcap
-\-\-action=ACTION [\-\-debug]
+\-\-action=ACTION [\-\-option[=value]]
 [MIME-TYPE:[ENCODING:]]FILE [...]
 
 The
@@ -57,6 +57,8 @@ All options are in the form --<opt>=<value>.
 .BI \-\-action=<action>
 Performs the specified action on the files.  Valid actions are
 .IR view ,
+.IR cat
+(like view but never paged) ,
 .IR compose ,
 .IR composetyped ,
 .I edit
@@ -65,9 +67,14 @@ and
 If no action is specified, the action will be determined by how the
 program was called.
 .TP
-.BI \-\-debug=<value>
-Turns on extra information to find out what is happening.  Any value
-other than zero (0) will turn on debugging output.
+.BI \-\-debug
+Turns on extra information to find out what is happening.
+.TP
+.BI \-\-nopager
+Ignores any "copiousoutput" directive and sends output to STDOUT.
+.TP
+.BI \-\-norun
+Displays the found command without actually executing it.
 .SH "SEE ALSO"
 .BR update-mime "(8)"
 .SH AUTHOR
This page took 0.127314 seconds and 4 git commands to generate.