emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#68406: closed ([PATCH core-updates] guix: build: Expand `copy-recurs


From: GNU bug Tracking System
Subject: bug#68406: closed ([PATCH core-updates] guix: build: Expand `copy-recursively'.)
Date: Sun, 21 Jan 2024 22:58:02 +0000

Your message dated Sun, 21 Jan 2024 17:57:38 -0500
with message-id <877ck28fbx.fsf@gmail.com>
and subject line Re: bug#68406: [PATCH core-updates] guix: build: Expand 
`copy-recursively'.
has caused the debbugs.gnu.org bug report #68406,
regarding [PATCH core-updates] guix: build: Expand `copy-recursively'.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs@gnu.org.)


-- 
68406: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68406
GNU Bug Tracking System
Contact help-debbugs@gnu.org with problems
--- Begin Message --- Subject: [PATCH core-updates] guix: build: Expand `copy-recursively'. Date: Fri, 12 Jan 2024 16:24:04 +0100
* 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




--- End Message ---
--- Begin Message --- Subject: Re: bug#68406: [PATCH core-updates] guix: build: Expand `copy-recursively'. Date: Sun, 21 Jan 2024 17:57:38 -0500 User-agent: Gnus/5.13 (Gnus v5.13)
Hi!

Romain GARBAGE <romain.garbage@inria.fr> writes:

> * guix/build/utils.scm (copy-recursively): Add `select?' key.

Applied to core-updates.

-- 
Thanks,
Maxim


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]