guix import: Print list of expressions.
* guix/scripts/import.scm (guix-import): Print list of expressions.
This commit is contained in:
parent
64ce53eb5e
commit
d68ba5f483
|
@ -107,10 +107,17 @@ Run IMPORTER with ARGS.\n"))
|
||||||
(show-version-and-exit "guix import"))
|
(show-version-and-exit "guix import"))
|
||||||
((importer args ...)
|
((importer args ...)
|
||||||
(if (member importer importers)
|
(if (member importer importers)
|
||||||
(match (apply (resolve-importer importer) args)
|
(let ((print (lambda (expr)
|
||||||
((and expr ('package _ ...))
|
(pretty-print expr (newline-rewriting-port
|
||||||
(pretty-print expr (newline-rewriting-port
|
(current-output-port))))))
|
||||||
(current-output-port))))
|
(match (apply (resolve-importer importer) args)
|
||||||
(x
|
((and expr ('package _ ...))
|
||||||
(leave (_ "'~a' import failed~%") importer)))
|
(print expr))
|
||||||
|
((? list? expressions)
|
||||||
|
(for-each (lambda (expr)
|
||||||
|
(print expr)
|
||||||
|
(newline))
|
||||||
|
expressions))
|
||||||
|
(x
|
||||||
|
(leave (_ "'~a' import failed~%") importer))))
|
||||||
(leave (_ "~a: invalid importer~%") importer)))))
|
(leave (_ "~a: invalid importer~%") importer)))))
|
||||||
|
|
Loading…
Reference in New Issue