guix-devel
[Top][All Lists]
Advanced

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

[PATCH v2] gnu: u-boot: Use scandir.


From: Danny Milosavljevic
Subject: [PATCH v2] gnu: u-boot: Use scandir.
Date: Wed, 1 Feb 2017 16:16:52 +0100

* gnu/packages/u-boot.scm (make-u-boot-package): Modify.
---
 gnu/packages/u-boot.scm | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/u-boot.scm b/gnu/packages/u-boot.scm
index 3468fe5a7..e60e61db2 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,13 @@ 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-length (string-length "_defconfig")))
+                       (scandir "configs"
+                         (lambda (file-name)
+                           (when (string-suffix? "_defconfig" file-name)
+                             (format #t "- ~A\n"
+                                     (string-drop-right file-name
+                                                        suffix-length))))))
                      #f)))))
          (replace 'install
            (lambda* (#:key outputs make-flags #:allow-other-keys)



reply via email to

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