[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#661816: debian-policy: Do not call update-mime directly, since it is triggered by Dpkg.



Le Sun, Aug 12, 2012 at 05:53:15PM -0700, Jonathan Nieder a écrit :
> 
> dpkg-trigger was fixed to make
> 
> 	dpkg-trigger --no-await --by-package=<me> /usr/lib/mime/packages
> 
> do the right thing in version 1.16.4 (phew).  So my preference would be to
> document that packages wanting to manually make sure their addition to
> the mime database is reflected should trigger that path.

Hi Jonathan,

I am still not sure when a package should use it, that is, when a package
should create files in /usr/lib/mime/packages/ in its maintainer scripts.

Here is an updated patch which includes the dpkg-trigger in a command.

I also made other changes.

 1) I have removed mention of the MIME policy.  This is a leftover from
    its removal.

 2) Noticing that most if not all packages that place a file in
    /usr/lib/mime/packages/ use their binary package name as a file
    name, I documented this as a should.  Perhaps this is too much ?

 3) I documented that the way to register mime types is to place a
    mailcap-formated file in /usr/lib/mime/packages/.

 4) Cosmetic: I put a whole "should not" under emphasis, not only the "not"


Here is how the section 9.7 would read with this patch applied.


MIME (Multipurpose Internet Mail Extensions, RFCs 2045-2049) is a mechanism for
encoding files and data streams and providing meta-information about them, in
particular their type (e.g. audio or video) and format (e.g. PNG, HTML, MP3).

Registration of MIME type handlers allows programs like mail user agents and
web browsers to invoke these handlers to view, edit or display MIME types they
don't support directly.

Packages which provide programs to view/show/play, compose, edit or print MIME
types should register them as such by placing a file in mailcap format (RFC
1524) in the directory /usr/lib/mime/packages/. The file name should be the
binary package's name.

The mime-support package provides the update-mime program, which integrates
these registrations in the /etc/mailcap file, using Dpkg triggers[75]. Packages
using this facility should not depend on, recommend, or suggest mime-support.

[75]Creating, modifying or removing a file in /usr/lib/mime/packages/ using
maintainer scripts will not activate the trigger. In that case, it can be done
by calling dpkg-trigger --no-await --by-package=<me> /usr/lib/mime/packages,
where <me> is the name of the package.


Have a nice day,

-- 
Charles Plessy
Tsurumi, Kanagawa, Japan
>From b8c0097790951831202cbd28df8be8bbf223e272 Mon Sep 17 00:00:00 2001
From: Charles Plessy <plessy@debian.org>
Date: Thu, 1 Mar 2012 22:58:41 +0900
Subject: [PATCH] Do not call update-mime directly, since it is triggered by
 Dpkg.

Closes: 661816

This patch also:

 - Removes mention of the MIME policy.  This is a leftover from its removal.
 - Documents /usr/lib/mime/packages/, and recommends to use binary package
   names as a file names.
 - Cosmetically changes the emphasis on a "should not".
---
 policy.sgml |   38 ++++++++++++++++----------------------
 1 file changed, 16 insertions(+), 22 deletions(-)

diff --git a/policy.sgml b/policy.sgml
index 003675c..d209ce5 100644
--- a/policy.sgml
+++ b/policy.sgml
@@ -7515,33 +7515,27 @@ Reloading <var>description</var> configuration...done.
 	</p>
 
 	<p>
-	  Packages which provide the ability to view/show/play,
-	  compose, edit or print MIME types should register themselves
-	  as such following the current MIME support policy.
+	  Packages which provide programs to view/show/play, compose, edit or
+	  print MIME types should register them as such by placing a file in
+	  <manref name="mailcap" section="5"> format (RFC 1524) in the directory
+	  <file>/usr/lib/mime/packages/</file>.  The file name should be the
+	  binary package's name.
 	</p>
 
 	<p>
 	  The <package>mime-support</package> package provides the
-	  <prgn>update-mime</prgn> program which allows packages to
-	  register programs that can show, compose, edit or print
-	  MIME types.
-	</p>
-
-	<p>
-	  Packages containing such programs must register them
-	  with <prgn>update-mime</prgn> as documented in <manref
-	  name="update-mime" section="8">. They should <em>not</em> depend
-	  on, recommend, or suggest <prgn>mime-support</prgn>. Instead,
-	  they should just put something like the following in the
-	  <tt>postinst</tt> and <tt>postrm</tt> scripts:
-
-	  <example>
-  if [ -x /usr/sbin/update-mime ]; then
-      update-mime
-  fi
-	  </example>
+	  <prgn>update-mime</prgn> program, which integrates these
+	  registrations in the <file>/etc/mailcap</file> file, using Dpkg
+	  triggers<footnote>
+	    Creating, modifying or removing a file in
+	    <file>/usr/lib/mime/packages/</file> using maintainer scripts will
+	    not activate the trigger.  In that case, it can be done by calling
+	    <tt>dpkg-trigger --no-await --by-package=&lt;me&gt; /usr/lib/mime/packages</tt>,
+	    where <tt>&lt;me&gt;</tt> is the name of the package.
+	  </footnote>.
+	  Packages using this facility <em>should not</em> depend on,
+	  recommend, or suggest <prgn>mime-support</prgn>.
 	</p>
-
       </sect>
 
       <sect>
-- 
1.7.10


Reply to: