GNU bug report logs - #28281
[PATCH] gnu: Add os-prober.

Previous Next

Package: guix-patches;

Reported by: Arun Isaac <arunisaac <at> systemreboot.net>

Date: Tue, 29 Aug 2017 19:08:02 UTC

Severity: normal

Tags: patch

Done: Arun Isaac <arunisaac <at> systemreboot.net>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: ludo <at> gnu.org (Ludovic Courtès)
To: Arun Isaac <arunisaac <at> systemreboot.net>
Cc: 28281 <at> debbugs.gnu.org
Subject: [bug#28281] [PATCH] gnu: Add os-prober.
Date: Sun, 10 Sep 2017 22:41:37 +0200
Arun Isaac <arunisaac <at> systemreboot.net> skribis:

>>>> +         (replace 'install
>>>> +           (lambda* (#:key outputs #:allow-other-keys)
>>>> +             (define (find-files-non-recursive directory)
>>>> +               (find-files directory
>>>> +                           (lambda (file stat)
>>>> +                             (string-match (string-append "^" directory "/[^/]*$")
>>>> +                                           file))
>>>> +                           #:directories? #t))
>>>
>>> Do you think it would be a good idea to add a #:recursive? keyword
>>> argument to `find-files' in (guix build utils), instead of creating this
>>> `find-files-non-recursive-function' here?
>>
>> Hmm I didn’t understand that it *had* to be non-recursive.  Does it
>> really make a difference?
>
> I am trying to do
>
> cp -r /some/directory/* destination
>
> To do this, I used `find-files-non-recursive' to get all files in
> /some/directory/ and applied `copy-recursively' on each one of them.
>
> Do you have a better way of doing this in mind?

Would (copy-recursively "/some/directory" destination) work for you?

>> If it does, then ‘scandir’ from (ice-9 ftw) would be the thing.  Sorry
>> if I led you in the wrong direction.  :-/
>
> Yes, scandir could be used. But, it also returns "." and "..", and I'll
> have to filter them out. So code length, or clarity-wise, it won't be
> much of an improvement. That is why I thought adding a #:recursive?
> argument to `find-files' would be nice.

Yeah, looks like none of the options is a perfect match.

HTH,
LUdo’.




This bug report was last modified 7 years and 253 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.