From f6a3980e1a2d1024a4c3d7b09ac1e167ffb7980a Mon Sep 17 00:00:00 2001 From: rbuj Date: Thu, 19 Sep 2019 09:35:36 +0200 Subject: Ar: Update MIME type and add magic numbers Changes: Replace application/x-ar with application/x-archive ar magic number: "!\n" deb magic number (Debian 0.93+): "!\ndebian-binary" REF: https://en.wikipedia.org/wiki/Ar_(Unix) https://en.wikipedia.org/wiki/Deb_(file_format) Test: $ touch a && touch b && ar r test.ar a b && cp test.ar test-2.a $ xdg-mime query filetype test.ar application/x-archive $ xdg-mime query filetype dftp_2.2-1.deb application/vnd.debian.binary-package $ gio info test.ar | grep content-type standard::content-type: application/x-archive standard::fast-content-type: application/x-archive $ gio info dftp_2.2-1.deb | grep content-type standard::content-type: application/vnd.debian.binary-package standard::fast-content-type: application/vnd.debian.binary-package $ hexdump -C -n 8 test.ar 00000000 21 3c 61 72 63 68 3e 0a |!.| 00000008 $ hexdump -C -n 21 dftp_2.2-1.deb 00000000 21 3c 61 72 63 68 3e 0a 64 65 62 69 61 6e 2d 62 |!.debian-b| 00000010 69 6e 61 72 79 |inary| 00000015 $ ./autogen.sh --prefix=/usr --disable-magic && make && sudo make install --- src/fr-init.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/fr-init.c') diff --git a/src/fr-init.c b/src/fr-init.c index 8c06372..33bdf53 100644 --- a/src/fr-init.c +++ b/src/fr-init.c @@ -71,8 +71,8 @@ FrMimeTypeDescription mime_type_desc[] = { { "application/x-7z-compressed-tar", ".tar.7z", N_("Tar compressed with 7z (.tar.7z)"), 0 }, { "application/x-ace", ".ace", N_("Ace (.ace)"), 0 }, { "application/x-alz", ".alz", N_("ALZip archive (.alz)"), 0 }, - { "application/x-ar", ".a", N_("Ar (.a)"), 0 }, - { "application/x-ar", ".ar", N_("Ar (.ar)"), 0 }, + { "application/x-archive", ".a", N_("Ar (.a)"), 0 }, + { "application/x-archive", ".ar", N_("Ar (.ar)"), 0 }, { "application/x-arj", ".arj", N_("Arj (.arj)"), 0 }, { "application/x-brotli", ".br", N_("brotli (.br)"), 0 }, { "application/x-brotli-compressed-tar", ".tar.br", N_("Tar compressed with brotli (.tar.br)"), 0 }, @@ -117,10 +117,10 @@ FrMimeTypeDescription mime_type_desc[] = { FrExtensionType file_ext_type[] = { { ".7z", "application/x-7z-compressed" }, - { ".a", "application/x-ar" }, + { ".a", "application/x-archive" }, { ".ace", "application/x-ace" }, { ".alz", "application/x-alz" }, - { ".ar", "application/x-ar" }, + { ".ar", "application/x-archive" }, { ".arj", "application/x-arj" }, { ".bin", "application/x-stuffit" }, { ".br", "application/x-brotli" }, -- cgit v1.2.1