[File] [PATCH] Support detecting Gentoo Manifest files
Michał Górny
mgorny at gentoo.org
Sat Sep 10 13:20:30 UTC 2022
---
magic/Magdir/misctools | 35 +++++++++++++++++++++++++++++++++++
1 file changed, 35 insertions(+)
diff --git a/magic/Magdir/misctools b/magic/Magdir/misctools
index 4292e2b0..ce0d879f 100644
--- a/magic/Magdir/misctools
+++ b/magic/Magdir/misctools
@@ -78,3 +78,38 @@
# Submitted by: Mark Schreiber <mark7 at alumni.cmu.edu>
0 string #\x20abook\x20addressbook\x20file abook address book
!:mime application/x-abook-addressbook
+
+# 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)
--
2.37.3
More information about the File
mailing list