diff options
author | Ludovic Courtès <ludo@gnu.org> | 2013-05-14 13:37:21 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2013-05-14 13:37:21 +0200 |
commit | 2b8cf44fd9207c5e46b8fc1a000645bd3bc89baf (patch) | |
tree | d26c65c90e3c80e25619f312c3e3e1eee8c939e6 /guix | |
parent | e8b3afeb9234bca4a455272a6a831d7994d29b96 (diff) |
Fix "guix --help" on Guile 2.0.5.
Reported at <http://linuxfr.org/news/sortie-de-gnu-guix-0-2>.
* guix/ui.scm (command-files): Filter the result of `scandir' to make
sure only `.scm' files are present.
Diffstat (limited to 'guix')
-rw-r--r-- | guix/ui.scm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/guix/ui.scm b/guix/ui.scm index addc3ac334..ca0d4249ec 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -397,8 +397,14 @@ reporting." (compose (cut string-append <> "/guix/scripts") dirname))) + (define dot-scm? + (cut string-suffix? ".scm" <>)) + + ;; In Guile 2.0.5 `scandir' would return "." and ".." regardless even though + ;; they don't match `dot-scm?'. Work around it by doing additional + ;; filtering. (if directory - (scandir directory (cut string-suffix? ".scm" <>)) + (filter dot-scm? (scandir directory dot-scm?)) '())) (define (commands) |