summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
13 daysAdd test files for text/x-python2HEADmasterFeRD (Frank Dana)3-0/+41
13 daysAdd text/x-python2 for Python 2 scriptsFeRD (Frank Dana)1-0/+18
Create a second subclass of `text/x-python`, which specifically identifies Python 2 scripts in the same way that `text/x-python3` does Python 3 scripts. Like `text/x-python3`, `text/x-python2` has more-specific magic strings at a higher priority than the ones in `text/x-python`. Both match the `*.py` glob at a lower priority than `text/x-python`. Basically, if we are able to concretely identify a file as "Python 2 script" or "Python 3 script", we do. Otherwise, it's just "Python script", version neither known nor assumed.
2024-04-24Separate text/x-cython from text/x-pythonAlex Henrie2-4/+9
Cython is a superset of Python that requires compilation; it cannot be directly executed by the Python interpreter. Cython files are identified by a .pyx, .pxd, or .pxi extension. I have not seen anyone using .py2x or .py3x to indicate which Python version the Cython module is compatible with. https://github.com/github-linguist/linguist/blob/7ca3799b8b5f1acde1dd7a8dfb7ae849d3dfb4cd/lib/linguist/languages.yml#L1398 https://cython.readthedocs.io/en/latest/src/userguide/language_basics.html#cython-file-types
2024-04-23Add application/vnd.oasis.opendocument.text-master-templateAlex Henrie3-0/+16
https://www.iana.org/assignments/media-types/application/vnd.oasis.opendocument.text-master-template
2024-04-23Increase priority of application/vnd.oasis.opendocument.text-masterAlex Henrie3-1/+3
To avoid misdetection as application/vnd.oasis.opendocument.text.
2024-04-22Prefer vnd.oasis.opendocument.base over vnd.oasis.opendocument.databaseAlex Henrie1-1/+2
https://www.iana.org/assignments/media-types/application/vnd.oasis.opendocument.base
2024-04-22Add application/vnd.quark.quarkxpressAlex Henrie3-0/+16
https://www.iana.org/assignments/media-types/application/vnd.Quark.QuarkXPress
2024-04-21Add application/x-qbrew for qbrew recipesdevnewton3-0/+29
2024-04-21Add application/vnd.apache.parquetAlex Henrie3-0/+12
https://www.iana.org/assignments/media-types/application/vnd.apache.parquet
2024-04-20Attempt to fix pipelines run after mergesDavid Faure1-2/+5
2024-04-20Give application/x-sylk the spreadsheet iconAlex Henrie1-0/+1
2024-04-20Prefer application/x-sylk over text/spreadsheetAlex Henrie1-1/+2
text/spreadsheet is not an official IANA media type, but if it were, it would be a generic type for plaintext spreadsheets such as CSVs and TSVs. The more specific name application/x-sylk is used by Gnumeric and others for SYLK files. https://help.gnome.org/users/gnumeric/stable/sect-file-formats.html.en
2024-04-20Give text/calendar the calendar iconAlex Henrie1-0/+1
2024-04-20Give text/x-ldif the address book iconAlex Henrie1-0/+1
2024-04-20Add application/x-sony-bbebAlex Henrie3-0/+10
https://web.archive.org/web/20110809071744/http://www.sven.de/librie/Librie/LrfFormat https://cgit.freedesktop.org/libreoffice/core/tree/filter/source/config/fragments/types/writer_BroadBand_eBook.xcu?h=libreoffice-24.2.3.1
2024-04-20Prefer application/docbook+xml over application/x-docbook+xmlAlex Henrie2-3/+3
application/docbook+xml is the correct type according to the OASIS standard, whereas application/x-docbook+xml is not part of any standard. https://docs.oasis-open.org/docbook/specs/docbook-5.0-spec-os.html#media-type-registration
2024-04-20Add Nintendo Switch encrypted ROMsBastien Nocera3-0/+17
Game card format adapted from: https://switchbrew.org/wiki/XCI
2024-04-20Remove relationships between C and C#, D, Groovy, Java, and ValaAlex Henrie1-5/+5
These languages are much too different for any one of them to be considered a subset of another.
2024-04-20Fix backwards relationships between C, C++, Objective-C, and Objective-C++Alex Henrie1-5/+5
Almost all C code is also C++ or Objective-C code, but the reverse is rarely true. All C++ and Objective-C code is also Objective-C++ code.
2024-04-18Add application/vnd.stardivision.impress-packedAlex Henrie3-3/+10
Since this is a legacy format, default to application/sdp when matching by file name. https://www.openoffice.org/framework/documentation/mimetypes/mimetypes.html
2024-04-17Separate StarOffice 3-4 types from StarOffice 5 typesAlex Henrie7-30/+132
Types that start with application/vnd.stardivision are for StarOffice 5 and types that start with application/x-star are for StarOffice 4. The StarOffice 3 formats are similar to the StarOffice 4 formats and I have not found any distinct MIME type for them. StarOffice 2 used the same file extensions but entirely different file formats that are not based on OLE Compound Storage. Also separate StarWriter master documents from ordinary StarWriter documents because the two have distinct file formats. https://www.openoffice.org/framework/documentation/mimetypes/mimetypes.html
2024-04-16Give email files the mail iconAlex Henrie1-4/+5
2024-04-06Add *.md as a possible glob for Sega Genesis/Megadrive ROMsBastien Nocera3-0/+2
And try not to conflict with Markdown files.
2024-04-06Fix detection of some Genesis ROMsBastien Nocera3-0/+3
ROMs that use the SSF mapper such as the Sega Channel Revival ROMs would not get detected by the current magic.
2024-04-06Prioritise Sega Genesis/Megadrive ROMs over StarOffice MailBastien Nocera1-1/+1
StarOffice Mail is unlikely to be used in modern contexts, so deprioritise *.smd as its glob.
2024-04-06Add STEP 3D model mime-typeBastien Nocera3-0/+185
Add mime-type for STEP 3D models as per Wikipedia page: https://en.wikipedia.org/wiki/ISO_10303-21 Note that this doesn't include support for STEP-XML files (https://en.wikipedia.org/wiki/ISO_10303-28) as it's a separate filetype. STEP+ZIP was ommitted because of the lack of information and examples about the format.
2024-02-15fix: updates glob weight for text/x-todo-txtju1ius1-1/+1
Closes #224
2024-02-05Allow cross-compiling after moving xgdmime to a meson subprojectAlex Richardson1-13/+18
It is not currently possible to build a meson subproject for the build system. Since xdgmime is only used for the tests we can move this logic into the build-tests conditional and disables building the tests when cross-compiling. This workaround is not ideal but it's better than not being able to cross-compile at all. See https://github.com/mesonbuild/meson/issues/11121
2024-02-01ci: Don’t run tests again when checking that dist worksPhilip Withnall1-1/+1
The tests have just been run by `meson test`, so there’s no need to run them again. Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-01ci: Don’t run xdgmime tests from subprojectPhilip Withnall1-1/+1
xdgmime has its own CI, so we don’t need to run their tests when using xdgmime as a subproject. This is handy, because currently those tests sigsegv on the shared-mime-info infrastructure and we can’t work out why. Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-01build: Move xdgmime to a meson subprojectPhilip Withnall9-66/+59
This means: - It’s always available, so the tests no longer have to be optional - It gets bundled in release tarballs so the above is always true - The `meson setup` and `meson build` commands will automatically update it if needed - It gets built using meson, rather than autotools, so the old GNU make build system in xdgmime can be dropped (see https://gitlab.freedesktop.org/xdg/xdgmime/-/issues/36) - The `xdgmime-path` meson option is no longer needed and has been dropped Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-02-01ci: Use modern meson subcommandsPhilip Withnall1-4/+4
This introduces no functional changes, it just tidies things up a bit. Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2024-01-28Add application/x-rzipIngo Brückl4-0/+19
https://rzip.samba.org/ Also add application/x-rzip-compressed-tar.
2024-01-28Add application/microsoftpatch and application/microsoftupdateAlex Henrie3-0/+19
These two are not official IANA media types, but they can be found in the wild. Wine currently supports .msp files and may gain support for .msu files in the future. https://forums.ivanti.com/s/sfsites/c/sfc/servlet.shepherd/document/download/0694O00000J7pyUQAR
2024-01-28Give Microsoft Publisher documents the document iconAlex Henrie1-0/+1
2024-01-28Improve detection of application/x-ole-storage subtypesAlex Henrie24-8/+130
Most OLE file formats include a 128-bit root class identifier somewhere after the 592nd byte. StarImpress files are essentially bundles of StarDraw files, hence the need to give the StarImpress magic higher priority. http://fileformats.archiveteam.org/wiki/OLE
2024-01-16Add alias for Wavefront OBJ mime-typeBastien Nocera1-0/+1
The application/prs.wavefront-obj mime-type is also used by applications like Cura and cargo-culted into other slicers. Declare this alias so it's equivalent to the canonical model/obj. See https://en.wikipedia.org/wiki/Wavefront_.obj_file
2023-12-13Add mimetype for HEJ2 formatDaniel Novomeský3-0/+11
2023-12-04update-mime-database: Improve use of g_string_free()Philip Withnall1-3/+1
The existing code wasn’t incorrect, but it did trigger warnings with more modern versions of GLib, because to the compiler it looked like the built string had been leaked: ``` In file included from /opt/gnome/install/include/glib-2.0/glib/giochannel.h:36, from /opt/gnome/install/include/glib-2.0/glib.h:56, from ../../source/shared-mime-info/src/update-mime-database.cpp:14: ../../source/shared-mime-info/src/update-mime-database.cpp: In function ‘void match_value_and_mask(Match*, xmlNode*, GError**)’: /opt/gnome/install/include/glib-2.0/glib/gstring.h:73:31: error: ignoring return value of ‘gchar* g_string_free_and_steal(GString*)’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result] 73 | g_string_free_and_steal (str)) \ | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~ ../../source/shared-mime-info/src/update-mime-database.cpp:1488:17: note: in expansion of macro ‘g_string_free’ 1488 | g_string_free(parsed_value, FALSE); | ^~~~~~~~~~~~~ cc1plus: all warnings being treated as errors ``` Rearrange the code to make the ownership transfer more explicit. Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2023-12-04update-mime-database: Fix various signed/unsigned comparison warningsPhilip Withnall1-8/+8
Signed-off-by: Philip Withnall <pwithnall@gnome.org>
2023-12-01Handle build with older versions of GCCPatrick Williams1-0/+14
Older versions of GCC (prior to 9.1) did not put the `std::filesystem` support directly into libstdcpp, but in a separate `libstdc++fs`. Add meson logic to detect if an extra linker flag is necessary. Fixes #223. Tested on AlmaLinux 8 which uses GCC-8. Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
2023-11-20mime-detection: whitespace fixLennart Poettering1-1/+1
2023-11-20mime-detection: detect GPT disk images by contents, not just suffixLennart Poettering3-0/+8
2023-11-19Fix build with libxml2-2.12.0 and clang-17David Faure1-0/+1
Fixes #219
2023-11-19Add application/htaAlex Henrie3-0/+18
The "HTML Application" format extended HTML with capabilities similar to desktop applications. But given that this format requires the old Internet Explorer rendering engine and HTML has grown many new features since then, it's probably more accurate to say that application/hta is a subset of text/html rather than a superset. https://learn.microsoft.com/en-us/previous-versions/ms536496(v=vs.85)
2023-11-15Make application/json5 a subclass of application/ecmascriptAlex Henrie1-1/+1
application/json used to inherit from application/ecmascript because it inherited from text/javascript which was incorrectly declared as a subclass of application/ecmascript. After the relationship between text/javascript and application/ecmascript was corrected (and application/json was made to inherit from the new application/json5 type instead), application/json's relationship to application/ecmascript was accidentally broken.
2023-11-12version number and changelog for the 2.4 release2.4David Faure2-1/+36
2023-11-12Update translationsDavid Faure75-63732/+68838
2023-11-08Improve detection of application/mac-binhex40Alex Henrie3-1/+10
The IANA type registration says that the file must begin with the string "(This file must be converted with BinHex 4.0)", but the binhex utility generates files that begin with "(This file must be converted; you knew that already.)". https://www.iana.org/assignments/media-types/application/mac-binhex40 https://datatracker.ietf.org/doc/html/rfc1741 http://fileformats.archiveteam.org/wiki/Binhex https://github.com/VorpalBlade/macutils/blob/640782c6698a4d360711bbfb71a0d27dbd182d8f/binhex/dofile.c#L30
2023-11-08Add application/x-msdownload and subtypesAlex Henrie5-2/+65
application/x-msdownload is what Microsoft Windows uses for EXE and DLL files, so that type is commonly found on the WWW and in other contexts. It is an umbrella type for anything with a .exe or .dll file extension, among others. application/x-dosexec is what the `file` utility uses for DOS executables specifically. According to the File Format Problem wiki: "It's not clear if there is any completely reliable way to identify a file as strictly DOS EXE, except in the negative (i.e., it looks like EXE, and is not a valid NE, PE, etc., file)...If the relocation table offset is from 28 to 63...it is pretty certainly DOS EXE." application/x-ms-ne-executable is what the `file` utility uses for 16-bit Windows libraries and executables. application/vnd.microsoft.portable-executable is the IANA standard type for 32-bit and 64-bit Windows libraries and executables, as well as EFI executables. With these changes, application/x-ms-dos-executable is considered deprecated. For now it is an alias of application/x-msdownload, but in the future it may change to be an alias of application/x-dosexec. helloworld-*.exe was compiled with Open Watcom from the following C source code: #include <stdio.h> int main(void) { puts("Hello World!"); return 0; } https://github.com/file/file/blob/171c73b67ca692550882e0b8ab3c2a1f16ab1e00/magic/Magdir/msdos https://www.iana.org/assignments/media-types/application/vnd.microsoft.portable-executable http://fileformats.archiveteam.org/wiki/MS-DOS_EXE http://fileformats.archiveteam.org/wiki/New_Executable http://fileformats.archiveteam.org/wiki/Portable_Executable