diff options
author | David Faure <faure@kde.org> | 2022-05-02 13:09:03 +0200 |
---|---|---|
committer | David Faure <faure@kde.org> | 2023-09-04 18:30:27 +0000 |
commit | d59bc4a4292fd1075db4e4ef3659e72ad796681d (patch) | |
tree | 246af896925de468cb463a4501f2dff7149f4454 | |
parent | 451c92e24a47cca429a54dfe61005a968c6a43bd (diff) |
Add mimetype application/x-lmdb
Since it shares the *.mdb extension with msaccess,
added a tes file for msaccess, and gave a higher weight
to the msaccess glob for compatibility reasons (so that filename-only
matching of *.mdb still says msaccess).
Reference for the extensions: https://lmdb.readthedocs.io/en/release/
Reference for the magic: https://git.openldap.org/openldap/openldap/-/blob/mdb.master/libraries/liblmdb/mdb.c
Mimetype name: made up, no existing name found
Fixes: #168
-rw-r--r-- | data/freedesktop.org.xml.in | 13 | ||||
-rw-r--r-- | tests/mime-detection/data.mdb | bin | 0 -> 8192 bytes | |||
-rw-r--r-- | tests/mime-detection/list | 5 | ||||
-rwxr-xr-x | tests/mime-detection/msaccess.mdb | bin | 0 -> 65536 bytes |
4 files changed, 17 insertions, 1 deletions
diff --git a/data/freedesktop.org.xml.in b/data/freedesktop.org.xml.in index 51d6349..5350ecf 100644 --- a/data/freedesktop.org.xml.in +++ b/data/freedesktop.org.xml.in @@ -639,6 +639,17 @@ command to generate the output files. </magic> <glob pattern="*.lwp"/> </mime-type> + <mime-type type="application/x-lmdb"> + <comment>LMDB database</comment> + <acronym>LMDB</acronym> + <expanded-acronym>Lightning Memory-Mapped Database</expanded-acronym> + <generic-icon name="x-office-document"/> + <magic> + <match offset="16" type="little32" value="0xBEEFC0DE" /> + </magic> + <glob pattern="*.mdb" /> + <glob pattern="*.lmdb" /> + </mime-type> <mime-type type="application/vnd.ms-access"> <comment>JET database</comment> <acronym>JET</acronym> @@ -647,7 +658,7 @@ command to generate the output files. <magic> <match offset="0" type="string" value="\x00\x01\x00\x00Standard Jet DB" /> </magic> - <glob pattern="*.mdb" /> + <glob pattern="*.mdb" weight="60"/> <alias type="application/msaccess"/> <alias type="application/vnd.msaccess"/> <alias type="application/x-msaccess"/> diff --git a/tests/mime-detection/data.mdb b/tests/mime-detection/data.mdb Binary files differnew file mode 100644 index 0000000..af9ebbe --- /dev/null +++ b/tests/mime-detection/data.mdb diff --git a/tests/mime-detection/list b/tests/mime-detection/list index c2eeff4..341306a 100644 --- a/tests/mime-detection/list +++ b/tests/mime-detection/list @@ -935,6 +935,11 @@ test.avifs image/avif rgb.qoi image/qoi rgba.qoi image/qoi +# LMDB (#168), file generated by baloo's basicindexingjobtest (LGPL) +data.mdb application/x-lmdb x +# MS Access DB, copied from Qt5's qtbase/tests/auto/sql/kernel/qsqldatabase/testdata/qtest.mdb (LGPL) +msaccess.mdb application/vnd.ms-access + # Org-mode file test.org text/org ox # OpenZIM file diff --git a/tests/mime-detection/msaccess.mdb b/tests/mime-detection/msaccess.mdb Binary files differnew file mode 100755 index 0000000..f388f19 --- /dev/null +++ b/tests/mime-detection/msaccess.mdb |