summary refs log tree commit diff
diff options
context:
space:
mode:
authorSergei Trofimovich <slyich@gmail.com>2023-08-03 23:21:21 +0100
committerSergei Trofimovich <slyich@gmail.com>2023-08-04 17:12:00 +0100
commitb48e3ae9c265a554e31dca9aa0fcce8c287b0a71 (patch)
treeb23d05efd06ca38142dd5830cb6bf10a3a204c82
parent0878b757bf068da9e72752854521a1c1d89394c4 (diff)
downloadnixpkgs-b48e3ae9c265a554e31dca9aa0fcce8c287b0a71.tar
nixpkgs-b48e3ae9c265a554e31dca9aa0fcce8c287b0a71.tar.gz
nixpkgs-b48e3ae9c265a554e31dca9aa0fcce8c287b0a71.tar.bz2
nixpkgs-b48e3ae9c265a554e31dca9aa0fcce8c287b0a71.tar.lz
nixpkgs-b48e3ae9c265a554e31dca9aa0fcce8c287b0a71.tar.xz
nixpkgs-b48e3ae9c265a554e31dca9aa0fcce8c287b0a71.tar.zst
nixpkgs-b48e3ae9c265a554e31dca9aa0fcce8c287b0a71.zip
file: 5.44 -> 5.45
Changes: https://github.com/file/file/compare/FILE5_44...FILE5_45
-rw-r--r--pkgs/tools/misc/file/32-bit-time_t.patch38
-rw-r--r--pkgs/tools/misc/file/default.nix17
-rw-r--r--pkgs/tools/misc/file/pyzip.patch36
3 files changed, 43 insertions, 48 deletions
diff --git a/pkgs/tools/misc/file/32-bit-time_t.patch b/pkgs/tools/misc/file/32-bit-time_t.patch
new file mode 100644
index 00000000000..19c595215d6
--- /dev/null
+++ b/pkgs/tools/misc/file/32-bit-time_t.patch
@@ -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 */
diff --git a/pkgs/tools/misc/file/default.nix b/pkgs/tools/misc/file/default.nix
index 45f5ed90577..589e5071da9 100644
--- a/pkgs/tools/misc/file/default.nix
+++ b/pkgs/tools/misc/file/default.nix
@@ -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;
diff --git a/pkgs/tools/misc/file/pyzip.patch b/pkgs/tools/misc/file/pyzip.patch
deleted file mode 100644
index 57f9e7ef8b6..00000000000
--- a/pkgs/tools/misc/file/pyzip.patch
+++ /dev/null
@@ -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>