← Back to team overview

desktop-packages team mailing list archive

[Bug 1485217] Re: Magic for text/x-tex broken

 

The bug is now fixed in Debian upstream (revision 378, thanks to user "slomo"):
http://anonscm.debian.org/viewvc/pkg-freedesktop/trunk/shared-mime-info/debian/patches/061_tex-matlab.patch?view=log

It is not (and probably never was) present in the Freedesktop sources:
http://cgit.freedesktop.org/xdg/shared-mime-info/tree/freedesktop.org.xml.in

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to shared-mime-info in Ubuntu.
https://bugs.launchpad.net/bugs/1485217

Title:
  Magic for text/x-tex broken

Status in shared-mime-info package in Ubuntu:
  Incomplete

Bug description:
  The magic for text/x-tex in Ubuntu 15.04 is broken as it assigns
  text/x-tex to any text file which contains the word "section",
  "chapter" or "documentclass" within the first 100 characters.

  This behavior is fixed if one adds backslashes to the appropriate
  match values in /usr/share/mime/packages/freedesktop.org.xml (.in)
  (see attached patch).

  Edit: You can reproduce this bug as follows.

  Is (output on Ubuntu 15.04):
  user@host:/tmp/mime$ dpkg -s shared-mime-info | grep "Version"
  Version: 1.3-1
  user@host:/tmp/mime$ sed '30568,30638!d' /usr/share/mime/packages/freedesktop.org.xml
    <mime-type type="text/x-tex">
      <comment>TeX document</comment>
      <comment xml:lang="ar">مستند TeX</comment>
      <comment xml:lang="be@latin">Dakument TeX</comment>
      <comment xml:lang="bg">Документ — TeX</comment>
      <comment xml:lang="ca">document TeX</comment>
      <comment xml:lang="cs">Dokument TeX</comment>
      <comment xml:lang="cy">Dogfen TeX </comment>
      <comment xml:lang="da">TeX-dokument</comment>
      <comment xml:lang="de">TeX-Dokument</comment>
      <comment xml:lang="el">έγγραφο TeX</comment>
      <comment xml:lang="en_GB">TeX document</comment>
      <comment xml:lang="eo">TeX-dokumento</comment>
      <comment xml:lang="es">documento TeX</comment>
      <comment xml:lang="eu">TeX dokumentua</comment>
      <comment xml:lang="fi">TeX-asiakirja</comment>
      <comment xml:lang="fo">TeX skjal</comment>
      <comment xml:lang="fr">document TeX</comment>
      <comment xml:lang="ga">cáipéis TeX</comment>
      <comment xml:lang="gl">documenton TeX</comment>
      <comment xml:lang="he">מסמך TeX</comment>
      <comment xml:lang="hr">TeX dokument</comment>
      <comment xml:lang="hu">TeX-dokumentum</comment>
      <comment xml:lang="id">Dokumen TeX</comment>
      <comment xml:lang="it">Documento TeX</comment>
      <comment xml:lang="ja">TeX ドキュメント</comment>
      <comment xml:lang="kk">TeX құжаты</comment>
      <comment xml:lang="ko">TeX 문서</comment>
      <comment xml:lang="lt">TeX dokumentas</comment>
      <comment xml:lang="lv">TeX dokuments</comment>
      <comment xml:lang="ms">Dokumen TeX</comment>
      <comment xml:lang="nb">TeX-dokument</comment>
      <comment xml:lang="nl">TeX-document</comment>
      <comment xml:lang="nn">TeX-dokument</comment>
      <comment xml:lang="pl">Dokument TeX</comment>
      <comment xml:lang="pt">documento TeX</comment>
      <comment xml:lang="pt_BR">Documento TeX</comment>
      <comment xml:lang="ro">Document TeX</comment>
      <comment xml:lang="ru">документ TeX</comment>
      <comment xml:lang="sk">Dokument TeX</comment>
      <comment xml:lang="sl">Dokument TeX</comment>
      <comment xml:lang="sq">Dokument TeX</comment>
      <comment xml:lang="sr">ТеХ документ</comment>
      <comment xml:lang="sv">TeX-dokument</comment>
      <comment xml:lang="tr">TeX belgesi</comment>
      <comment xml:lang="uk">документ TeX</comment>
      <comment xml:lang="vi">Tài liệu TeX</comment>
      <comment xml:lang="zh_CN">TeX 文档</comment>
      <comment xml:lang="zh_TW">TeX 文件</comment>
      <sub-class-of type="text/plain"/>
      <alias type="application/x-tex"/>
      <glob pattern="*.tex"/>
      <glob pattern="*.ltx"/>
      <glob pattern="*.sty"/>
      <glob pattern="*.cls"/>
      <glob pattern="*.dtx"/>
      <glob pattern="*.ins"/>
      <glob pattern="*.latex"/>
      <magic priority="10">
        <match value="%" type="string" offset="0"/>
      </magic>
      <magic priority="50">
        <match value="\documentclass" type="string" offset="0:100"/>
      </magic>
      <magic priority="50">
        <match value="\chapter" type="string" offset="0:100"/>
      </magic>
      <magic priority="50">
        <match value="\section" type="string" offset="0:100"/>
      </magic>
    </mime-type>
  user@host:/tmp/mime$ echo "Normal text using 'sectional'." > no_tex
  user@host:/tmp/mime$ mimetype no_tex
  no_tex: text/x-tex
  user@host:/tmp/mime$ echo "\section{A \TeX Section}" > tex_file.tex
  user@host:/tmp/mime$ mimetype tex_file.tex
  tex_file.tex: text/x-tex

  
  Should (is, after patching):
  user@host:/tmp/mime$ sed '30568,30638!d' /usr/share/mime/packages/freedesktop.org.xml
    <mime-type type="text/x-tex">
      <comment>TeX document</comment>
      <comment xml:lang="ar">مستند TeX</comment>
      <comment xml:lang="be@latin">Dakument TeX</comment>
      <comment xml:lang="bg">Документ — TeX</comment>
      <comment xml:lang="ca">document TeX</comment>
      <comment xml:lang="cs">Dokument TeX</comment>
      <comment xml:lang="cy">Dogfen TeX </comment>
      <comment xml:lang="da">TeX-dokument</comment>
      <comment xml:lang="de">TeX-Dokument</comment>
      <comment xml:lang="el">έγγραφο TeX</comment>
      <comment xml:lang="en_GB">TeX document</comment>
      <comment xml:lang="eo">TeX-dokumento</comment>
      <comment xml:lang="es">documento TeX</comment>
      <comment xml:lang="eu">TeX dokumentua</comment>
      <comment xml:lang="fi">TeX-asiakirja</comment>
      <comment xml:lang="fo">TeX skjal</comment>
      <comment xml:lang="fr">document TeX</comment>
      <comment xml:lang="ga">cáipéis TeX</comment>
      <comment xml:lang="gl">documenton TeX</comment>
      <comment xml:lang="he">מסמך TeX</comment>
      <comment xml:lang="hr">TeX dokument</comment>
      <comment xml:lang="hu">TeX-dokumentum</comment>
      <comment xml:lang="id">Dokumen TeX</comment>
      <comment xml:lang="it">Documento TeX</comment>
      <comment xml:lang="ja">TeX ドキュメント</comment>
      <comment xml:lang="kk">TeX құжаты</comment>
      <comment xml:lang="ko">TeX 문서</comment>
      <comment xml:lang="lt">TeX dokumentas</comment>
      <comment xml:lang="lv">TeX dokuments</comment>
      <comment xml:lang="ms">Dokumen TeX</comment>
      <comment xml:lang="nb">TeX-dokument</comment>
      <comment xml:lang="nl">TeX-document</comment>
      <comment xml:lang="nn">TeX-dokument</comment>
      <comment xml:lang="pl">Dokument TeX</comment>
      <comment xml:lang="pt">documento TeX</comment>
      <comment xml:lang="pt_BR">Documento TeX</comment>
      <comment xml:lang="ro">Document TeX</comment>
      <comment xml:lang="ru">документ TeX</comment>
      <comment xml:lang="sk">Dokument TeX</comment>
      <comment xml:lang="sl">Dokument TeX</comment>
      <comment xml:lang="sq">Dokument TeX</comment>
      <comment xml:lang="sr">ТеХ документ</comment>
      <comment xml:lang="sv">TeX-dokument</comment>
      <comment xml:lang="tr">TeX belgesi</comment>
      <comment xml:lang="uk">документ TeX</comment>
      <comment xml:lang="vi">Tài liệu TeX</comment>
      <comment xml:lang="zh_CN">TeX 文档</comment>
      <comment xml:lang="zh_TW">TeX 文件</comment>
      <sub-class-of type="text/plain"/>
      <alias type="application/x-tex"/>
      <glob pattern="*.tex"/>
      <glob pattern="*.ltx"/>
      <glob pattern="*.sty"/>
      <glob pattern="*.cls"/>
      <glob pattern="*.dtx"/>
      <glob pattern="*.ins"/>
      <glob pattern="*.latex"/>
      <magic priority="10">
        <match value="%" type="string" offset="0"/>
      </magic>
      <magic priority="50">
        <match value="\\documentclass" type="string" offset="0:100"/>
      </magic>
      <magic priority="50">
        <match value="\\chapter" type="string" offset="0:100"/>
      </magic>
      <magic priority="50">
        <match value="\\section" type="string" offset="0:100"/>
      </magic>
    </mime-type>
  user@host:/tmp/mime$ echo "Normal text using 'sectional'." > no_tex
  user@host:/tmp/mime$ mimetype no_tex
  no_tex: text/plain
  user@host:/tmp/mime$ echo "\section{A \TeX Section}" > tex_file.tex
  user@host:/tmp/mime$ mimetype tex_file.tex
  tex_file.tex: text/x-tex

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/shared-mime-info/+bug/1485217/+subscriptions


References