From e465d9e19087ab150f7e31f21c09e4a147b93b36 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 20 Sep 2016 17:51:39 +0900 Subject: ui: Do not shadow '_' where it's used as a literal syntax match. Fixes compilation with Guile 2.1. Reported by Mu Lei. * guix/ui.scm (report-load-error) (warn-about-load-error, read/eval-package-expression): Use 'rest' instead of '_' as the pattern variable name. * gnu/packages.scm (%find-package): Likewise. * guix/scripts/build.scm (transform-package-inputs): Likewise. * guix/scripts/hash.scm (guix-hash): Likewise. * guix/scripts/import/gnu.scm (%options, guix-import-gnu): Likewise. * guix/scripts/import/nix.scm (guix-import-nix): Likewise. * guix/scripts/offload.scm (build-machines): Likewise. * guix/scripts/refresh.scm (%options): Likewise. * guix/scripts/substitute.scm (narinfo-signature->canonical-sexp): Likewise. --- guix/scripts/build.scm | 2 +- guix/scripts/hash.scm | 2 +- guix/scripts/import/gnu.scm | 6 +++--- guix/scripts/import/nix.scm | 4 ++-- guix/scripts/offload.scm | 4 ++-- guix/scripts/refresh.scm | 2 +- guix/scripts/substitute.scm | 2 +- guix/ui.scm | 8 ++++---- 8 files changed, 15 insertions(+), 15 deletions(-) (limited to 'guix') diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm index 86b95b4075..a9f649d2ee 100644 --- a/guix/scripts/build.scm +++ b/guix/scripts/build.scm @@ -195,7 +195,7 @@ (define replacements ((old new) (cons (specification->package old) (specification->package new))) - (_ + (x (leave (_ "invalid replacement specification: ~s~%") spec)))) replacement-specs)) diff --git a/guix/scripts/hash.scm b/guix/scripts/hash.scm index a57602ab51..a6eced92fb 100644 --- a/guix/scripts/hash.scm +++ b/guix/scripts/hash.scm @@ -149,5 +149,5 @@ (define (file-hash file) (lambda args (leave (_ "~a~%") (strerror (system-error-errno args)))))) - (_ + (x (leave (_ "wrong number of arguments~%")))))) diff --git a/guix/scripts/import/gnu.scm b/guix/scripts/import/gnu.scm index 92bd8305ea..66861f5837 100644 --- a/guix/scripts/import/gnu.scm +++ b/guix/scripts/import/gnu.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2014 Ludovic Courtès +;;; Copyright © 2014, 2016 Ludovic Courtès ;;; ;;; This file is part of GNU Guix. ;;; @@ -68,7 +68,7 @@ (define %options ((or "interactive" "always" "never") (alist-cons 'key-download (string->symbol arg) result)) - (_ + (x (leave (_ "unsupported policy: ~a~%") arg))))) %standard-import-options)) @@ -99,7 +99,7 @@ (define (parse-options) (with-error-handling (gnu->guix-package name #:key-download (assoc-ref opts 'key-download)))) - (_ + (x (leave (_ "wrong number of arguments~%")))))) ;;; gnu.scm ends here diff --git a/guix/scripts/import/nix.scm b/guix/scripts/import/nix.scm index dba053b313..05e6e4b85d 100644 --- a/guix/scripts/import/nix.scm +++ b/guix/scripts/import/nix.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2012, 2013 Ludovic Courtès +;;; Copyright © 2012, 2013, 2016 Ludovic Courtès ;;; Copyright © 2014 David Thompson ;;; ;;; This file is part of GNU Guix. @@ -86,5 +86,5 @@ (define (parse-options) (format #t ";; converted from ~a:~a~%~%" (location-file loc) (location-line loc)) expr)) - (_ + (x (leave (_ "wrong number of arguments~%")))))) diff --git a/guix/scripts/offload.scm b/guix/scripts/offload.scm index 7db0c9d610..b278f1e313 100644 --- a/guix/scripts/offload.scm +++ b/guix/scripts/offload.scm @@ -118,7 +118,7 @@ (define* (build-machines #:optional (file %machine-file)) (primitive-load file)))) (lambda args (match args - (('system-error . _) + (('system-error . rest) (let ((err (system-error-errno args))) ;; Silently ignore missing file since this is a common case. (if (= ENOENT err) @@ -129,7 +129,7 @@ (define* (build-machines #:optional (file %machine-file)) (let ((loc (source-properties->location properties))) (leave (_ "~a: ~a~%") (location->string loc) message))) - (_ + (x (leave (_ "failed to load machine file '~a': ~s~%") file args)))))) diff --git a/guix/scripts/refresh.scm b/guix/scripts/refresh.scm index b00ac98c96..84e2a8f2a6 100644 --- a/guix/scripts/refresh.scm +++ b/guix/scripts/refresh.scm @@ -105,7 +105,7 @@ (define %options ((or "interactive" "always" "never") (alist-cons 'key-download (string->symbol arg) result)) - (_ + (x (leave (_ "unsupported policy: ~a~%") arg))))) diff --git a/guix/scripts/substitute.scm b/guix/scripts/substitute.scm index 8827c45fb8..21e0613a8a 100755 --- a/guix/scripts/substitute.scm +++ b/guix/scripts/substitute.scm @@ -300,7 +300,7 @@ (define (narinfo-hash->sha256 hash) (define (narinfo-signature->canonical-sexp str) "Return the value of a narinfo's 'Signature' field as a canonical sexp." (match (string-split str #\;) - ((version _ sig) + ((version host-name sig) (let ((maybe-number (string->number version))) (cond ((not (number? maybe-number)) (leave (_ "signature version must be a number: ~s~%") diff --git a/guix/ui.scm b/guix/ui.scm index 452d16308e..eb85df3b18 100644 --- a/guix/ui.scm +++ b/guix/ui.scm @@ -247,7 +247,7 @@ (define* (report-load-error file args #:optional frame) "Report the failure to load FILE, a user-provided Scheme file. ARGS is the list of arguments received by the 'throw' handler." (match args - (('system-error . _) + (('system-error . rest) (let ((err (system-error-errno args))) (report-error (_ "failed to load '~a': ~a~%") file (strerror err)))) (('syntax-error proc message properties form . rest) @@ -264,7 +264,7 @@ (define (warn-about-load-error file args) ;FIXME: factorize with ↑ "Report the failure to load FILE, a user-provided Scheme file, without exiting. ARGS is the list of arguments received by the 'throw' handler." (match args - (('system-error . _) + (('system-error . rest) (let ((err (system-error-errno args))) (warning (_ "failed to load '~a': ~a~%") file (strerror err)))) (('syntax-error proc message properties form . rest) @@ -409,7 +409,7 @@ (define unit ("ZB" (expt 10 21)) ("YB" (expt 10 24)) ("" 1) - (_ + (x (leave (_ "unknown unit: ~a~%") unit))))))) (define (call-with-error-handling thunk) @@ -535,7 +535,7 @@ (define (read/eval-package-expression str) error." (match (read/eval str) ((? package? p) p) - (_ + (x (leave (_ "expression ~s does not evaluate to a package~%") str)))) -- cgit v1.2.3