diff options
author | Federico Beffa <beffa@fbengineering.ch> | 2017-02-11 18:18:45 +0100 |
---|---|---|
committer | Federico Beffa <beffa@fbengineering.ch> | 2017-02-14 08:38:45 +0100 |
commit | 57075ade97e58eded5657ec74e5516d58f15eda6 (patch) | |
tree | b0c753d829f85efb00c6991e8443f3e5f7a3b504 /guix/import | |
parent | 4fc282b32a16946d423cdbbdd7ee94d025d3b9f5 (diff) | |
download | gnu-guix-57075ade97e58eded5657ec74e5516d58f15eda6.tar gnu-guix-57075ade97e58eded5657ec74e5516d58f15eda6.tar.gz |
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.
Diffstat (limited to 'guix/import')
-rw-r--r-- | guix/import/stackage.scm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/guix/import/stackage.scm b/guix/import/stackage.scm index 542b718083..5b25adc674 100644 --- a/guix/import/stackage.scm +++ b/guix/import/stackage.scm @@ -21,12 +21,13 @@ #:use-module (ice-9 regex) #:use-module (srfi srfi-1) #:use-module (srfi srfi-26) + #:use-module (srfi srfi-34) + #:use-module (srfi srfi-35) #:use-module (guix import json) #:use-module (guix import hackage) #:use-module (guix memoization) #:use-module (guix packages) #:use-module (guix upstream) - #:use-module (guix ui) #:export (stackage->guix-package %stackage-updater)) @@ -49,6 +50,9 @@ ((_ ("packages" pkg ...)) pkg) (_ '()))) +(define (leave-with-message fmt . args) + (raise (condition (&message (message (apply format #f fmt args)))))) + (define stackage-lts-info-fetch ;; "Retrieve the information about the LTS Stackage release VERSION." (memoize @@ -59,7 +63,7 @@ (lts-info (json-fetch url))) (if lts-info (reverse lts-info) - (leave (_ "LTS release version not found: ~A~%") version)))))) + (leave-with-message "LTS release version not found: ~a" version)))))) (define (stackage-package-name pkg-info) (assoc-ref pkg-info "name")) @@ -99,7 +103,7 @@ included in the Stackage LTS release." (hackage->guix-package name-version #:include-test-dependencies? include-test-dependencies?) - (leave (_ "package not found: ~A~%") package-name)))) + (leave-with-message "~a: Stackage package not found" package-name)))) ;;; |