guix-patches
[Top][All Lists]
Advanced

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

[bug#54997] [PATCH 00/12] Add "least authority" program wrapper


From: Ludovic Courtès
Subject: [bug#54997] [PATCH 00/12] Add "least authority" program wrapper
Date: Tue, 26 Apr 2022 22:17:44 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)

Hi Thiago,

Thiago Jung Bauermann <bauermann@kolabnow.com> skribis:

> This is an awesome series! It will be yet another strength of Guix to
> have many services as possible (and even desktop apps, hopefully)
> isolated.

Thanks.  :-)

> Ludovic Courtès <ludo@gnu.org> writes:
>
>> +                             (define (read-graph port)
>> +                               ;; Return the list of references read from
>> +                               ;; PORT.  This is a stripped-down version of
>> +                               ;; 'read-reference-graph'.
>> +                               (let loop ((items '()))
>> +                                 (match (read-line port)
>> +                                   ((? eof-object?)
>> +                                    items)
>> +                                   ((? string? item)
>> +                                    (let ((deriver (read-line port))
>> +                                          (count
>> +                                           (string->number (read-line 
>> port))))
>> +                                      (drop-lines port count)
>> +                                      (loop (cons item items)))))))
>
> I'm sure I'm being dense, but I don't see how ‘item’ can change between
> iterations of this loop.

Each iteration reads a new line from PORT, an input port on a text file.

The file is created by guix-daemon and has a format like this:

     FILE
     DERIVER
     NUMBER-OF-REFERENCES
     REF1
     ...
     REFN

where each FILE is a store item (see store-copy.scm for details).

Here we only care about FILE and REF*.

> Which in my mind means that ‘read-graph’ can only return a list where
> the original ‘item’ argument from ‘references-file’ is repeated many
> times over. I ran the tests/gexp.scm test and all tests pass, so this
> code must be working...

I think it does!  :-)  It wouldn’t hurt to add a call to
‘delete-duplicates’ though.

Ludo’.





reply via email to

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