Merge pull request #247040 from trofi/file-update

file: 5.44 -> 5.45
This commit is contained in:
Adam Joseph 2023-08-16 04:59:53 +00:00 committed by GitHub
commit ffe4cde3b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 43 additions and 48 deletions

View file

@ -0,0 +1,38 @@
https://github.com/file/file/commit/218fdf813fd5ccecbb8887a1b62509cd1c6dd3a1.patch
From 218fdf813fd5ccecbb8887a1b62509cd1c6dd3a1 Mon Sep 17 00:00:00 2001
From: Christos Zoulas <christos@zoulas.com>
Date: Fri, 28 Jul 2023 14:38:25 +0000
Subject: [PATCH] deal with 32 bit time_t
---
src/file.h | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/src/file.h b/src/file.h
index 2e0494d2f..78f574ea1 100644
--- a/src/file.h
+++ b/src/file.h
@@ -27,7 +27,7 @@
*/
/*
* file.h - definitions for file(1) program
- * @(#)$File: file.h,v 1.247 2023/07/27 19:40:22 christos Exp $
+ * @(#)$File: file.h,v 1.248 2023/07/28 14:38:25 christos Exp $
*/
#ifndef __file_h__
@@ -159,9 +159,11 @@
/*
* Dec 31, 23:59:59 9999
* we need to make sure that we don't exceed 9999 because some libc
- * implementations like muslc crash otherwise
+ * implementations like muslc crash otherwise. If you are unlucky
+ * to be running on a system with a 32 bit time_t, then it is even less.
*/
-#define MAX_CTIME CAST(time_t, 0x3afff487cfULL)
+#define MAX_CTIME \
+ CAST(time_t, sizeof(time_t) > 4 ? 0x3afff487cfULL : 0x7fffffffULL)
#define FILE_BADSIZE CAST(size_t, ~0ul)
#define MAXDESC 64 /* max len of text description/MIME type */

View file

@ -7,29 +7,22 @@
stdenv.mkDerivation rec {
pname = "file";
version = "5.44";
version = "5.45";
src = fetchurl {
urls = [
"https://astron.com/pub/file/${pname}-${version}.tar.gz"
"https://distfiles.macports.org/file/${pname}-${version}.tar.gz"
];
sha256 = "sha256-N1HH+6jbyDHLjXzIr/IQNUWbjOUVXviwiAon0ChHXzs=";
hash = "sha256-/Jf1ECm7DiyfTjv/79r2ePDgOe6HK53lwAKm0Jx4TYI=";
};
outputs = [ "out" "dev" "man" ];
patches = [
# Backport fix to identification for pyzip files.
# Needed for strip-nondeterminism.
# https://salsa.debian.org/reproducible-builds/strip-nondeterminism/-/issues/20
./pyzip.patch
# Backport fix for --uncompress always detecting contents as "empty"
(fetchurl {
url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-apps/file/files/file-5.44-decompress-empty.patch?h=dfc57da515a2aaf085bea68267cc727f1bfaa691";
hash = "sha256-fUzRQAlLWczBmR5iA1Gk66mHjP40MJcMdgCtm2+u1SQ=";
})
# Upstream patch to fix 32-bit tests.
# Will be included in 5.46+ releases.
./32-bit-time_t.patch
];
strictDeps = true;

View file

@ -1,36 +0,0 @@
From dc71304b3b1fd2ed5f7098d59fb7f6ef10cfdc85 Mon Sep 17 00:00:00 2001
From: Christos Zoulas <christos@zoulas.com>
Date: Sat, 31 Dec 2022 20:24:08 +0000
Subject: [PATCH] pyzip improvements (FC Stegerman)
---
magic/Magdir/archive | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/magic/Magdir/archive b/magic/Magdir/archive
index a706556d5..d58201e69 100644
--- a/magic/Magdir/archive
+++ b/magic/Magdir/archive
@@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
-# $File: archive,v 1.179 2022/12/21 15:50:59 christos Exp $
+# $File: archive,v 1.180 2022/12/31 20:24:08 christos Exp $
# archive: file(1) magic for archive formats (see also "msdos" for self-
# extracting compressed archives)
#
@@ -1876,9 +1876,14 @@
# https://en.wikipedia.org/wiki/ZIP_(file_format)#End_of_central_directory_record_(EOCD)
# by Michal Gorny <mgorny@gentoo.org>
-2 uleshort 0
->&-22 string PK\005\006 Zip archive, with extra data prepended
+>&-22 string PK\005\006
+# without #!
+>>0 string !#! Zip archive, with extra data prepended
!:mime application/zip
!:ext zip/cbz
+# with #!
+>>0 string/w #!\ a
+>>>&-1 string/T x %s script executable (Zip archive)
# ACE archive (from http://www.wotsit.org/download.asp?f=ace)
# by Stefan `Sec` Zehl <sec@42.org>