[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] gnu: Mark /gnu/store as needed for boot.
From: |
John Darrington |
Subject: |
Re: [PATCH] gnu: Mark /gnu/store as needed for boot. |
Date: |
Mon, 16 Jan 2017 13:46:17 +0100 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Sun, Jan 15, 2017 at 11:24:30PM +0100, Ludovic Court??s wrote:
Then maybe this:
(define (file-system-needed-for-boot? fs)
(or (%file-system-needed-for-boot? fs)
(and (file-prefix? (file-system-needed-for-boot? fs)
(%store-directory))
(not (memq 'bind-mount (file-system-flags fs))))))
with:
--8<---------------cut here---------------start------------->8---
scheme@(guile-user)> (define (file-prefix? file1 file2)
(define not-slash
(char-set-complement (char-set #\/)))
(and (string-prefix? "/" file1)
(let loop ((file1 (string-tokenize file1
not-slash))
(file2 (string-tokenize file2
not-slash)))
(match file1
(()
#t)
((head1 tail1 ...)
(match file2
((head2 tail2 ...)
(and (string=? head1 head2)
(loop tail1 tail2)))
(()
#f)))))))
scheme@(guile-user)> (file-prefix? "/gn" "/gnu/store")
$13 = #f
scheme@(guile-user)> (file-prefix? "/gnu/store/foo" "/gnu/store")
$14 = #f
scheme@(guile-user)> (file-prefix? "/gnu/store" "/gnu/store")
$15 = #t
scheme@(guile-user)> (file-prefix? "/gnu" "/gnu/store")
$16 = #t
scheme@(guile-user)> (file-prefix? "/" "/gnu/store")
$17 = #t
--8<---------------cut here---------------end--------------->8---
This seems more natural to me than computing the set of prefixes like
???all-subpaths??? does.
WDYT?
If that???s fine with you I can commit this.
It looks fine to me. I haven't tested it ....
J'
--
Avoid eavesdropping. Send strong encrypted email.
PGP Public key ID: 1024D/2DE827B3
fingerprint = 8797 A26D 0854 2EAB 0285 A290 8A67 719C 2DE8 27B3
See http://sks-keyservers.net or any PGP keyserver for public key.
signature.asc
Description: Digital signature
- [PATCH] gnu: Mark /gnu/store as needed for boot., John Darrington, 2017/01/11
- [PATCH] gnu: Mark /gnu/store as needed for boot., John Darrington, 2017/01/11
- Re: [PATCH] gnu: Mark /gnu/store as needed for boot., Chris Marusich, 2017/01/13
- Re: [PATCH] gnu: Mark /gnu/store as needed for boot., Ludovic Courtès, 2017/01/14
- Re: [PATCH] gnu: Mark /gnu/store as needed for boot., Ludovic Courtès, 2017/01/15
- Re: [PATCH] gnu: Mark /gnu/store as needed for boot.,
John Darrington <=
- Re: [PATCH] gnu: Mark /gnu/store as needed for boot., Ludovic Courtès, 2017/01/16
- ABI break!, Ludovic Courtès, 2017/01/17
- Re: ABI break!, John Darrington, 2017/01/18
- Re: ABI break!, David Craven, 2017/01/18
- Re: ABI break!, Ludovic Courtès, 2017/01/18