summaryrefslogtreecommitdiff
path: root/guix/ui.scm
AgeCommit message (Collapse)Author
2014-10-12profiles: Add condition types for profiles and generations.Alex Kost
Suggested by Ludovic Courtès. * guix/profiles.scm (&profile-error, &profile-not-found-error, &missing-generation-error): New condition types. * guix/ui.scm (call-with-error-handling): Handle new types. * guix/scripts/package.scm (roll-back, guix-package): Raise '&profile-not-found-error' where needed.
2014-10-10ui: Move 'show-manifest-transaction' from (guix profiles).Alex Kost
* guix/profiles.scm: Do not use (guix ui) module. (right-arrow, manifest-show-transaction): Move and rename to... * guix/ui.scm (right-arrow, show-manifest-transaction): ... here. * tests/profiles.scm ("manifest-show-transaction"): Move to... * tests/ui.scm ("show-manifest-transaction"): ... here. (guile-1.8.8, guile-2.0.9): New variables. * emacs/guix-main.scm (process-package-actions): Rename 'manifest-show-transaction' to 'show-manifest-transaction'. * guix/scripts/package.scm (guix-package): Likewise. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2014-10-09ui: Make sure we use the right domain for &message translation.Ludovic Courtès
* guix/ui.scm (call-with-error-handling): Add %GETTEXT-DOMAIN as a second argument to 'gettext'.
2014-10-03ui: Recognize the same size units as Coreutils.Ludovic Courtès
* guix/ui.scm (size->number): Add a bunch of large units. Recognize one-letter unit names. Change "KB" to "kB". * tests/ui.scm ("size->number, 1T"): New test. * doc/guix.texi (Invoking guix gc): Add cross-reference to "Block size" in the Coreutils manual. (Invoking guix system): Likewise.
2014-09-14pull: Create ~/.config/guix if needed instead of bailing out gracelessly.Ludovic Courtès
Previously 'guix pull' would just fail with "No such file or directory" if ~/.config didn't already exist. * guix/ui.scm (config-directory): Use 'mkdir-p' instead of 'mkdir'. Change the 'catch' handler to expect errors different from EEXIST.
2014-08-11ui: Fix handling of periods by fill-paragraph.Cyrill Schenkel
Fixes <http://bugs.gnu.org/17468>. * guix/ui.scm (fill-paragraph): Two spaces after period and no spaces before newline. * tests/ui.scm: New test case. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2014-07-25guix: package: Fix recutils output for non-package inputs.Eric Bavier
* guix/ui.scm (package->recutils)[dependencies]: Ignore non-package inputs. * tests/guix-package.sh: New test.
2014-07-25ui: Improve formatting of package dependencies in recutils.Ludovic Courtès
* guix/ui.scm (package->recutils)[dependencies->recutils]: New procedure. Use it.
2014-07-21ui: add the "dependencies" field to package->recutils:Cyril Roelandt
* guix/ui.scm (package->recutils): Print the dependencies of the package.
2014-06-14ui: Avoid circularity with (guix gexp).Ludovic Courtès
Fixes a regression introduced in 56b8210 ("guix build: Allow gexps to be passed to '-e'.") * guix/ui.scm (%guix-user-module): Wrap in 'delay'. (read/eval): Adjust accordingly.
2014-06-14guix build: Allow gexps to be passed to '-e'.Ludovic Courtès
* guix/ui.scm (%guix-user-module): New variable. (read/eval): Pass it as the second argument to 'eval'. * guix/scripts/build.scm (options/resolve-packages): Add case for 'gexp?'. * tests/guix-build.sh: Add tests. * doc/guix.texi (Invoking guix build): Document '-e gexp'. guxi build: Allow gexps to be passed to '-e'. * guix/ui.scm (%guix-user-module): New variable. (read/eval): Pass it as the second argument to 'eval'. * guix/scripts/build.scm (options/resolve-packages): Add case for 'gexp?'. * tests/guix-build.sh: Add tests. * doc/guix.texi (Invoking guix build): Document '-e gexp'.
2014-06-13Separate package description translations from string translations.Ludovic Courtès
* po/packages/LINGUAS, po/packages/Makevars, po/packages/POTFILES.in: New files. * po/guix/Makevars (DOMAIN): Change to "guix". (XGETTEXT_OPTIONS): Remove "--keyword=synopsis --keyword=description". * po/guix/POTFILES.in: Remove gnu/packages/*.scm. * configure.ac: Change to gettext 0.18.3. Produce po/packages/Makefile.in. * Makefile.am (SUBDIRS): Add po/packages. * guix/ui.scm (%package-text-domain): New variable. (P_): New procedure. (package->recutils): Use 'P_' instead of '_'. * guix/scripts/package.scm (find-packages-by-description): Use 'P_' instead of 'gettext'.
2014-05-19ui: Gracefully deal with zero-output derivations.Ludovic Courtès
* guix/ui.scm (show-what-to-build)[built-or-substitutable?]: New procedure. Check whether OUT is #f. Use it. * tests/ui.scm ("show-what-to-build, zero outputs"): New test.
2014-04-28monads: Hide 'derivation-expression' and 'lower-inputs'.Ludovic Courtès
* guix/monads.scm: Unexport 'lower-inputs' and 'derivation-expression'. (text-file*): Add comment about the switch to 'gexp->derivation'. (lower-inputs): Add comment about its doom. (derivation-expression): Likewise. * guix/gexp.scm (lower-inputs*): Rename to... (lower-inputs): ... this. Update callers. * tests/monads.scm (derivation-expression): New procedure. * doc/guix.texi (The Store Monad): Use 'gexp->derivation' instead of 'derivation-expression'. Remove documentation of 'derivation-expression'. * guix/ui.scm (read/eval): Use THE-ROOT-MODULE so that macros are properly expanded. * tests/guix-build.sh: Use 'gexp->derivation' instead of 'derivation-expression'.monads: Hide 'derivation-expression' and 'lower-inputs'.
2014-04-08ui: Add 'size->number'.Ludovic Courtès
* guix/scripts/gc.scm (size->number): Remove. * guix/ui.scm (size->number): New procedure. * tests/ui.scm ("size->number, bytes", "size->number, MiB", "size->number, GiB", "size->number, 1.2GiB", "size->number, invalid unit"): New tests.
2014-04-04ui: Improve reporting of 'system-error' exceptions.Ludovic Courtès
* guix/ui.scm (call-with-error-handling): Change 'system-error' handler to display the error message as it was raised.
2014-02-21ui: Handle SRFI-35 '&message' conditions.Ludovic Courtès
* guix/ui.scm (call-with-error-handling): Add case for 'message-condition?'. * po/Makevars: Fix typo in comment.
2014-01-24Add 'guix offload' as a daemon build hook.Ludovic Courtès
* nix/nix-daemon/guix-daemon.cc (GUIX_OPT_NO_BUILD_HOOK): New macro. (options): Add '--no-build-hook'. (parse_opt): Handle it. (main)[HAVE_DAEMON_OFFLOAD_HOOK]: Set 'useBuildHook' by default. Set $NIX_BUILD_HOOK to our offload hook unless otherwise specified. [!HAVE_DAEMON_OFFLOAD_HOOK]: Clear 'useBuildHook'. * pre-inst-env.in: Set and export NIX_BUILD_HOOK. * nix/scripts/offload.in, guix/scripts/offload.scm: New files. * guix/ui.scm (show-guix-help)[internal?]: Add "offload". * config-daemon.ac: Call 'GUIX_CHECK_UNBUFFERED_CBIP'. Instantiate 'nix/scripts/offload'. Set 'BUILD_DAEMON_OFFLOAD' conditional, and optionally define 'HAVE_DEAMON_OFFLOAD_HOOK' cpp macro. * daemon.am (nodist_pkglibexec_SCRIPTS)[BUILD_DAEMON_OFFLOAD]: Add it. * Makefile.am (MODULES)[BUILD_DAEMON_OFFLOAD]: Add 'guix/scripts/offload.scm'. (EXTRA_DIST)[!BUILD_DAEMON_OFFLOAD]: Likewise. * m4/guix.m4 (GUIX_CHECK_UNBUFFERED_CBIP): New macro. * doc/guix.texi (Setting Up the Daemon): Move most of the body to... (Build Environment Setup): ... this. New subsection. (Daemon Offload Setup): New subsection.
2014-01-24ui: Filter out internal commands from '--help'.Ludovic Courtès
* guix/ui.scm (show-guix-help)[internal?]: New procedure. Use it to filter out internal commands reported by '--help'.
2014-01-17ui: Update copyright year in '--version' output.Ludovic Courtès
* guix/ui.scm (show-version-and-exit): Increment copyright year.
2014-01-13ui: Don't use hyphens in 'package->recutils' output.Ludovic Courtès
* guix/ui.scm (package->recutils): Rename recutils field from 'home-page' to 'homepage'.
2013-11-18guix build: '-e' can be passed a monadic thunk.Ludovic Courtès
* guix/ui.scm (read/eval): New procedure. (read/eval-package-expression): Use it. * guix/scripts/build.scm (derivations-from-package-expressions): Rename to... (derivation-from-expression): ... this. Accept procedures, under the assumption that they are monadic thunk. (show-help): Adjust accordingly. (guix-build): Ditto. * tests/guix-build.sh: Add test. * doc/guix.texi (Invoking guix build): Augment description of '-e'.
2013-11-03ui: Make '--version' output GCS-compliant.Ludovic Courtès
* guix/ui.scm (show-version-and-exit): Display copyright year, license, and LACK OF WARRANTY.
2013-11-01ui: Factorize package specification parsing.Ludovic Courtès
* guix/ui.scm (package-specification->name+version+output): New procedure. * guix/scripts/package.scm (specification->package+output): Use it. * tests/ui.scm ("package-specification->name+version+output"): New test.
2013-10-12guix: Add missing call to 'bindtextdomain'.Ludovic Courtès
* scripts/guix.in (config-lookup): Add "localedir" entry. (run-guix-main): Add call to 'bindtextdomain'. * guix/ui.scm (initialize-guix): Use %GETTEXT-DOMAIN instead of a literal.
2013-09-19guix package: Add '--list-generations'.Nikita Karetnikov
* guix/scripts/package.scm: Import (srfi srfi-19). (generation-time, matching-generations): New functions. (show-help): Add '--list-generations'. (%options): Likewise. (guix-package)[process-query]: Add support for '--list-generations'. * guix/ui.scm: Import (srfi srfi-19) and (ice-9 regex). (string->generations, string->duration): New functions. * tests/guix-package.sh: Test '--list-generations'. * tests/ui.scm: Import (srfi srfi-19). Test 'string->generations' and 'string->duration'. * doc/guix.texi (Invoking guix-package): Document '--list-generations'.
2013-09-18derivations: 'derivation' and related procedures return a single value.Ludovic Courtès
* 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.
2013-09-02substitute-binary: Show the Nar size, when available.Ludovic Courtès
* guix/scripts/substitute-binary.scm (guix-substitute-binary)["--substitute"]: Show the Nar size, when available. * guix/ui.scm (show-what-to-build): Add 'TODO'.
2013-08-15Make "guix -h" work as "guix --help".Cyril Roelandt
* guix/ui.scm (guix-main): have the same behaviour for the "-h" and "--help" options.
2013-07-12ui: Ignore SIGPIPE and catch `system-error' exceptions.Ludovic Courtès
* guix/ui.scm (initialize-guix): Call `sigaction'. (call-with-error-handling): Wrap `thunk' in a (catch 'system-error ...).
2013-07-01ui: Don't make substituter-related RPCs at all when substitutes are disabled.Ludovic Courtès
Reported by Nikita Karetnikov and Cyril Roelandt. * guix/ui.scm (show-what-to-build): Call `substitutable-path-info' only when USE-SUBSTITUTES? is true.
2013-05-30ui: define-diagnostic: Don't mark `_' and `N_' as literals.Ludovic Courtès
* 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>.
2013-05-27packages: Raise an error condition a cross builder is needed but unavailable.Ludovic Courtès
* 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.
2013-05-20Add `--max-silent-time' to `guix build' and `guix package'.Ludovic Courtès
* guix/scripts/build.scm (%default-options): Add default `max-silent-time' value. (show-help, %options): Add `--max-silent-time'. (guix-build): Pass `max-silent-time' to `set-build-options'. * guix/scripts/package.scm (%default-options): Add default `max-silent-time' value. (show-help, %options): Add `--max-silent-time'. (guix-package): Pass `max-silent-time' to `set-build-options'. * guix/ui.scm (string->number*): New procedure. * tests/derivations.scm ("build-expression->derivation and max-silent-time"): New test. * doc/guix.texi (Invoking guix package, Invoking guix build): Document `--max-silent-time'.
2013-05-14Sort commands alphabetically in "guix --help".Ludovic Courtès
* guix/ui.scm (show-guix-help): Sort commands.
2013-05-14Fix "guix --help" on Guile 2.0.5.Ludovic Courtès
Reported at <http://linuxfr.org/news/sortie-de-gnu-guix-0-2>. * guix/ui.scm (command-files): Filter the result of `scandir' to make sure only `.scm' files are present.
2013-05-10ui: Invite users to try `--help' in the error message.Ludovic Courtès
* 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.
2013-05-10ui: Implement `guix --help'.Ludovic Courtès
* guix/ui.scm (command-files, commands, show-guix-help): New procedures. (guix-main): Invoke `show-guix-help' when passed `--help'.
2013-05-10ui: Gracefully report "command not found" errors.Ludovic Courtès
* 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'.
2013-05-07ui: Capitalize informative messages.Ludovic Courtès
* guix/ui.scm (show-what-to-build): Capitalize user messages, as per the GCS (info "(standards) Errors").
2013-04-27ui: Add `args-fold*' and use it.Ludovic Courtès
* guix/ui.scm (args-fold*): New procedure. * guix/scripts/build.scm, guix/scripts/download.scm, guix/scripts/gc.scm, guix/scripts/hash.scm, guix/scripts/import.scm, guix/scripts/package.scm, guix/scripts/pull.scm, guix/scripts/refresh.scm: Use `args-fold*' instead of `args-fold'.
2013-04-27ui: Use consistent spacing in `show-what-to-build' messages.Ludovic Courtès
* guix/ui.scm (show-what-to-build): Use consistent spacing in "the following..." messages.
2013-04-22ui: Move macro definitions before any use.Ludovic Courtès
* 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'.
2013-04-21Factorize `download-and-store'.Ludovic Courtès
* guix/download.scm (download-to-store): New procedure. * guix/scripts/download.scm (fetch-and-store): Remove. (guix-download): Use `download-to-store' instead. * guix/ui.scm (call-with-temporary-output-file): Move to... * guix/utils.scm (call-with-temporary-output-file): ... here.
2013-04-21ui: Move definition of `install-locale' after that of the `warning' macro.Ludovic Courtès
* guix/ui.scm (install-locale): Move definition after that of `warning'.
2013-04-21ui: Add a 'define-diagnostic' macro.Nikita Karetnikov
* 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'.
2013-04-17ui: Fix format string in `warning'.Ludovic Courtès
* guix/ui.scm (warning)[augmented-format-string]: Add missing ~*.
2013-04-17scripts: Report what will be substituted.Ludovic Courtès
* 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.
2013-04-11ui: Add a `warning' macro.Ludovic Courtès
* 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.
2013-03-07ui: Gracefully report failures to connect to the daemon.Ludovic Courtès
* 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'.