ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Vitaly Ostanin <vyt@vzljot.ru>
To: ALT Devel discussion list <devel@altlinux.ru>
Subject: [devel] Re: mime.types
Date: Tue, 01 Mar 2005 11:00:00 +0300
Message-ID: <42242100.6010105@vzljot.ru> (raw)
In-Reply-To: <1109608528.10963.128.camel@siver.home>


[-- Attachment #1.1: Type: text/plain, Size: 1125 bytes --]

Yuri N. Sedunov пишет:
> В Пнд, 28/02/2005 в 19:28 +0300, Vitaly Ostanin пишет:
>
>>Dmitry V. Levin пишет:
>>
>>>On Mon, Feb 28, 2005 at 06:33:08PM +0300, Yuri N. Sedunov wrote:
>>>
>>>
>>>>В Пнд, 28/02/2005 в 18:22 +0300, Dmitry V. Levin пишет:
>>>
>>>[...]
>>>
>>>
>>>>>Если это так, то для того, чтобы использовать shared-mime-info
>>>>>в качестве основного механизма, update-mime-database(1) должен ещё и
>>>>>делать нечто аналогичное update-mime(8).
>>>>
>>>>Для начала можно и так. Важно иметь в системе один первичный источник
>>>>информации о MIME-типах.
>>>
>>>
>>>Может, такой фильтр (из shared-mime-info в mailcap) уже существует?
>>
>>Если нужно, завтра пришлю xslt-стиль для такого фильтра.
>
> Так точно, нужно. Подтверждаю информацию, полученную тобой по
> телепатическому каналу связи.

Высылаю стиль, полученный аналогичным способом :)

xsltproc --nonet mailcap.xsl
/usr/share/mime/packages/freedesktop.org.xml > mime.types.temp

В аттаче diff между отсортированным /etc/mime.types и
mime.types.temp - довольно существенная разница.

<skipped/>

--
Regards, Vyt
mailto:  vyt@vzljot.ru
JID:     vyt@vzljot.ru

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: mailcap.xsl --]
[-- Type: text/xml; name="mailcap.xsl", Size: 2332 bytes --]

<?xml version='1.0' encoding="windows-1251"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:m="http://www.freedesktop.org/standards/shared-mime-info"
                version='1.0'>

<!-- $Id$ -->

<!--
     Stylesheet for translate shared-mime-info data to mailcap text format
     Author: Vitaly Ostanin <vyt@altlinux.ru>
     -->

<xsl:output method="text" encoding="utf8" indent="yes"/>

<xsl:param name="output.locales.xml">battstat.schemas.locales.xml</xsl:param>

<!-- Êîïèðóåì âñå àòðèáóòû, êîììåíòàðèè è èíñòðóêöèè îáðàáîòêè -->
<xsl:template match="/">
  <xsl:text><![CDATA[# This is the mime.types file from the Apache web server distribution (1.3.22)
# with local modifications.

# This file controls what Internet media types are sent to the client for
# given file extension(s).  Sending the correct media type to the client
# is important so they know how to handle the content of the file.
# Extra types can either be added here or by using an AddType directive
# in your config files. For more information about Internet media types,
# please read RFC 2045, 2046, 2047, 2048, and 2077.  The Internet media type
# registry is at <ftp://ftp.iana.org/in-notes/iana/assignments/media-types/>.

# MIME type                     Extension
]]>
</xsl:text>
<xsl:apply-templates select="//m:mime-type"/>
</xsl:template>

<xsl:template match="m:mime-type">
  <!-- print main type -->
  <xsl:value-of select="@type"/>
  <xsl:call-template name="glob-list">
    <xsl:with-param name="type" select="."/>
  </xsl:call-template>
  <!-- print aliases type -->
  <xsl:for-each select="m:alias">
    <xsl:value-of select="@type"/>
    <xsl:call-template name="glob-list">
      <xsl:with-param name="type" select=".."/>
    </xsl:call-template>
  </xsl:for-each>
</xsl:template>

<xsl:template name="glob-list">
  <xsl:param name="type"/>
  <!-- insert TAB before first glob -->
  <xsl:if test="$type/m:glob">
    <xsl:text>&#9;</xsl:text>
    <xsl:value-of select="substring-after($type/m:glob/@pattern,'*.')"/>
  </xsl:if>
  <!-- insert other globs, space separated -->
  <xsl:for-each select="$type/m:glob[position()>1]">
    <xsl:text> </xsl:text>
    <xsl:value-of select="substring-after(@pattern,'*.')"/>
  </xsl:for-each>
  <xsl:text>&#10;</xsl:text>
</xsl:template>

</xsl:stylesheet>

[-- Attachment #1.3: mailcap2sharedmime.diff.bz2 --]
[-- Type: application/x-bzip, Size: 6257 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]

  parent reply	other threads:[~2005-03-01  8:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-27 22:31 [devel] Êòî äîëæåí îòâå÷àòü çà ôàéë mime.types Volkov Serge
2005-02-28  6:11 ` [devel] mime.types Michael Shigorin
2005-02-28  9:00   ` vserge
2005-02-28 11:29     ` Michael Shigorin
2005-02-28 12:36       ` Dmitry V. Levin
2005-02-28 12:50         ` vserge
2005-02-28 12:55         ` Yuri N. Sedunov
2005-02-28 15:22           ` Dmitry V. Levin
2005-02-28 15:33             ` Yuri N. Sedunov
2005-02-28 15:44               ` Dmitry V. Levin
2005-02-28 16:28                 ` Vitaly Ostanin
2005-02-28 16:35                   ` Yuri N. Sedunov
2005-03-01  7:09                     ` vserge
2005-03-01  8:00                     ` Vitaly Ostanin [this message]
2005-03-01  8:16                       ` Vitaly Ostanin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42242100.6010105@vzljot.ru \
    --to=vyt@vzljot.ru \
    --cc=devel@altlinux.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git