* guix/ui.scm (run-guix-command): Can `resolve-interface' errors and
report them with `leave'. Parameterize `program-name' from here.
(guix-main): Remove parameterization of `program-name'.
* guix/ui.scm (define-diagnostic, warning, report-error, leave): Move
definitions before any use. Reported by Nikita Karetnikov.
(install-locale): Move back close to `initialize-guix'.
* guix/ui.scm (define-diagnostic): New macro, which is based on the
previous version of 'warning'.
(warning, leave): Redefine using 'define-diagnostic'.
(report-error): New macro.
(install-locale): Use 'warning' instead of 'format'.
(call-with-error-handling): Adjust 'leave'.
* gnu/packages.scm (package-files): Use 'warning' instead of 'format'.
* guix/gnu-maintenance.scm (http-fetch): Use 'warning' and 'leave'.
* guix/scripts/build.scm (derivations-from-package-expressions, guix-build):
Adjust 'leave'.
* guix/scripts/download.scm (guix-download): Adjust 'leave'.
* guix/scripts/gc.scm (size->number, %options): Adjust 'leave'.
* guix/scripts/package.scm (roll-back, guix-package): Adjust 'leave'.
* po/POTFILES.in: Add 'guix/gnu-maintenance.scm'.
* guix/derivations.scm (derivation-input-output-paths): New procedure.
(derivation-prerequisites-to-build): New `use-substitutes?' keyword
argument. Change two return the list of substitutable paths as a
second argument.
* guix/ui.scm (show-what-to-build): Turn `dry-run?' into a keyword
argument. New `use-substitutes?' keyword argument. Use `fold2' and
adjust to use both return values of
`derivation-prerequisites-to-build'. Display what will/would be
downloaded.
* guix/scripts/build.scm (guix-build): Adjust accordingly.
* guix/scripts/package.scm (guix-package): Likewise.
* tests/derivations.scm ("derivation-prerequisites-to-build and
substitutes"): New test.
* guix/ui.scm (program-name, guix-warning-port): New variables.
(warning): New macro.
(guix-main): Parametrize PROGRAM-NAME.
* guix/scripts/build.scm, guix/scripts/download.scm,
guix/scripts/gc.scm, guix/scripts/package.scm: Adjust to use `leave'
and `warning' consistently.
* guix/store.scm (&nix-connection-error): New condition type.
(open-connection): Translate `system-error' during the `connect' call
into `&nix-connection-error'.
* guix/ui.scm (call-with-error-handling): Add case for `nix-connection-error?'.
* guix/scripts/package.scm (guix-package): Move `open-connection' call
within `with-error-handling'.
* guix/scripts/pull.scm (guix-pull): Likewise.
* guix/scripts/download.scm (guix-download): Move body within
`with-error-handling'.
* guix/ui.scm (show-what-to-build): Return (length req*).
* guix/scripts/pull.scm (guix-pull): Print an "already up to date"
message when there's nothing to build.
* guix/scripts/pull.scm: New file.
* Makefile.am (MODULES): Add it.
* doc/guix.texi (Invoking guix pull): New node.
(Invoking guix package): Add cross-ref to it.
* guix/ui.scm (config-directory): New procedure.
* scripts/guix.in: When `GUIX_UNINSTALLED' is undefined, add
$XDG_CONFIG_HOME/guix/latest to the search path.
* po/POTFILES.in: Add guix/scripts/pull.scm.
* guix/ui.scm (fill-paragraph, string->recutils, package->recutils): New
procedures.
* guix-package.in (guix-package)[process-query]: Use `package->recutils'
to display package meta-data.
* tests/guix-package.sh: Adjust test.
* tests/ui.scm: New file.
* Makefile.am (TESTS): Add it.
* doc/guix.texi (Invoking guix-package): Adjust `--search'
documentation, and give an example.
* guix/ui.scm (install-locale): New procedure.
* guix-build.in, guix-download.in, guix-gc.in, guix-import.in,
guix-package.in: Use it instead of (setlocale LC_ALL "").
* guix/ui.scm: New file.
* Makefile.am (MODULES): Add it.
* po/POTFILES.in: Add it.
* guix-build.in: Use it.
(_, N_, leave): Remove.
(guix-build): Use `with-error-handling' instead of the `guard' form.
* guix-download.in: Use it.
(_, N_, leave): Remove.