From 57075ade97e58eded5657ec74e5516d58f15eda6 Mon Sep 17 00:00:00 2001 From: Federico Beffa Date: Sat, 11 Feb 2017 18:18:45 +0100 Subject: import: stackage: Avoid using (guix ui) in importer code. * guix/import/stackage.scm (stackage->guix-package, stackage-lts-info-fetch): Raise 'message' condition instead of using 'leave' from (guix ui). * guix/scripts/import/stackage.scm (guix-import-stackage): Handle conditions. --- guix/scripts/import/stackage.scm | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'guix/scripts') diff --git a/guix/scripts/import/stackage.scm b/guix/scripts/import/stackage.scm index cf47bff259..f91b496d24 100644 --- a/guix/scripts/import/stackage.scm +++ b/guix/scripts/import/stackage.scm @@ -98,15 +98,16 @@ Import and convert the LTS Stackage package for PACKAGE-NAME.\n")) (reverse opts)))) (match args ((package-name) - (let ((sexp (stackage->guix-package - package-name - #:include-test-dependencies? - (assoc-ref opts 'include-test-dependencies?) - #:lts-version (assoc-ref opts 'lts-version)))) - (unless sexp - (leave (_ "failed to download cabal file for package '~a'~%") - package-name)) - sexp)) + (with-error-handling + (let ((sexp (stackage->guix-package + package-name + #:include-test-dependencies? + (assoc-ref opts 'include-test-dependencies?) + #:lts-version (assoc-ref opts 'lts-version)))) + (unless sexp + (leave (_ "failed to download cabal file for package '~a'~%") + package-name)) + sexp))) (() (leave (_ "too few arguments~%"))) ((many ...) -- cgit v1.2.3