[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] gnu: Mark /gnu/store as needed for boot.
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH] gnu: Mark /gnu/store as needed for boot. |
Date: |
Mon, 16 Jan 2017 23:28:17 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
John Darrington <address@hidden> skribis:
> 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 ....
Pushed with tests as 384344198dcaa97847e66d3dd82f279ede08d690.
Thanks!
Ludo’.
- [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, 2017/01/16
- Re: [PATCH] gnu: Mark /gnu/store as needed for boot.,
Ludovic Courtès <=
- 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