From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:5f26::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id oJSlB+pZoWWOsgAAkFu2QA (envelope-from ) for ; Fri, 12 Jan 2024 16:25:30 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id AKHcBOpZoWWVUQEAqHPOHw (envelope-from ) for ; Fri, 12 Jan 2024 16:25:30 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=inria.fr header.s=dc header.b=ACj6hQwu; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=inria.fr (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1705073130; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=l98NbHAIy5j/ngFkhXxrEcMLEvDBm0FT7pI4qJ8HBks=; b=RJEBZ23BShUF2VbZ8hywnV+YCWbNG3jmj5ndS/m+drylwboclb7YKNqQv9bOoh2oZ+ed+o gc25vUQ3tKTLbhEmMU3pjZXCDkcnuFu8X/GPNsNmuUTJ/zogTb0Gg3mDqfJ9htuz/IpIxj LJZB5hqNb8qU757x1/FKSmDz6T/lAb5/wch6/xMS8naw8omFmaczxSDPkooK0baHTkhbiG 9DJWD85paw+kp5DzWK2T3EnT5I7+/Qug+FuIWRwxLvGV7S+ZGzcfMaRB8g25m6vXUPq1PM J4w7T8Y7G54Qj/UgPmkS8ha2TuuLf/h/KBlIWDu2hiAMB7sEP8F90M7v9JDUSg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=inria.fr header.s=dc header.b=ACj6hQwu; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=inria.fr (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1705073130; a=rsa-sha256; cv=none; b=XxMtrWIF7Z6Dwv2ssgeKzJtD2Z/A16l0MWVg6k+nPvpnkVSX7ztrnmQqOjFjN5DKSPsked a6UKBaSRzIjtJHJROn/PZxPECbRJNUfx0GLHZd7LXvle+YvwDVOpA+h56HLLMfmga3ThN/ ndImqrUBo7kQ8UMtGJj7MpeMC4+X9DIFSe7/n6cjUlxcZjcPxyd2Ijdd/Nl+hr9w1NE5BL KeuMXWu9ZscP8RRmdvyKDknWvx8PUn7luQuzK6JKjepbPPHLyQnUNXFUcvdOX/nPAAWJyz zAxBIHVLmKMlyhUdm/VqRDxqwWjAuJVM5613wTU0lz0tErx0CvD/cmiPt6dq5g== Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id C9C0E38A7C for ; Fri, 12 Jan 2024 16:25:29 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rOJP8-00052R-Sx; Fri, 12 Jan 2024 10:25:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOJP6-00050x-Nc for guix-patches@gnu.org; Fri, 12 Jan 2024 10:25:04 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rOJP6-0005n0-3X for guix-patches@gnu.org; Fri, 12 Jan 2024 10:25:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rOJP3-0001ty-TU for guix-patches@gnu.org; Fri, 12 Jan 2024 10:25:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68406] [PATCH core-updates] guix: build: Expand `copy-recursively'. Resent-From: Romain GARBAGE Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 12 Jan 2024 15:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 68406 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68406@debbugs.gnu.org Cc: Romain GARBAGE X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17050730707261 (code B ref -1); Fri, 12 Jan 2024 15:25:01 +0000 Received: (at submit) by debbugs.gnu.org; 12 Jan 2024 15:24:30 +0000 Received: from localhost ([127.0.0.1]:37233 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOJOX-0001t2-SO for submit@debbugs.gnu.org; Fri, 12 Jan 2024 10:24:30 -0500 Received: from lists.gnu.org ([2001:470:142::17]:54826) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rOJOU-0001sl-65 for submit@debbugs.gnu.org; Fri, 12 Jan 2024 10:24:28 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rOJOQ-0004a6-5I for guix-patches@gnu.org; Fri, 12 Jan 2024 10:24:22 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rOJOM-0005bF-Jf for guix-patches@gnu.org; Fri, 12 Jan 2024 10:24:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=l98NbHAIy5j/ngFkhXxrEcMLEvDBm0FT7pI4qJ8HBks=; b=ACj6hQwuENlwr38PZVoi6p1VRkt1SU4eqGq3fvbHJCB9IAjTtQK8FyjC 1A0XkpJ9OinuSeDuzTyk6V0KepUf8bS35qIvmMOUTNpBrN0oJ6vQF+B4t DCFZJWNVg4d8xBQO0y4BOS4y0AhpnvGzDKJuVwGMkjbnZAPZywAbzjiRt k=; Received-SPF: SoftFail (mail2-relais-roc.national.inria.fr: domain of romain.garbage@inria.fr is inclined to not designate 193.50.110.153 as permitted sender) identity=mailfrom; client-ip=193.50.110.153; receiver=mail2-relais-roc.national.inria.fr; envelope-from="romain.garbage@inria.fr"; x-sender="romain.garbage@inria.fr"; x-conformance=spf_only; x-record-type="v=spf1"; x-record-text="v=spf1 include:mailout.safebrands.com a:basic-mail.safebrands.com a:basic-mail01.safebrands.com a:basic-mail02.safebrands.com ip4:128.93.142.0/24 ip4:192.134.164.0/24 ip4:128.93.162.160 ip4:89.107.174.7 mx ~all" Received-SPF: None (mail2-relais-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@guix-A102.bordeaux.inria.fr) identity=helo; client-ip=193.50.110.153; receiver=mail2-relais-roc.national.inria.fr; envelope-from="romain.garbage@inria.fr"; x-sender="postmaster@guix-A102.bordeaux.inria.fr"; x-conformance=spf_only X-IronPort-AV: E=Sophos;i="6.04,189,1695679200"; d="scan'208";a="146369993" Received: from unknown (HELO guix-A102.bordeaux.inria.fr) ([193.50.110.153]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Jan 2024 16:24:12 +0100 From: Romain GARBAGE Date: Fri, 12 Jan 2024 16:24:04 +0100 Message-ID: <20240112152407.5691-1-romain.garbage@inria.fr> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=192.134.164.83; envelope-from=romain.garbage@inria.fr; helo=mail2-relais-roc.national.inria.fr X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Spam-Score: 3.61 X-Migadu-Queue-Id: C9C0E38A7C X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: 3.61 X-TUID: q2VsC2R1wFA+ * guix/build/utils.scm (copy-recursively): Add `select?' key. Change-Id: Icfe226164bb88dfede58ae24c15a98db9b696c3b --- guix/build/utils.scm | 42 ++++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 2352a627e9..7567eb9e4d 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -430,32 +430,38 @@ (define* (copy-recursively source destination (log (current-output-port)) (follow-symlinks? #f) (copy-file copy-file) - keep-mtime? keep-permissions?) - "Copy SOURCE directory to DESTINATION. Follow symlinks if FOLLOW-SYMLINKS? -is true; otherwise, just preserve them. Call COPY-FILE to copy regular files. -When KEEP-MTIME? is true, keep the modification time of the files in SOURCE on -those of DESTINATION. When KEEP-PERMISSIONS? is true, preserve file -permissions. Write verbose output to the LOG port." + keep-mtime? keep-permissions? + (select? (const #t))) + "Copy SOURCE directory to DESTINATION. Follow symlinks if FOLLOW-SYMLINKS? is +true; otherwise, just preserve them. Call COPY-FILE to copy regular files. When +KEEP-MTIME? is true, keep the modification time of the files in SOURCE on those of +DESTINATION. When KEEP-PERMISSIONS? is true, preserve file permissions. Write +verbose output to the LOG port. Call (SELECT? FILE STAT) for each entry in source, +where FILE is the entry's absolute file name and STAT is the result of 'lstat' (or +'stat' if FOLLOW-SYMLINKS? is true); exclude entries for which SELECT? does not +return true." (define strip-source (let ((len (string-length source))) (lambda (file) (substring file len)))) - (file-system-fold (const #t) ; enter? + (file-system-fold (lambda (file stat result) ; enter? + (select? file stat)) (lambda (file stat result) ; leaf (let ((dest (string-append destination (strip-source file)))) - (format log "`~a' -> `~a'~%" file dest) - (case (stat:type stat) - ((symlink) - (let ((target (readlink file))) - (symlink target dest))) - (else - (copy-file file dest) - (when keep-permissions? - (chmod dest (stat:perms stat))))) - (when keep-mtime? - (set-file-time dest stat)))) + (when (select? file stat) + (format log "`~a' -> `~a'~%" file dest) + (case (stat:type stat) + ((symlink) + (let ((target (readlink file))) + (symlink target dest))) + (else + (copy-file file dest) + (when keep-permissions? + (chmod dest (stat:perms stat))))) + (when keep-mtime? + (set-file-time dest stat))))) (lambda (dir stat result) ; down (let ((target (string-append destination (strip-source dir)))) -- 2.41.0