diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2020-07-25 18:26:18 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2020-07-25 19:11:37 +0200 |
| commit | d51bfe242fbe6f3f8f71d723e8fe0c7bbe711ba1 (patch) | |
| tree | 6d8519ba2ab3e5475ff44dfa3a1c2aa9ec8a50b9 /gnu/services.scm | |
| parent | 252a1926bc7d7aa0b39d89a484c0c1b82e945fcd (diff) | |
Use 'formatted-message' instead of '&message' where appropriate.
* gnu.scm (%try-use-modules): Use 'formatted-message' instead of
'&message'.
* gnu/machine/digital-ocean.scm (maybe-raise-unsupported-configuration-error):
Likewise.
* gnu/machine/ssh.scm (machine-check-file-system-availability): Likewise.
(machine-check-building-for-appropriate-system): Likewise.
(deploy-managed-host): Likewise.
(maybe-raise-unsupported-configuration-error): Likewise.
* gnu/packages.scm (search-patch): Likewise.
* gnu/services.scm (%service-with-default-value): Likewise.
(files->etc-directory): Likewise.
(fold-services): Likewise.
* gnu/system.scm (locale-name->definition*): Likewise.
* gnu/system/mapped-devices.scm (check-device-initrd-modules): Likewise.
(check-luks-device): Likewise.
* guix/channels.scm (latest-channel-instance): Likewise.
* guix/cve.scm (json->cve-items): Likewise.
* guix/git-authenticate.scm (commit-signing-key): Likewise.
(commit-authorized-keys): Likewise.
(authenticate-commit): Likewise.
(verify-introductory-commit): Likewise.
* guix/remote.scm (remote-pipe-for-gexp): Likewise.
* guix/scripts/graph.scm (assert-package): Likewise.
* guix/scripts/offload.scm (private-key-from-file*): Likewise.
* guix/ssh.scm (authenticate-server*): Likewise.
(open-ssh-session): Likewise.
(remote-inferior): Likewise.
* guix/ui.scm (matching-generations): Likewise.
* guix/upstream.scm (package-update): Likewise.
* tests/channels.scm ("latest-channel-instances, missing introduction for 'guix'"):
Catch 'formatted-message?'.
("authenticate-channel, wrong first commit signer"): Likewise.
* tests/lint.scm ("patches: not found"): Adjust message string.
* tests/packages.scm ("patch not found yields a run-time error"): Catch
'formatted-message?'.
* guix/lint.scm (check-patch-file-names): Handle 'formatted-message?'.
(check-derivation): Ditto.
Diffstat (limited to 'gnu/services.scm')
| -rw-r--r-- | gnu/services.scm | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/gnu/services.scm b/gnu/services.scm index 6509a9014e4..399a432e3f9 100644 --- a/gnu/services.scm +++ b/gnu/services.scm | |||
| @@ -30,7 +30,7 @@ | |||
| 30 | #:use-module (guix describe) | 30 | #:use-module (guix describe) |
| 31 | #:use-module (guix sets) | 31 | #:use-module (guix sets) |
| 32 | #:use-module (guix ui) | 32 | #:use-module (guix ui) |
| 33 | #:use-module ((guix utils) #:select (source-properties->location)) | 33 | #:use-module (guix diagnostics) |
| 34 | #:autoload (guix openpgp) (openpgp-format-fingerprint) | 34 | #:autoload (guix openpgp) (openpgp-format-fingerprint) |
| 35 | #:use-module (guix modules) | 35 | #:use-module (guix modules) |
| 36 | #:use-module (gnu packages base) | 36 | #:use-module (gnu packages base) |
| @@ -242,13 +242,13 @@ TYPE does not have a default value, an error is raised." | |||
| 242 | (if (eq? default &no-default-value) | 242 | (if (eq? default &no-default-value) |
| 243 | (let ((location (source-properties->location location))) | 243 | (let ((location (source-properties->location location))) |
| 244 | (raise | 244 | (raise |
| 245 | (condition | 245 | (make-compound-condition |
| 246 | (&missing-value-service-error (type type) (location location)) | 246 | (condition |
| 247 | (&message | 247 | (&missing-value-service-error (type type) (location location))) |
| 248 | (message (format #f (G_ "~a: no value specified \ | 248 | (formatted-message (G_ "~a: no value specified \ |
| 249 | for service of type '~a'") | 249 | for service of type '~a'") |
| 250 | (location->string location) | 250 | (location->string location) |
| 251 | (service-type-name type))))))) | 251 | (service-type-name type))))) |
| 252 | (service type default)))) | 252 | (service type default)))) |
| 253 | 253 | ||
| 254 | (define-condition-type &service-error &error | 254 | (define-condition-type &service-error &error |
| @@ -725,10 +725,8 @@ and FILE could be \"/usr/bin/env\"." | |||
| 725 | (() #t) | 725 | (() #t) |
| 726 | (((file _) rest ...) | 726 | (((file _) rest ...) |
| 727 | (when (set-contains? seen file) | 727 | (when (set-contains? seen file) |
| 728 | (raise (condition | 728 | (raise (formatted-message (G_ "duplicate '~a' entry for /etc") |
| 729 | (&message | 729 | file))) |
| 730 | (message (format #f (G_ "duplicate '~a' entry for /etc") | ||
| 731 | file)))))) | ||
| 732 | (loop rest (set-insert file seen)))))) | 730 | (loop rest (set-insert file seen)))))) |
| 733 | 731 | ||
| 734 | ;; Detect duplicates early instead of letting them through, eventually | 732 | ;; Detect duplicates early instead of letting them through, eventually |
| @@ -1000,12 +998,12 @@ TARGET-TYPE; return the root service adjusted accordingly." | |||
| 1000 | vlist-null)) | 998 | vlist-null)) |
| 1001 | (() | 999 | (() |
| 1002 | (raise | 1000 | (raise |
| 1003 | (condition (&missing-target-service-error | 1001 | (make-compound-condition |
| 1004 | (service #f) | 1002 | (condition (&missing-target-service-error |
| 1005 | (target-type target-type)) | 1003 | (service #f) |
| 1006 | (&message | 1004 | (target-type target-type))) |
| 1007 | (message (format #f (G_ "service of type '~a' not found") | 1005 | (formatted-message (G_ "service of type '~a' not found") |
| 1008 | (service-type-name target-type))))))) | 1006 | (service-type-name target-type))))) |
| 1009 | (x | 1007 | (x |
| 1010 | (raise | 1008 | (raise |
| 1011 | (condition (&ambiguous-target-service-error | 1009 | (condition (&ambiguous-target-service-error |
