summary refs log tree commit diff
diff options
context:
space:
mode:
authorDanny Milosavljevic <dannym@scratchpost.org>2017-02-01 16:16:52 +0100
committerDanny Milosavljevic <dannym@scratchpost.org>2017-02-06 09:53:20 +0100
commit40c4e3bbdaec62ea27eded7bbdd90d0522ddbc97 (patch)
treecf70d3e16030f54a64f238e068144171cc198c6c
parent2d92eca15499b6a1aaaac3ecd63cdd2e5c39308f (diff)
downloadguix-40c4e3bbdaec62ea27eded7bbdd90d0522ddbc97.tar.gz
gnu: u-boot: Use scandir.
* gnu/packages/u-boot.scm (make-u-boot-package): Modify.
-rw-r--r--gnu/packages/u-boot.scm19
1 files changed, 10 insertions, 9 deletions
diff --git a/gnu/packages/u-boot.scm b/gnu/packages/u-boot.scm
index 3468fe5a78..685a258516 100644
--- a/gnu/packages/u-boot.scm
+++ b/gnu/packages/u-boot.scm
@@ -93,7 +93,8 @@ also initializes the boards (RAM etc).")
        ("cross-binutils" ,(cross-binutils triplet))
        ,@(package-native-inputs u-boot)))
     (arguments
-     `(#:test-target "test"
+     `(#:modules ((ice-9 ftw) (guix build utils) (guix build gnu-build-system))
+       #:test-target "test"
        #:make-flags
        (list "HOSTCC=gcc" (string-append "CROSS_COMPILE=" ,triplet "-"))
        #:phases
@@ -105,14 +106,14 @@ also initializes the boards (RAM etc).")
                    (zero? (apply system* "make" `(,@make-flags ,config-name)))
                    (begin
                      (display "Invalid board name. Valid board names are:")
-                     (let ((dir (opendir "configs"))
-                           (suffix-length (string-length "_defconfig")))
-                       (do ((file-name (readdir dir) (readdir dir)))
-                           ((eof-object? file-name))
-                         (when (string-suffix? "_defconfig" file-name)
-                           (format #t "- ~A\n"
-                                   (string-drop-right file-name suffix-length))))
-                       (closedir dir))
+                     (let ((suffix-len (string-length "_defconfig")))
+                       (scandir "configs"
+                                (lambda (file-name)
+                                  (when (string-suffix? "_defconfig" file-name)
+                                    (format #t
+                                            "- ~A\n"
+                                            (string-drop-right file-name
+                                                               suffix-len))))))
                      #f)))))
          (replace 'install
            (lambda* (#:key outputs make-flags #:allow-other-keys)