This patch is needed in order to build Guix on a Btrfs file system. From da922703282b0d3b8837a99a9c7fdd32f1d20d49 Mon Sep 17 00:00:00 2001 From: Mark H Weaver Date: Tue, 9 Jan 2018 20:16:14 -0500 Subject: [PATCH] Remove nonportable check for files containing only zeroes. This check benefitted only one unlikely case (large files containing only zeroes, on systems that do not support SEEK_HOLE) and was based on an assumption about file system behavior that is not mandated by POSIX and no longer holds in practice, namely that for sufficiently large files, (st_blocks == 0) implies that the file contains only zeroes. Examples of file systems that violate this assumption include Linux's /proc file system and Btrfs. * src/sparse.c (sparse_scan_file_wholesparse): Remove this function. (sparse_scan_file_seek): Remove the initial check for files containing only zeroes. --- src/sparse.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/src/sparse.c b/src/sparse.c index d41c0ea..3de6560 100644 --- a/src/sparse.c +++ b/src/sparse.c @@ -261,26 +261,6 @@ sparse_scan_file_raw (struct tar_sparse_file *file) return tar_sparse_scan (file, scan_end, NULL); } -static bool -sparse_scan_file_wholesparse (struct tar_sparse_file *file) -{ - struct tar_stat_info *st = file->stat_info; - struct sp_array sp = {0, 0}; - - /* Note that this function is called only for truly sparse files of size >= 1 - block size (checked via ST_IS_SPARSE before). See the thread - http://www.mail-archive.com/bug-tar@gnu.org/msg04209.html for more info */ - if (ST_NBLOCKS (st->stat) == 0) - { - st->archive_file_size = 0; - sp.offset = st->stat.st_size; - sparse_add_map (st, &sp); - return true; - } - - return false; -} - #ifdef SEEK_HOLE /* Try to engage SEEK_HOLE/SEEK_DATA feature. */ static bool @@ -343,10 +323,6 @@ sparse_scan_file_seek (struct tar_sparse_file *file) static bool sparse_scan_file (struct tar_sparse_file *file) { - /* always check for completely sparse files */ - if (sparse_scan_file_wholesparse (file)) - return true; - switch (hole_detection) { case HOLE_DETECTION_DEFAULT: -- 2.15.1 d2'>grafts.scm
AgeCommit message (Expand)Author
2023-10-28grafts: Fix corner case involving multiple-output derivations....Fixes a bug that would occur with references to two outputs of the same derivation, with one of them referring to the other one. For example, the references of libreoffice include both mariadb:dev and mariadb:lib; additionally, mariadb:dev refers to mariadb:lib. In this case, the glibc graft would not be applied on one of the mariadb paths, and both the grafted and ungrafted glibc would end up in the closure of libreoffice. Fixes <https://issues.guix.gnu.org/66662>. * guix/grafts.scm (non-self-references): Simplify and include references to outputs of DRV other than OUTPUTS. (reference-origins): Simplify and possibly return outputs of DRV itself. (cumulative-grafts)[graft-origin?]: Add OUTPUT parameter and honor it. [dependency-grafts]: Adjust accordingly. * tests/grafts.scm ("graft-derivation, multiple outputs need to be replaced"): New test. Change-Id: Iac2005024ab7049037537b3af55298696ec90e3c Ludovic Courtès
2022-11-11grafts: Run with a UTF-8 locale....Fixes <https://issues.guix.gnu.org/55968>. Reported by Maxime Devos <maximedevos@telenet.be>. * guix/grafts.scm (%graft-with-utf8-locale?): New parameter. (graft-derivation/shallow)[glibc-locales, set-utf8-locale]: New variables. [build]: Use 'set-utf8-locale'. * tests/gexp.scm, tests/grafts.scm, tests/packages.scm: Set '%graft-with-utf8-locale?' to #f. Ludovic Courtès