* guix/derivations.scm (derivation->output-path,
derivation->output-paths): New procedures.
(derivation-path->output-path): Use 'derivation->output-path'.
(derivation-path->output-paths): Use 'derivation->output-paths'.
(derivation): Accept 'derivation?' objects as inputs. Return a single
value.
(build-derivations): New procedure.
(compiled-modules): Use 'derivation->output-paths'.
(build-expression->derivation)[source-path]: Add case for when the
input matches 'derivation?'.
[prologue]: Accept 'derivation?' objects in INPUTS.
[mod-dir, go-dir]: Use 'derivation->output-path'.
* guix/download.scm (url-fetch): Adjust to the single-value return.
* guix/packages.scm (package-output): Use 'derivation->output-path'.
* guix/scripts/build.scm (guix-build): When the argument is
'derivation-path?', pass it through 'read-derivation'.
Use 'derivation-file-name' to print out the .drv file names, and to
register them. Use 'derivation->output-path' instead of
'derivation-path->output-path'.
* guix/scripts/package.scm (roll-back): Adjust to the single-value
return.
(guix-package): Use 'derivation->output-path'.
* guix/ui.scm (show-what-to-build): Adjust to deal with 'derivation?'
objects instead of .drv file names.
* gnu/system/grub.scm (grub-configuration-file): Use
'derivation->output-path' instead of 'derivation-path->output-path'.
* gnu/system/vm.scm (qemu-image, system-qemu-image): Likewise.
* tests/builders.scm, tests/derivations.scm, tests/packages.scm,
tests/store.scm, tests/union.scm: Adjust to the new calling
convention.
* doc/guix.texi (Defining Packages, The Store, Derivations): Adjust
accordingly.
* guix/scripts/substitute-binary.scm (guix-substitute-binary)["--substitute"]:
Show the Nar size, when available.
* guix/ui.scm (show-what-to-build): Add 'TODO'.
Reported by Nikita Karetnikov and Cyril Roelandt.
* guix/ui.scm (show-what-to-build): Call `substitutable-path-info'
only when USE-SUBSTITUTES? is true.
* guix/ui.scm (define-diagnostic): Use `free-identifier=?' to compare
the user's input with `_' and `N-". This should fix builds with Guile 2.1.
Reported by Cojocaru Alexandru <xojoc@gmx.com>.
* guix/packages.scm (&package-cross-build-system-error): New condition type.
(package-cross-derivation): Raise &package-cross-build-system-error
when the build system doesn't support cross builds.
* guix/ui.scm (call-with-error-handling): Add
package-cross-build-system-error? case.
* tests/packages.scm ("package-cross-derivation, no cross builder"): New test.
* guix/ui.scm (show-guix-usage): Mention `guix --help'.
Suggested by Mark H. Weaver.
(run-guix-command): Invoke it when a command is not found.
(guix-main): Adjust accordingly.
* 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.