From d9d5fc1666f2de03ba44d9a5ea9d2a26e545db76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20Br=C3=BCns?= Date: Mon, 13 Dec 2021 19:59:06 +0100 Subject: Add mimetype for Devicetree source code Make sure at least the first two characters are ASCII, to guard against any binary files. The maximum offset is fairly large, as many files start with a large license stanza. --- data/freedesktop.org.xml.in | 22 ++++++++++++++++++++++ tests/mime-detection/devicetree.dtsi | 3 +++ tests/mime-detection/devicetree1.dts | 4 ++++ tests/mime-detection/devicetree2.dts | 1 + tests/mime-detection/list | 5 +++++ 5 files changed, 35 insertions(+) create mode 100644 tests/mime-detection/devicetree.dtsi create mode 100644 tests/mime-detection/devicetree1.dts create mode 100644 tests/mime-detection/devicetree2.dts diff --git a/data/freedesktop.org.xml.in b/data/freedesktop.org.xml.in index 2c09cdb0..68476bb3 100644 --- a/data/freedesktop.org.xml.in +++ b/data/freedesktop.org.xml.in @@ -7898,6 +7898,28 @@ command to generate the output files. + + Devicetree source code + DTS + Device Tree Source + + + + + + + + + + + + + + + + + + AVIF image AVIF diff --git a/tests/mime-detection/devicetree.dtsi b/tests/mime-detection/devicetree.dtsi new file mode 100644 index 00000000..68d518c6 --- /dev/null +++ b/tests/mime-detection/devicetree.dtsi @@ -0,0 +1,3 @@ +/ { + node { }; +}; diff --git a/tests/mime-detection/devicetree1.dts b/tests/mime-detection/devicetree1.dts new file mode 100644 index 00000000..48772d1f --- /dev/null +++ b/tests/mime-detection/devicetree1.dts @@ -0,0 +1,4 @@ +/* @ 2021 */ +/dts-v1/; +/ { +}; diff --git a/tests/mime-detection/devicetree2.dts b/tests/mime-detection/devicetree2.dts new file mode 100644 index 00000000..805e6674 --- /dev/null +++ b/tests/mime-detection/devicetree2.dts @@ -0,0 +1 @@ +#include diff --git a/tests/mime-detection/list b/tests/mime-detection/list index ac907977..cb20f435 100644 --- a/tests/mime-detection/list +++ b/tests/mime-detection/list @@ -899,6 +899,11 @@ test.gd application/x-gdscript ox # Kotlin source code test.kt text/x-kotlin ox +# Device Tree Source +devicetree1.dts text/x-devicetree-source xoo +devicetree2.dts text/x-devicetree-source xoo +devicetree.dtsi text/x-devicetree-source + # AV1 Image File Format (AVIF) # https://aomediacodec.github.io/av1-avif/ test.avif image/avif -- cgit v1.2.1