guix-commits
[Top][All Lists]
Advanced

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

branch master updated: store: deduplication: Handle fs without d_type su


From: guix-commits
Subject: branch master updated: store: deduplication: Handle fs without d_type support.
Date: Tue, 28 Jul 2020 08:10:41 -0400

This is an automated email from the git hooks/post-receive script.

mothacehe pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 8b221b6  store: deduplication: Handle fs without d_type support.
8b221b6 is described below

commit 8b221b64a552d31e241701aa5c6d339287a7a15b
Author: Mathieu Othacehe <othacehe@gnu.org>
AuthorDate: Tue Jul 28 14:05:09 2020 +0200

    store: deduplication: Handle fs without d_type support.
    
    scandir* uses readdir, which means that the file type property can be 
'unknown
    if the underlying file-system does not support d_type. Make sure to fallback
    to lstat in that case.
    
    Fixes: https://issues.guix.gnu.org/issue/42579.
    
    * guix/store/deduplication.scm (deduplicate): Handle the case where 
properties
    is 'unknown because the underlying file-system does not support d_type.
---
 guix/store/deduplication.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/guix/store/deduplication.scm b/guix/store/deduplication.scm
index a742a14..df959bd 100644
--- a/guix/store/deduplication.scm
+++ b/guix/store/deduplication.scm
@@ -164,8 +164,10 @@ under STORE."
                     ((file . properties)
                      (unless (member file '("." ".."))
                        (let* ((file (string-append path "/" file))
-                              (type (or (assq-ref properties 'type)
-                                        (stat:type (lstat file)))))
+                              (type (match (assoc-ref properties 'type)
+                                      ((or 'unknown #f)
+                                       (stat:type (lstat file)))
+                                      (type type))))
                          (loop file type
                                (and (not (eq? 'directory type))
                                     (nar-sha256 file)))))))



reply via email to

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