diff options
author | Marius Bakke <mbakke@fastmail.com> | 2018-05-06 15:56:24 +0200 |
---|---|---|
committer | Marius Bakke <mbakke@fastmail.com> | 2018-05-06 15:56:24 +0200 |
commit | 12bd588346f8b2fb3709acfe0ee89d153da2db34 (patch) | |
tree | 459d8eb13a0508170ba462fe61a8b45fb55ea79f /guix/scripts | |
parent | 7d5adf013127c89826e9fbe9f1a67265b3538609 (diff) | |
parent | 8e020519b45bbdb9403164bd4403f2465bac99ad (diff) | |
download | gnu-guix-12bd588346f8b2fb3709acfe0ee89d153da2db34.tar gnu-guix-12bd588346f8b2fb3709acfe0ee89d153da2db34.tar.gz |
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/scripts')
-rw-r--r-- | guix/scripts/build.scm | 76 | ||||
-rw-r--r-- | guix/scripts/system/search.scm | 7 | ||||
-rw-r--r-- | guix/scripts/weather.scm | 8 |
3 files changed, 47 insertions, 44 deletions
diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index 401087e830..4dd4fbccdf 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -661,43 +661,47 @@ build." (define system (assoc-ref opts 'system)) (define graft? (assoc-ref opts 'graft?)) - (parameterize ((%graft? graft?)) - (append-map (match-lambda - ((? package? p) - (let ((p (or (and graft? (package-replacement p)) p))) - (match src - (#f - (list (package->derivation store p system))) - (#t - (match (package-source p) - (#f - (format (current-error-port) - (G_ "~a: warning: \ + ;; We may get 'unbound-variable' errors while evaluating the 'inputs' fields + ;; of user packages. Since 'guix build' is the primary tool for people + ;; testing new packages, report such errors gracefully. + (with-unbound-variable-handling + (parameterize ((%graft? graft?)) + (append-map (match-lambda + ((? package? p) + (let ((p (or (and graft? (package-replacement p)) p))) + (match src + (#f + (list (package->derivation store p system))) + (#t + (match (package-source p) + (#f + (format (current-error-port) + (G_ "~a: warning: \ package '~a' has no source~%") - (location->string (package-location p)) - (package-name p)) - '()) - (s - (list (package-source-derivation store s))))) - (proc - (map (cut package-source-derivation store <>) - (proc p)))))) - ((? derivation? drv) - (list drv)) - ((? procedure? proc) - (list (run-with-store store - (mbegin %store-monad - (set-guile-for-build (default-guile)) - (proc)) - #:system system))) - ((? gexp? gexp) - (list (run-with-store store - (mbegin %store-monad - (set-guile-for-build (default-guile)) - (gexp->derivation "gexp" gexp - #:system system)))))) - (map (cut transform store <>) - (options->things-to-build opts))))) + (location->string (package-location p)) + (package-name p)) + '()) + (s + (list (package-source-derivation store s))))) + (proc + (map (cut package-source-derivation store <>) + (proc p)))))) + ((? derivation? drv) + (list drv)) + ((? procedure? proc) + (list (run-with-store store + (mbegin %store-monad + (set-guile-for-build (default-guile)) + (proc)) + #:system system))) + ((? gexp? gexp) + (list (run-with-store store + (mbegin %store-monad + (set-guile-for-build (default-guile)) + (gexp->derivation "gexp" gexp + #:system system)))))) + (map (cut transform store <>) + (options->things-to-build opts)))))) (define (show-build-log store file urls) "Show the build log for FILE, falling back to remote logs from URLS if diff --git a/guix/scripts/system/search.scm b/guix/scripts/system/search.scm index 7229c60a02..955cdd1e95 100644 --- a/guix/scripts/system/search.scm +++ b/guix/scripts/system/search.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017, 2018 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org> ;;; ;;; This file is part of GNU Guix. ;;; @@ -59,10 +60,8 @@ provided TYPE has a default value." (define (service-type-shepherd-names type) "Return the default names of Shepherd services created for TYPE." - (match (map shepherd-service-provision - (service-type-default-shepherd-services type)) - (((names . _) ...) - names))) + (append-map shepherd-service-provision + (service-type-default-shepherd-services type))) (define* (service-type->recutils type port #:optional (width (%text-width)) diff --git a/guix/scripts/weather.scm b/guix/scripts/weather.scm index 5c934abaef..d7c2fbea10 100644 --- a/guix/scripts/weather.scm +++ b/guix/scripts/weather.scm @@ -208,10 +208,10 @@ unavailable)~%")) 0 queue))) (newline) (unless (null? missing) - (let ((missing (length missing))) - (match (queued-subset queue missing) - (#f #f) - ((= length queued) + (match (queued-subset queue missing) + (#f #f) + ((= length queued) + (let ((missing (length missing))) (format #t (G_ " ~,1f% (~h out of ~h) of the missing items \ are queued~%") (* 100. (/ queued missing)) |