[File] [PATCH v2] Support detecting Gentoo Manifest files

Michał Górny mgorny at gentoo.org
Sat Sep 10 15:19:33 UTC 2022


Changes in v2: use a dedicated "gentoo" file

---
 magic/Magdir/gentoo | 35 +++++++++++++++++++++++++++++++++++
 magic/Makefile.am   |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 magic/Magdir/gentoo

diff --git a/magic/Magdir/gentoo b/magic/Magdir/gentoo
new file mode 100644
index 00000000..47f63b06
--- /dev/null
+++ b/magic/Magdir/gentoo
@@ -0,0 +1,35 @@
+# Summary: Gentoo ebuild Manifest files (GLEP 74)
+# Reference: https://www.gentoo.org/glep/glep-0074.html
+# Submitted by: Michał Górny <mgorny at gentoo.org>
+# Start by doing a fast check for the most common tags.
+0	string	AUX
+>0	use	gentoo-manifest
+0	string	DATA
+>0	use	gentoo-manifest
+0	string	DIST
+>0	use	gentoo-manifest
+0	string	EBUILD
+>0	use	gentoo-manifest
+0	string	MANIFEST
+>0	use	gentoo-manifest
+
+# Manifest can be PGP-signed.
+0	string	-----BEGIN\040PGP\040SIGNED\040MESSAGE-----
+>34	search/32	\n\n
+>>&0	string	AUX
+>>>&0	use	gentoo-manifest
+>>&0	string	DATA
+>>>&0	use	gentoo-manifest
+>>&0	string	DIST
+>>>&0	use	gentoo-manifest
+>>&0	string	EBUILD
+>>>&0	use	gentoo-manifest
+>>&0	string	MANIFEST
+>>>&0	use	gentoo-manifest
+
+# Use a more detailed regex to verify that we were correct.
+# <tag> <filename> <size> <hash-name> <hash-value>...
+# (<tag>'s already been matched prior to calling)
+0	name	gentoo-manifest
+>&0	regex	[[:space:]]+[[:print:]]+[[:space:]]+[[:digit:]]+[[:space:]]+[[:alnum:]]+[[:space:]]+[[:xdigit:]]{32}	Gentoo Manifest (GLEP 74)
+
diff --git a/magic/Makefile.am b/magic/Makefile.am
index db053b79..2641118a 100644
--- a/magic/Makefile.am
+++ b/magic/Makefile.am
@@ -120,6 +120,7 @@ $(MAGIC_FRAGMENT_DIR)/fusecompress \
 $(MAGIC_FRAGMENT_DIR)/games \
 $(MAGIC_FRAGMENT_DIR)/gcc \
 $(MAGIC_FRAGMENT_DIR)/gconv \
+$(MAGIC_FRAGMENT_DIR)/gentoo \
 $(MAGIC_FRAGMENT_DIR)/geo \
 $(MAGIC_FRAGMENT_DIR)/geos \
 $(MAGIC_FRAGMENT_DIR)/gimp \
-- 
2.37.3



More information about the File mailing list