Merge #222314: coreutils: 9.1 -> 9.3 and re-enable hole seeking

...into staging
This commit is contained in:
Vladimír Čunát 2023-05-30 08:45:42 +02:00
commit 46e7cd17da
No known key found for this signature in database
GPG Key ID: E747DF1F9575A3AA
2 changed files with 2 additions and 50 deletions

View File

@ -32,18 +32,13 @@ let
in
stdenv.mkDerivation rec {
pname = "coreutils" + (optionalString (!minimal) "-full");
version = "9.1";
version = "9.3";
src = fetchurl {
url = "mirror://gnu/coreutils/coreutils-${version}.tar.xz";
sha256 = "sha256-YaH0ENeLp+fzelpPUObRMgrKMzdUhKMlXt3xejhYBCM=";
hash = "sha256-rbz8/omSNbceh2jc8HzVMlILf1T5qAZIQ/jRmakEu6o=";
};
patches = lib.optionals (stdenv.isDarwin && stdenv.isx86_64) [
# Workaround for https://debbugs.gnu.org/cgi/bugreport.cgi?bug=51433
./disable-seek-hole.patch
];
postPatch = ''
# The test tends to fail on btrfs, f2fs and maybe other unusual filesystems.
sed '2i echo Skipping dd sparse test && exit 77' -i ./tests/dd/sparse.sh

View File

@ -1,43 +0,0 @@
diff --git a/src/copy.c b/src/copy.c
index cb9018f93..2a4ccc061 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -502,7 +502,7 @@ write_zeros (int fd, off_t n_bytes)
return true;
}
-#ifdef SEEK_HOLE
+#if 0
/* Perform an efficient extent copy, if possible. This avoids
the overhead of detecting holes in hole-introducing/preserving
copy, and thus makes copying sparse files much more efficient.
@@ -1095,7 +1095,7 @@ infer_scantype (int fd, struct stat const *sb,
&& ST_NBLOCKS (*sb) < sb->st_size / ST_NBLOCKSIZE))
return PLAIN_SCANTYPE;
-#ifdef SEEK_HOLE
+#if 0
scan_inference->ext_start = lseek (fd, 0, SEEK_DATA);
if (0 <= scan_inference->ext_start)
return LSEEK_SCANTYPE;
@@ -1377,7 +1377,7 @@ copy_reg (char const *src_name, char const *dst_name,
off_t n_read;
bool wrote_hole_at_eof = false;
if (! (
-#ifdef SEEK_HOLE
+#if 0
scantype == LSEEK_SCANTYPE
? lseek_copy (source_desc, dest_desc, buf, buf_size, hole_size,
scan_inference.ext_start, src_open_sb.st_size,
diff --git a/tests/seek-data-capable b/tests/seek-data-capable
index cc6372214..6e7a9ec1e 100644
--- a/tests/seek-data-capable
+++ b/tests/seek-data-capable
@@ -1,5 +1,7 @@
import sys, os, errno, platform
+sys.exit(1)
+
# Pass an _empty_ file
if len(sys.argv) != 2:
sys.exit(1)