Skip to content

Commit

Permalink
Automated updates from upstream Shared MIME-Info (#2)
Browse files Browse the repository at this point in the history
* [bot] updates mime-info database from upstream
* revert wrong weight for todo.txt

See: https://gitlab.freedesktop.org/xdg/shared-mime-info/-/issues/224

---------

Co-authored-by: ju1ius <[email protected]>
Co-authored-by: ju1ius <[email protected]>
  • Loading branch information
3 people authored Mar 4, 2024
1 parent 1172b11 commit 7f14fe6
Show file tree
Hide file tree
Showing 6 changed files with 202 additions and 15 deletions.
1 change: 1 addition & 0 deletions src/Resources/db/aliases.php
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@
'application/x-msmetafile' => 'image/wmf',
'image/x-xpm' => 'image/x-xpixmap',
'x-directory/normal' => 'inode/directory',
'application/prs.wavefront-obj' => 'model/obj',
'text/x-vcalendar' => 'text/calendar',
'application/ics' => 'text/calendar',
'text/directory' => 'text/vcard',
Expand Down
6 changes: 6 additions & 0 deletions src/Resources/db/globs.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,9 @@
'cb7' => [new GlobLiteral('application/x-cb7', 50, 5)],
'cbt' => [new GlobLiteral('application/x-cbt', 50, 5)],
'cbz' => [new GlobLiteral('application/vnd.comicbook+zip', 50, 5)],
'rz' => [new GlobLiteral('application/x-rzip', 50, 4)],
'tar.rz' => [new GlobLiteral('application/x-rzip-compressed-tar', 50, 8)],
'trz' => [new GlobLiteral('application/x-rzip-compressed-tar', 50, 5)],
'lrz' => [new GlobLiteral('application/x-lrzip', 50, 5)],
'tar.lrz' => [new GlobLiteral('application/x-lrzip-compressed-tar', 50, 9)],
'tlrz' => [new GlobLiteral('application/x-lrzip-compressed-tar', 50, 6)],
Expand Down Expand Up @@ -455,6 +458,8 @@
'ogm' => [new GlobLiteral('video/x-ogm+ogg', 50, 5)],
'pub' => [new GlobLiteral('application/vnd.ms-publisher', 50, 5)],
'msi' => [new GlobLiteral('application/x-msi', 50, 5)],
'msp' => [new GlobLiteral('application/microsoftpatch', 50, 5)],
'msu' => [new GlobLiteral('application/microsoftupdate', 50, 5)],
'appx' => [new GlobLiteral('application/appx', 50, 6)],
'msix' => [new GlobLiteral('application/msix', 50, 6)],
'appxbundle' => [new GlobLiteral('application/appxbundle', 50, 12)],
Expand Down Expand Up @@ -490,6 +495,7 @@
'wb1' => [new GlobLiteral('application/x-quattropro', 50, 5)],
'wb2' => [new GlobLiteral('application/x-quattropro', 50, 5)],
'wb3' => [new GlobLiteral('application/x-quattropro', 50, 5)],
'qpw' => [new GlobLiteral('application/x-quattropro', 50, 5)],
'qtl' => [new GlobLiteral('application/x-quicktime-media-link', 50, 5)],
'qif' => [new GlobLiteral('application/x-qw', 50, 5), new GlobLiteral('image/x-quicktime', 50, 5)],
'rar' => [new GlobLiteral('application/vnd.rar', 50, 5)],
Expand Down
5 changes: 5 additions & 0 deletions src/Resources/db/icons.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,8 @@
'application/x-cb7' => 'x-office-document',
'application/x-cbt' => 'x-office-document',
'application/vnd.comicbook+zip' => 'x-office-document',
'application/x-rzip' => 'package-x-generic',
'application/x-rzip-compressed-tar' => 'package-x-generic',
'application/x-lrzip' => 'package-x-generic',
'application/x-lrzip-compressed-tar' => 'package-x-generic',
'application/x-raw-floppy-disk-image' => 'media-floppy',
Expand Down Expand Up @@ -297,7 +299,10 @@
'application/ogg' => 'video-x-generic',
'application/x-ole-storage' => 'x-office-document',
'application/vnd.microsoft.windows.thumbnail-cache' => 'image-x-generic',
'application/vnd.ms-publisher' => 'x-office-document',
'application/x-msi' => 'package-x-generic',
'application/microsoftpatch' => 'package-x-generic',
'application/microsoftupdate' => 'package-x-generic',
'application/appx' => 'package-x-generic',
'application/msix' => 'package-x-generic',
'application/appxbundle' => 'package-x-generic',
Expand Down
61 changes: 50 additions & 11 deletions src/Resources/db/magic.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
return new MagicDatabase(
lookupBufferSize: 18730,
rules: [
new MagicRule('application/vnd.stardivision.writer', 90, 2100, [
new MagicMatch(2089, 1, 'StarWriter', '', 0),
new MagicRule('application/vnd.stardivision.writer', 90, 8209, [
new MagicRegex('~(?n)\A((?(?=\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1)(.{592}.{0,7600}@\~\\\\\xDC\\\\\xB3\x1B\x10\x99a\x04\x02\x1C\x00p\x02|.{592}.{0,7600}\xB0\xE9\x04\x8B\x0EB\xD0\x11\xA4\^\x00\xA0\$\x9DW\xB1|.{592}.{0,7600}\xD1\xF9\f\xC2\xAE\x85\xD1\x11\xAA\xB4\x00\x06\t\}V\x1A)|(*FAIL))|.{2089}StarWriter)~Ss'),
]),
new MagicRule('application/x-docbook+xml', 90, 126, [
new MagicRegex('~(?n)\A(?(?=\<\?xml)(.{0,100}\-//OASIS//DTD DocBook XML|.{0,100}\-//KDE//DTD DocBook XML)|(*FAIL))~Ss'),
Expand Down Expand Up @@ -164,6 +164,9 @@
new MagicRule('application/vnd.oasis.opendocument.text-web', 70, 82, [
new MagicRegex('~(?n)\A(?(?=PK\x03\x04)(?(?=.{30}mimetype).{38}application/vnd\.oasis\.opendocument\.text\-web|(*FAIL))|(*FAIL))~Ss'),
]),
new MagicRule('application/vnd.stardivision.impress', 70, 8209, [
new MagicRegex('~(?n)\A(?(?=\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1)(.{592}.{0,7600}\!r\\\\V\xBC\x85\xD1\x11\x89\xD0\x00\x80\)\xE4\xB0\xB1|.{592}.{0,7600}\xC0\<\-\x01\x16B\xD0\x11\x89\xCB\x00\x80\)\xE4\xB0\xB1|.{592}.{0,7600}\xE0\xAA\x10\xAFm\xB3\x1B\x10\x99a\x04\x02\x1C\x00p\x02)|(*FAIL))~Ss'),
]),
new MagicRule('application/vnd.sun.xml.calc', 70, 67, [
new MagicRegex('~(?n)\A(?(?=PK\x03\x04)(?(?=.{30}mimetype).{38}application/vnd\.sun\.xml\.calc|(*FAIL))|(*FAIL))~Ss'),
]),
Expand Down Expand Up @@ -218,18 +221,51 @@
new MagicRule('application/hta', 60, 273, [
new MagicRegex('~(?n)\A(.{0,256}\<hta\:application|.{0,256}\<HTA\:APPLICATION)~Ss'),
]),
new MagicRule('application/msword', 60, 2141, [
new MagicRegex('~(?n)\A(1\xBE\x00\x00|PO\^Q`|\xFE7\x00\#|\xDB\xA5\-\x00\x00\x00|.{2112}MSWordDoc|.{2108}MSWordDoc|.{2112}Microsoft Word document data|.{546}bjbj|.{546}jbjb)~Ss'),
new MagicRule('application/microsoftpatch', 60, 8209, [
new MagicRegex('~(?n)\A(?(?=\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1).{592}.{0,7600}\x86\x10\f\x00\x00\x00\x00\x00\xC0\x00\x00\x00\x00\x00\x00F|(*FAIL))~Ss'),
]),
new MagicRule('application/msword', 60, 8209, [
new MagicRegex('~(?n)\A((?(?=\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1)(.{592}.{0,7600}\x00\t\x02\x00\x00\x00\x00\x00\x00\xC0F\x00\x00\x00\x00\x00|.{592}.{0,7600}\x06\t\x02\x00\x00\x00\x00\x00\x00\xC0F\x00\x00\x00\x00\x00)|(*FAIL))|1\xBE\x00\x00|PO\^Q`|\xFE7\x00\#|\xDB\xA5\-\x00\x00\x00|.{2112}MSWordDoc|.{2108}MSWordDoc|.{2112}Microsoft Word document data|.{546}bjbj|.{546}jbjb)~Ss'),
]),
new MagicRule('application/vnd.ms-cab-compressed', 60, 9, [
new MagicMatch(0, 1, "MSCF\x00\x00\x00\x00", '', 0),
]),
new MagicRule('application/vnd.ms-excel', 60, 8209, [
new MagicRegex('~(?n)\A((?(?=\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1)(.{592}.{0,7600}\x10\x08\x02\x00\x00\x00\x00\x00\xC0\x00\x00\x00\x00\x00\x00F|.{592}.{0,7600} \x08\x02\x00\x00\x00\x00\x00\xC0\x00\x00\x00\x00\x00\x00F)|(*FAIL))|.{2080}Microsoft Excel 5\.0 Worksheet)~Ss'),
]),
new MagicRule('application/vnd.ms-powerpoint', 60, 8209, [
new MagicRegex('~(?n)\A(?(?=\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1)(.{592}.{0,7600}\x10\x8D\x81d\x9BO\xCF\x11\x86\xEA\x00\xAA\x00\xB9\)\xE8|.{592}.{0,7600}p\xAE\{\xEA;\xFB\xCD\x11\xA9\x03\x00\xAA\x00Q\x0E\xA3)|(*FAIL))~Ss'),
]),
new MagicRule('application/vnd.ms-publisher', 60, 8209, [
new MagicRegex('~(?n)\A(?(?=\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1).{592}.{0,7600}\x01\x12\x02\x00\x00\x00\x00\x00\x00\xC0\x00\x00\x00\x00\x00F|(*FAIL))~Ss'),
]),
new MagicRule('application/vnd.ms-works', 60, 8209, [
new MagicRegex('~(?n)\A(?(?=\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1)(.{592}.{0,7600}\x02\x13\x02\x00\x00\x00\x00\x00\xC0\x00\x00\x00\x00\x00\x00F|.{592}.{0,7600}\x03\x13\x02\x00\x00\x00\x00\x00\xC0\x00\x00\x00\x00\x00\x00F|.{592}.{0,7600}\xB2Z\xA4\x0E\n\x9E\xD1\x11\xA4\x07\x00\xC0O\xB92\xBA|.{592}.{0,7600}\xC0\xC7&n\xB9\x8C\xD3\x11\xA1\xC8\x00\xC0Oa\$R|.{592}.{0,7600}\xC2\xDB\xCD\(\xE2\n\xCE\x11\xA2\x9A\x00\xAA\x00J\x1Ar|.{592}.{0,7600}\xC3\xDB\xCD\(\xE2\n\xCE\x11\xA2\x9A\x00\xAA\x00J\x1Ar)|(*FAIL))~Ss'),
]),
new MagicRule('application/vnd.ms-wpl', 60, 262, [
new MagicRegex('~(?n)\A.{0,256}\<\?wpl~Ss'),
]),
new MagicRule('application/vnd.rar', 60, 5, [
new MagicMatch(0, 1, 'Rar!', '', 0),
]),
new MagicRule('application/vnd.stardivision.calc', 60, 8209, [
new MagicRegex('~(?n)\A(?(?=\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1)(.{592}.{0,7600}A\xD4ac5B\xD0\x11\x89\xCB\x00\x80\)\xE4\xB0\xB1|.{592}.{0,7600}a\xB8\xA5\xC6\xD6\x85\xD1\x11\x89\xCB\x00\x80\)\xE4\xB0\xB1|.{592}.{0,7600}\xA0\?T\?\xA6\xB6\x1B\x10\x99a\x04\x02\x1C\x00p\x02)|(*FAIL))~Ss'),
]),
new MagicRule('application/vnd.stardivision.chart', 60, 8209, [
new MagicRegex('~(?n)\A(?(?=\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1)(.{592}.{0,7600}\!C\x88\xBF\xDD\x85\xD1\x11\x89\xD0\x00\x80\)\xE4\xB0\xB1|.{592}.{0,7600}\xE0\x99\x9C\xFBm,\x1C\x10\x8E,\x00\x00\x1BL\xC7\x11|.{592}.{0,7600}\xE0\xB7\xB3\x02%B\xD0\x11\x89\xCA\x00\x80\)\xE4\xB0\xB1)|(*FAIL))~Ss'),
]),
new MagicRule('application/vnd.stardivision.draw', 60, 8209, [
new MagicRegex('~(?n)\A(?(?=\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1)(.{592}.{0,7600}\xA0\x05\x89\.\xBD\x85\xD1\x11\x89\xD0\x00\x80\)\xE4\xB0\xB1|.{592}.{0,7600}\xE0\xAA\x10\xAFm\xB3\x1B\x10\x99a\x04\x02\x1C\x00p\x02)|(*FAIL))~Ss'),
]),
new MagicRule('application/vnd.stardivision.math', 60, 8209, [
new MagicRegex('~(?n)\A(?(?=\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1)(.{592}.{0,7600}@\xE6\xB5\xFF\xDE\x85\xD1\x11\x89\xD0\x00\x80\)\xE4\xB0\xB1|.{592}.{0,7600}`\x04Y\xD4\xFD5\x1C\x10\xB1\*\x04\x02\x1C\x00p\x02|.{592}.{0,7600}\xE1\xB7\xB3\x02%B\xD0\x11\x89\xCA\x00\x80\)\xE4\xB0\xB1)|(*FAIL))~Ss'),
]),
new MagicRule('application/vnd.visio', 60, 8209, [
new MagicRegex('~(?n)\A(?(?=\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1)(.{592}.{0,7600}\x13\x1A\x02\x00\x00\x00\x00\x00\xC0\x00\x00\x00\x00\x00\x00F|.{592}.{0,7600}\x14\x1A\x02\x00\x00\x00\x00\x00\xC0\x00\x00\x00\x00\x00\x00F)|(*FAIL))~Ss'),
]),
new MagicRule('application/vnd.wordperfect', 60, 8209, [
new MagicRegex('~(?n)\A(.{1}WPC|(?(?=\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1).{592}.{0,7600}\xFFs\x98Q\xAD\- \x02\x197\x00\x00\x92\x96y\xCD|(*FAIL)))~Ss'),
]),
new MagicRule('application/x-7z-compressed', 60, 7, [
new MagicMatch(0, 1, "7z\xBC\xAF'\x1C", '', 0),
]),
Expand Down Expand Up @@ -298,12 +334,18 @@
new MagicRule('application/x-lzop', 60, 10, [
new MagicMatch(0, 1, "\x89LZO\x00\r\n\x1A\n", '', 0),
]),
new MagicRule('application/x-msi', 60, 8209, [
new MagicRegex('~(?n)\A(?(?=\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1).{592}.{0,7600}\x84\x10\f\x00\x00\x00\x00\x00\xC0\x00\x00\x00\x00\x00\x00F|(*FAIL))~Ss'),
]),
new MagicRule('application/x-par2', 60, 5, [
new MagicMatch(0, 1, 'PAR2', '', 0),
]),
new MagicRule('application/x-qpress', 60, 9, [
new MagicMatch(0, 1, 'qpress10', '', 0),
]),
new MagicRule('application/x-quattropro', 60, 8209, [
new MagicRegex('~(?n)\A(?(?=\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1).{592}.{0,7600}\x00\xB4\x02\x00\x00\x00\x00\x00\xC0\x00\x00\x00\x00\x00\x00F|(*FAIL))~Ss'),
]),
new MagicRule('application/x-quicktime-media-link', 60, 76, [
new MagicRegex('~(?n)\A((?(?=\<\?xml).{0,64}\<\?quicktime|(*FAIL))|RTSPtext|rtsptext|SMILtext)~Ss'),
]),
Expand Down Expand Up @@ -481,9 +523,6 @@
new MagicRule('application/vnd.ms-asf', 50, 12, [
new MagicRegex('~(?n)\A(0&\xB2u|\[Reference\])~Ss'),
]),
new MagicRule('application/vnd.ms-excel', 50, 2110, [
new MagicMatch(2080, 1, 'Microsoft Excel 5.0 Worksheet', '', 0),
]),
new MagicRule('application/vnd.ms-tnef', 50, 5, [
new MagicMatch(0, 1, "x\x9F>\"", '', 0),
]),
Expand All @@ -506,9 +545,6 @@
new MagicMatch(0, 1, "\xA1\xB2\xC3\xD4", '', $swap|4),
new MagicMatch(0, 1, "\xD4\xC3\xB2\xA1", '', $swap|4),
]),
new MagicRule('application/vnd.wordperfect', 50, 5, [
new MagicMatch(1, 1, 'WPC', '', 0),
]),
new MagicRule('application/wasm', 50, 5, [
new MagicMatch(0, 1, "\x00asm", '', 0),
]),
Expand Down Expand Up @@ -810,7 +846,7 @@
new MagicRegex('~(?n)\A((?(?=\x7FELF)(?(?=.{5}\x01).{16}\x01\x00|(*FAIL))|(*FAIL))|(?(?=\x7FELF)(?(?=.{5}\x02).{16}\x00\x01|(*FAIL))|(*FAIL)))~Ss'),
]),
new MagicRule('application/x-ole-storage', 50, 9, [
new MagicRegex('~(?n)\A(\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1|\xD0\xCF\x11\xE0)~Ss'),
new MagicMatch(0, 1, "\xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1", '', 0),
]),
new MagicRule('application/x-oleo', 50, 36, [
new MagicMatch(31, 1, 'Oleo', '', 0),
Expand Down Expand Up @@ -854,6 +890,9 @@
new MagicRule('application/x-ruby', 50, 30, [
new MagicRegex('~(?n)\A(.{2}.{0,14}/bin/env ruby|.{2}.{0,14}/bin/ruby)~Ss'),
]),
new MagicRule('application/x-rzip', 50, 5, [
new MagicMatch(0, 1, 'RZIP', '', 0),
]),
new MagicRule('application/x-sami', 50, 263, [
new MagicRegex('~(?n)\A.{0,256}\<SAMI\>~Ss'),
]),
Expand Down
9 changes: 9 additions & 0 deletions src/Resources/db/subclasses.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@
'application/msword' => ['application/x-ole-storage'],
'application/msword-template' => ['application/msword'],
'application/gml+xml' => ['application/xml'],
'application/vnd.stardivision.calc' => ['application/x-ole-storage'],
'application/vnd.stardivision.chart' => ['application/x-ole-storage'],
'application/vnd.stardivision.draw' => ['application/x-ole-storage'],
'application/vnd.stardivision.impress' => ['application/x-ole-storage'],
'application/vnd.stardivision.math' => ['application/x-ole-storage'],
'application/vnd.stardivision.writer' => ['application/x-ole-storage'],
'application/vnd.sun.xml.calc' => ['application/zip'],
'application/vnd.sun.xml.calc.template' => ['application/zip'],
'application/vnd.sun.xml.draw' => ['application/zip'],
Expand Down Expand Up @@ -107,6 +113,7 @@
'application/x-cb7' => ['application/x-7z-compressed'],
'application/x-cbt' => ['application/x-tar'],
'application/vnd.comicbook+zip' => ['application/zip'],
'application/x-rzip-compressed-tar' => ['application/x-rzip'],
'application/x-lrzip-compressed-tar' => ['application/x-lrzip'],
'application/x-raw-floppy-disk-image' => ['application/vnd.efi.img'],
'application/x-raw-disk-image-xz-compressed' => ['application/x-xz'],
Expand Down Expand Up @@ -193,6 +200,8 @@
'application/vnd.microsoft.windows.thumbnail-cache' => ['application/x-ole-storage'],
'application/vnd.ms-publisher' => ['application/x-ole-storage'],
'application/x-msi' => ['application/x-ole-storage'],
'application/microsoftpatch' => ['application/x-ole-storage'],
'application/microsoftupdate' => ['application/vnd.ms-cab-compressed'],
'application/appx' => ['application/zip'],
'application/msix' => ['application/zip'],
'application/appxbundle' => ['application/zip'],
Expand Down
Loading

0 comments on commit 7f14fe6

Please sign in to comment.