mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
git-download: Fix 'git-predicate' file membership.
Previously, it the predicate would return #t for "m4/ChangeLog" if "ChangeLog" (in the top-level directory) was in FILES. This commit fixes the ambiguity. * guix/git-download.scm (git-predicate): Add 'inodes' variable. Use it to determine file membership.
This commit is contained in:
parent
4da1816628
commit
ba2260dbbc
1 changed files with 8 additions and 2 deletions
|
@ -145,6 +145,10 @@ (define (parent-directory? thing directory)
|
||||||
(reverse lines))
|
(reverse lines))
|
||||||
(line
|
(line
|
||||||
(loop (cons line lines))))))
|
(loop (cons line lines))))))
|
||||||
|
(inodes (map (lambda (file)
|
||||||
|
(let ((stat (lstat file)))
|
||||||
|
(cons (stat:dev stat) (stat:ino stat))))
|
||||||
|
files))
|
||||||
(status (close-pipe pipe)))
|
(status (close-pipe pipe)))
|
||||||
(and (zero? status)
|
(and (zero? status)
|
||||||
(lambda (file stat)
|
(lambda (file stat)
|
||||||
|
@ -155,8 +159,10 @@ (define (parent-directory? thing directory)
|
||||||
(any (lambda (f) (parent-directory? f file))
|
(any (lambda (f) (parent-directory? f file))
|
||||||
files))
|
files))
|
||||||
((or 'regular 'symlink)
|
((or 'regular 'symlink)
|
||||||
(any (lambda (f) (string-suffix? f file))
|
;; Comparing file names is always tricky business so we rely on
|
||||||
files))
|
;; inode numbers instead
|
||||||
|
(member (cons (stat:dev stat) (stat:ino stat))
|
||||||
|
inodes))
|
||||||
(_
|
(_
|
||||||
#f))))))
|
#f))))))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue