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: Arun Isaac <arunisaac <at> systemreboot.net>
To: 28281 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: [bug#28281] [PATCH] gnu: Add os-prober.
Date: Sat, 09 Sep 2017 22:54:27 +0530
Here's an updated patch.

> +         (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?

> +             (let* ((out (assoc-ref outputs "out"))
> +                    (bin (string-append out "/bin"))
> +                    (lib (string-append out "/lib"))
> +                    (share (string-append out "/share")))
> +               (for-each (cut install-file <> bin)
> +                         (list "linux-boot-prober" "os-prober"))
> +               (install-file "newns" (string-append lib "/os-prober"))
> +               (install-file "common.sh" (string-append share "/os-prober"))
> +               (install-file "os-probes/mounted/powerpc/20macosx"
> +                             (string-append lib "/os-probes/mounted"))
> +               (for-each
> +                (lambda (directory)
> +                  (for-each
> +                   (lambda (file)
> +                     (let ((destination (string-append lib "/" directory
> +                                                       "/" (basename file))))
> +                       (mkdir-p (dirname destination))
> +                       (copy-recursively file destination)))
> +                   (append (find-files-non-recursive (string-append directory "/common"))
> +                           (find-files-non-recursive (string-append directory "/x86")))))
> +                (list "os-probes" "os-probes/mounted" "os-probes/init"
> +                      "linux-boot-probes" "linux-boot-probes/mounted"))
> +               #t))))))

I have used `find-files' instead of `ftw', as you suggested. The install
procedure is clearer now. but still remains quite messy. It is not
simple enough to separate the "candidate-files" and "install-file"
logic.

WDYT? Will the above code do?




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.