commit: 399931f2b988d2c997b5ee974c0a649e53597aa8 Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Fri Dec 27 08:23:18 2024 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Fri Dec 27 08:23:18 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=399931f2
sys-apps/file: fix detecting zip files Also, clean up eautoreconf use as a comment asked us to do with 5.46. Closes: https://bugs.gentoo.org/946957 Signed-off-by: Sam James <sam <AT> gentoo.org> .../file/{file-9999.ebuild => file-5.46-r1.ebuild} | 20 +++----- sys-apps/file/file-9999.ebuild | 19 +++----- sys-apps/file/files/file-5.46-zip.patch | 57 ++++++++++++++++++++++ 3 files changed, 72 insertions(+), 24 deletions(-) diff --git a/sys-apps/file/file-9999.ebuild b/sys-apps/file/file-5.46-r1.ebuild similarity index 88% copy from sys-apps/file/file-9999.ebuild copy to sys-apps/file/file-5.46-r1.ebuild index 84ced37c5487..592b6a25c65f 100644 --- a/sys-apps/file/file-9999.ebuild +++ b/sys-apps/file/file-5.46-r1.ebuild @@ -14,11 +14,11 @@ if [[ ${PV} == 9999 ]] ; then inherit autotools git-r3 else VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/file.asc - inherit autotools verify-sig + inherit libtool verify-sig SRC_URI="ftp://ftp.astron.com/pub/file/${P}.tar.gz" SRC_URI+=" verify-sig? ( ftp://ftp.astron.com/pub/file/${P}.tar.gz.asc )" - KEYWORDS="~alpha amd64 arm arm64 hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" BDEPEND="verify-sig? ( sec-keys/openpgp-keys-file )" fi @@ -60,21 +60,17 @@ QA_CONFIG_IMPL_DECL_SKIP=( makedev ) PATCHES=( "${FILESDIR}/file-5.43-seccomp-fstatat64-musl.patch" #789336, not upstream yet "${FILESDIR}/file-5.45-seccomp-sandbox.patch" - "${FILESDIR}/${P}-32-bit-time_t.patch" - "${FILESDIR}/${P}-32-bit-time_t-deux.patch" - "${FILESDIR}/${P}-weak-magic-shell.patch" #908401 + "${FILESDIR}/file-5.46-zip.patch" ) src_prepare() { default - #if [[ ${PV} == 9999 ]] ; then - # eautoreconf - #else - # elibtoolize - #fi - # Just for file-5.45-32-bit-time_t-deux.patch, drop in 5.46 - eautoreconf + if [[ ${PV} == 9999 ]] ; then + eautoreconf + else + elibtoolize + fi # Don't let python README kill main README, bug #60043 mv python/README.md python/README.python.md || die diff --git a/sys-apps/file/file-9999.ebuild b/sys-apps/file/file-9999.ebuild index 84ced37c5487..5372c6099bbb 100644 --- a/sys-apps/file/file-9999.ebuild +++ b/sys-apps/file/file-9999.ebuild @@ -14,11 +14,11 @@ if [[ ${PV} == 9999 ]] ; then inherit autotools git-r3 else VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/file.asc - inherit autotools verify-sig + inherit libtool verify-sig SRC_URI="ftp://ftp.astron.com/pub/file/${P}.tar.gz" SRC_URI+=" verify-sig? ( ftp://ftp.astron.com/pub/file/${P}.tar.gz.asc )" - KEYWORDS="~alpha amd64 arm arm64 hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" BDEPEND="verify-sig? ( sec-keys/openpgp-keys-file )" fi @@ -60,21 +60,16 @@ QA_CONFIG_IMPL_DECL_SKIP=( makedev ) PATCHES=( "${FILESDIR}/file-5.43-seccomp-fstatat64-musl.patch" #789336, not upstream yet "${FILESDIR}/file-5.45-seccomp-sandbox.patch" - "${FILESDIR}/${P}-32-bit-time_t.patch" - "${FILESDIR}/${P}-32-bit-time_t-deux.patch" - "${FILESDIR}/${P}-weak-magic-shell.patch" #908401 ) src_prepare() { default - #if [[ ${PV} == 9999 ]] ; then - # eautoreconf - #else - # elibtoolize - #fi - # Just for file-5.45-32-bit-time_t-deux.patch, drop in 5.46 - eautoreconf + if [[ ${PV} == 9999 ]] ; then + eautoreconf + else + elibtoolize + fi # Don't let python README kill main README, bug #60043 mv python/README.md python/README.python.md || die diff --git a/sys-apps/file/files/file-5.46-zip.patch b/sys-apps/file/files/file-5.46-zip.patch new file mode 100644 index 000000000000..d15d49459165 --- /dev/null +++ b/sys-apps/file/files/file-5.46-zip.patch @@ -0,0 +1,57 @@ +https://bugs.gentoo.org/946957 +https://bugs.astron.com/view.php?id=571 +https://github.com/file/file/commit/60b2032b96fc185b37fb0f2152e834efb2edad6e + +From 60b2032b96fc185b37fb0f2152e834efb2edad6e Mon Sep 17 00:00:00 2001 +From: Christos Zoulas <chris...@zoulas.com> +Date: Thu, 5 Dec 2024 19:41:12 +0000 +Subject: [PATCH] PR/571: jschleus: Some zip files are misclassified as data + +--- + magic/Magdir/archive | 25 +++++++++++++++---------- + 1 file changed, 15 insertions(+), 10 deletions(-) + +diff --git a/magic/Magdir/archive b/magic/Magdir/archive +index e6ff4570a..e560523cb 100644 +--- a/magic/Magdir/archive ++++ b/magic/Magdir/archive +@@ -1795,6 +1795,17 @@ + !:ext zip/cbz + + ++# Generic zip archives (Greg Roelofs, c/o zip-b...@wkuvx1.wku.edu) ++# Next line excludes specialized formats: ++0 name zipgeneric ++>4 beshort x Zip archive data, at least ++!:mime application/zip ++>4 use zipversion ++>4 beshort x to extract ++>8 beshort x \b, compression method= ++>8 use zipcompression ++>0x161 string WINZIP \b, WinZIP self-extracting ++ + 0 string PK\003\004 + !:strength +1 + # IOS/IPadOS IPA file (Zip archive) +@@ -2132,17 +2143,11 @@ + >>>>>>(-6.l) search/9000 kmp.json Keyman Compiled Package File + !:mime application/vnd.keyman.kmp+zip + !:ext kmp ++>>>>>+4 default x ++>>>>>>0 use zipgeneric + +-# Generic zip archives (Greg Roelofs, c/o zip-b...@wkuvx1.wku.edu) +-# Next line excludes specialized formats: + >>>>+4 default x +->>>>>4 beshort x Zip archive data, at least +-!:mime application/zip +->>>>>4 use zipversion +->>>>>4 beshort x to extract +->>>>>8 beshort x \b, compression method= +->>>>>8 use zipcompression +->>>>>0x161 string WINZIP \b, WinZIP self-extracting ++>>>>>0 use zipgeneric + + # Zip archives (Greg Roelofs, c/o zip-b...@wkuvx1.wku.edu) + 0 string PK\005\006 Zip archive data (empty) +