Hi Danny, Danny Milosavljevic <dan...@scratchpost.org> skribis:
> * gnu/packages/u-boot.scm (make-u-boot-package): Modify. > (replace 'configure > (lambda* (#:key outputs make-flags #:allow-other-keys) > + (use-modules ((ice-9 ftw))) > (let ((config-name (string-append ,board "_defconfig"))) > (if (file-exists? (string-append "configs/" config-name)) > (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)))))) Using ‘scandir’ is a good idea. Minor point: please write (arguments '(#:modules ((ice-9 ftw) …) …)) instead of the inner ‘use-modules’ form (which is not guaranteed to work with future Guile versions.) Also the second argument to ‘scandir’ should be aligned with the first. :-) OK with these changes, thank you! Ludo’.