mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-26 22:38:07 -05:00
build-system/haskell: Fix package.conf parsing.
* guix/build/haskell-build-system.scm (register)[conf-depends]: Properly react to EOF while reading GHC package conf files.
This commit is contained in:
parent
afe9f40949
commit
252ddedd4b
1 changed files with 3 additions and 2 deletions
|
@ -192,7 +192,8 @@ (define (conf-depends conf-file)
|
||||||
(let loop ((collecting #f)
|
(let loop ((collecting #f)
|
||||||
(deps '()))
|
(deps '()))
|
||||||
(let* ((line (read-line port))
|
(let* ((line (read-line port))
|
||||||
(field (and=> (regexp-exec field-rx line)
|
(field (and=> (and (not (eof-object? line))
|
||||||
|
(regexp-exec field-rx line))
|
||||||
(cut match:substring <> 1))))
|
(cut match:substring <> 1))))
|
||||||
(cond
|
(cond
|
||||||
((and=> field (cut string=? <> "depends"))
|
((and=> field (cut string=? <> "depends"))
|
||||||
|
@ -200,7 +201,7 @@ (define (conf-depends conf-file)
|
||||||
;; so drop those characters. A line may list more than one .conf.
|
;; so drop those characters. A line may list more than one .conf.
|
||||||
(let ((d (string-tokenize (string-drop line 8))))
|
(let ((d (string-tokenize (string-drop line 8))))
|
||||||
(loop #t (append d deps))))
|
(loop #t (append d deps))))
|
||||||
((and collecting field)
|
((or (eof-object? line) (and collecting field))
|
||||||
(begin
|
(begin
|
||||||
(close-port port)
|
(close-port port)
|
||||||
(reverse! deps)))
|
(reverse! deps)))
|
||||||
|
|
Loading…
Reference in a new issue