[File] [PATCH] Move GPKG magic to gentoo file

Michał Górny mgorny at gentoo.org
Mon Sep 12 07:53:22 UTC 2022


Move the magic for GPKG files into gentoo file. Simplify the rule since
we can rely on the format being ustar or ustar-compatible GNU.
---
 magic/Magdir/archive | 23 -----------------------
 magic/Magdir/gentoo  | 25 +++++++++++++++++++++++++
 2 files changed, 25 insertions(+), 23 deletions(-)

diff --git a/magic/Magdir/archive b/magic/Magdir/archive
index 79153153..c9808f3a 100644
--- a/magic/Magdir/archive
+++ b/magic/Magdir/archive
@@ -32,9 +32,6 @@
 >>>>>>>>0	regex		\^[0-9]{2,4}[.](png|jpg|jpeg|tif|tiff|gif|bmp)
 #foo
 >>>>>>>>>0	use	tar-cbt
-# GPKG starts with <directory>/gpkg-1 file
->>>>>>>>0	search/100		/gpkg-1\0
->>>>>>>>>0	use	tar-gpkg
 # if 1st member name without digits and without used image suffix then it is a TAR archive
 >>>>>>>>0	default		x
 >>>>>>>>>0	use	tar-file
@@ -172,26 +169,6 @@
 # or maybe like ComicInfo.xml
 >0	string		>\0		\b, 1st image %-.60s
 
-# Summary:	Gentoo GLEP 78 binary package
-# URL:		https://www.gentoo.org/glep/glep-0078.html
-# Note:		assumes the strict format
-0	name		tar-gpkg
->0	regex		[^/]+		Gentoo GLEP 78 (GPKG) binary package for "%s"
-!:mime	application/x-tar
-!:ext	tar
-# the logic below requires the gpkg-1 file to be empty
->>124	string	00000000000\0
-# determine the compression used by looking at the second member name
->>>512	search/100	.tar.
->>>>&0	string		gz\0		using gzip compression
->>>>&0	string		bz2\0		using bzip2 compression
->>>>&0	string		lz\0		using lzip compression
->>>>&0	string		lz4\0		using lz4 compression
->>>>&0	string		lzo\0		using lzo compression
->>>>&0	string		xz\0		using xz compression
->>>>&0	string		zst\0		using zstd compression
->>>(636.o+1024)	search/611	.sig\0	\b, signed
-
 # Incremental snapshot gnu-tar format from:
 # https://www.gnu.org/software/tar/manual/html_node/Snapshot-Files.html
 0	string		GNU\ tar-	GNU tar incremental snapshot data
diff --git a/magic/Magdir/gentoo b/magic/Magdir/gentoo
index 94b5dfc2..eb2bfa54 100644
--- a/magic/Magdir/gentoo
+++ b/magic/Magdir/gentoo
@@ -53,3 +53,28 @@
 0	string		\<?xml
 >0	search/512	\<catmetadata		Gentoo category metadata file
 >0	search/512	\<pkgmetadata		Gentoo package metadata file
+
+# Summary: Gentoo GLEP 78 binary package
+# Reference: https://www.gentoo.org/glep/glep-0078.html
+# Note: assumes the strict format
+# Submitted by: Michal Gorny <mgorny at gentoo.org>
+
+# GPKG uses ustar (or ustar-compatible GNU format) that starts with
+# a <directory>/gpkg-1 file
+257	string		ustar
+>0	search/100	/gpkg-1\0
+>>0	regex		[^/]+		Gentoo GLEP 78 (GPKG) binary package for "%s"
+!:mime	application/x-tar
+!:ext	tar
+# the logic below requires the gpkg-1 file to be empty
+>>>124	string	00000000000\0
+# determine the compression used by looking at the second member name
+>>>>512	search/100	.tar.
+>>>>>&0	string		gz\0		using gzip compression
+>>>>>&0	string		bz2\0		using bzip2 compression
+>>>>>&0	string		lz\0		using lzip compression
+>>>>>&0	string		lz4\0		using lz4 compression
+>>>>>&0	string		lzo\0		using lzo compression
+>>>>>&0	string		xz\0		using xz compression
+>>>>>&0	string		zst\0		using zstd compression
+>>>>(636.o+1024)	search/611	.sig\0	\b, signed
-- 
2.37.3



More information about the File mailing list