summaryrefslogtreecommitdiff
path: root/guix/ui.scm
AgeCommit message (Expand)Author
2020-03-24ui: 'show-manifest-transaction' tabulates upgraded package lists....This also changes "1.0.0 → 1.0.0" to "(dependencies changed)", which is probably less confusing. * guix/ui.scm (tabulate): New procedure. (show-manifest-transaction)[upgrade-string]: Rewrite to take lists of names, versions, and outputs instead of single elements. Use 'tabulate'. Adjust callers accordingly. Ludovic Courtès
2020-03-23ui: Add 'indented-string'....* guix/scripts/pull.scm (display-news-entry): Remove extra space in format string for 'indented-string'. (indented-string): Remove. (display-new/upgraded-packages)[pretty]: Pass #:initial-indent? to 'indented-string'. * guix/ui.scm (indented-string): New procedure. Ludovic Courtès
2020-03-22ui: 'build-notifier' invokes continuation when there's nothing to do....* guix/ui.scm (build-notifier): Call CONTINUE when there's nothing to build or download, even when DRY-RUN? is true. Ludovic Courtès
2020-03-22ui: 'show-what-to-build' returns two values, for builds and downloads....* guix/ui.scm (show-what-to-build): Return two values. Ludovic Courtès
2020-03-22ui: 'show-what-to-build' returns true when there are grafts to build....* guix/ui.scm (show-what-to-build): Distinguish between 'build/full' and 'build'. Return true whe 'build/full' is non-empty, thus taking grafts into account. Ludovic Courtès
2020-03-22ui: Add a notification build handler....* guix/ui.scm (build-notifier): New variable. Ludovic Courtès
2020-03-11ui: Restore line wrapping for 'package->recutils'....Fixes a regression introduced when switching to Guile 3.0.0 whereby monkey-patching 'wrap*' wouldn't have any effects due to inlining. * guix/ui.scm (%text-width): Define in terms of the '*line-width*' fluid when it's defined. <top level>: Set (@@ (texinfo plain-text) wrap*) only when '*line-width*' is undefined. Ludovic Courtès
2020-02-28Revert "ui: Only display link in capable terminals."...This reverts commit d7545a6b538813e88195d084f75a3e87065c999e. The commit led to a test failure in 'tests/guix-package-net.sh'. It also led to disagreements discussed here: https://lists.gnu.org/archive/html/guix-devel/2020-02/msg00353.html Reverting until these are addressed. Ludovic Courtès
2020-02-24ui: Don't truncate search output when inside Emacs....* guix/ui.scm (display-search-results): Loop over all results when INSIDE_EMACS is set. Pierre Neidhardt
2020-02-24ui: Only display link in capable terminals....* guix/ui.scm (display-generation): Display generation path on new line. * guix/scripts/describe.scm (channel-commit-hyperlink): Add TRANSFORMER argument. (display-profile-content): Use TRANSFORMER argument to display URL explicitly when terminal does not support hyperlinks. zimoun
2020-02-23ui: (size->number "1.M") is correctly parsed....Reported by Pierre Neidhardt <mail@ambrevar.xyz>. * guix/ui.scm (size->number)[unit-pos]: Add #\. to CHAR-SET:DIGIT. * tests/ui.scm ("size->number, 1.M"): New test. Ludovic Courtès
2020-02-11ui: Fix typo in comment....Reported by Vincent Legoll <vincent.legoll@gmail.com>. * guix/ui.scm (call-with-error-handling): Remove "come" in comment. Ludovic Courtès
2020-01-24ui: Do not display error messages with bare format strings....On Guile 3, with, say, an error in ~/.guile, we'd get: $ guix repl guix repl: error: Unbound variable: ~S * guix/ui.scm (call-with-error-handling): Add '&exception-with-kind-and-args' case. Ludovic Courtès
2020-01-17ui: Ignore 'raise-exception' frames when reporting exceptions....* guix/ui.scm (last-frame-with-source): Check whether FRAME corresponds to 'raise-exception' and skip it if it does. Ludovic Courtès
2020-01-16records: Improve reporting of "invalid field specifier" errors....Previously users would just see: error: invalid field specifier without source location or hints. * guix/records.scm (expand): Add optional 'parent-form' parameter and pass it to 'syntax-violation' when it is true. (make-syntactic-constructor): Pass S as a third argument to 'report-invalid-field-specifier'. * guix/ui.scm (report-load-error): For 'syntax-error', show SUBFORM or FORM in the message. * tests/records.scm ("define-record-type* & wrong field specifier"): Add a 'subform' parameter and adjust test accordingly. ("define-record-type* & wrong field specifier, identifier"): New test. * tests/guix-system.sh: Add test. Ludovic Courtès
2020-01-15Avoid warnings for the 'delete' binding of (guix build utils)....On Guile 3, importing (guix build utils) leads to warnings such as: WARNING: (gnu packages embedded): imported module (guix build utils) overrides core binding `delete' * gnu/packages/embedded.scm: Select 'alist-replace' from (guix build utils). * guix/ui.scm: Hide 'delete' from (guix build utils). Ludovic Courtès
2020-01-02ui: It's 2020 now!...* guix/ui.scm (show-version-and-exit): Change year to 2020. Ludovic Courtès
2019-11-29ui: 'with-profile-lock' keeps going upon ENOLCK....* guix/build/syscalls.scm (call-with-file-lock/no-wait): Really pass ARGS to HANDLER. Return #f when HANDLER is called. * guix/ui.scm (profile-lock-handler): Emit a mere warning upon ENOLCK. Ludovic Courtès
2019-11-29ui: Factorize 'with-profile-lock'....* guix/ui.scm (profile-lock-handler, profile-lock-file): New procedures. (with-profile-lock): New macro. * guix/scripts/package.scm (process-actions): Use 'with-profile-lock' instead of 'with-file-lock/no-wait'. * guix/scripts/pull.scm (guix-pull): Likewise. Ludovic Courtès
2019-11-28pull, describe: Emit hyperlinks for commit identifiers....* guix/scripts/pull.scm (%vcs-web-views): New variable. (channel-commit-hyperlink): New procedure. (display-news-entry): Add 'channel' parameter. When 'supports-hyperlinks?' returns true, call 'channel-commit-hyperlink'. (display-profile-content): Likewise, and define CHANNEL. (display-channel-specific-news): Pass CHANNEL to 'display-news-entry'. * guix/ui.scm (hyperlink): Make public. Ludovic Courtès
2019-11-28ui: 'display-generation' emits a hyperlink for the generation....* guix/ui.scm (supports-hyperlinks?): Make 'port' optional. (display-generation): Use 'file-hyperlink' for the heading when 'supports-hyperlinks?' returns true. Ludovic Courtès
2019-11-28ui: Add 'file-hyperlink'....* guix/ui.scm (file-hyperlink): New procedure. (location->hyperlink): Use it. Ludovic Courtès
2019-11-27ui: Adjust SRFI-34 exception handling to Guile 2.9.5....* guix/ui.scm (report-load-error, warn-about-load-error) (read/eval): Match (or 'srfi-34 '%exception) instead of just 'srfi-34 to match what Guile 2.9.5 does. Ludovic Courtès
2019-11-09ui: Emit hyperlinks for 'license' in package search results....* guix/ui.scm (package->recutils): When HYPERLINKS is true, call 'hyperlink' for the 'license' field. Ludovic Courtès
2019-11-09ui: Produce hyperlinks for the 'location' field of search results....This affects the output of 'guix show', 'guix search', and 'guix system search'. * guix/ui.scm (hyperlink, supports-hyperlinks?, location->hyperlink): New procedures. (package->recutils): Add #:hyperlinks? and honor it. (display-search-results): Pass #:hyperlinks? to PRINT. * guix/scripts/system/search.scm (service-type->recutils): Add #:hyperlinks? and honor it. Ludovic Courtès
2019-10-01ui: 'show-what-to-build' colorizes store file names....* guix/ui.scm (colorize-store-file-name): New procedure. (show-what-to-build)[colorize-store-item]: New variable. Use it throughout. Ludovic Courtès
2019-09-23ui: Add 'current-message-language'....* guix/ui.scm (%default-message-language): New variable. (current-message-language): New procedure. Ludovic Courtès
2019-09-19ui: 'relevance' connects regexps with a logical and....Fixes <https://bugs.gnu.org/36763>. Previously, the logical and connecting the regexps did not output the expected results (introduced in 8874faaaac665100a095ef25e39c9a389f5a397f). * guix/ui.scm (relevance) [score]: Change its arguments. [regexp->score]: New procedure. * tests/ui.scm ("package-relevance"): Add test. Signed-off-by: Ludovic Courtès <ludo@gnu.org> zimoun
2019-07-20ui: 'warn-about-load-error' provides hints for unbound variables....* guix/ui.scm (warn-about-load-error): Add 'unbound-variable' clause. * tests/guix-build.sh: Add test. Ludovic Courtès
2019-07-20ui: 'warn-about-load-error' warns about file/module name mismatches....* guix/discovery.scm (scheme-modules): Rename the inner 'file' to 'relative'. Pass FILE as an addition argument to WARN. * guix/ui.scm (warn-about-load-error): Add 'module' argument (actually, what was called 'file' really contained a module name.) Call 'check-module-matches-file' in the catch-all error case. (check-module-matches-file): New procedure. * tests/guix-build.sh: Test it. Ludovic Courtès
2019-07-11guix gc: Correctly handle '--delete-generations' with no arguments....Previously, 'guix gc --delete-generations' would crash: the "" pattern would be passed to 'matching-generations', which would return #f instead of returning a list. Reported by Raghav Gururajan <rvgn@disroot.org> in <https://bugs.gnu.org/36466>. * guix/ui.scm (matching-generations): Raise an error when passed an invalid pattern. * guix/scripts/gc.scm (delete-old-generations): Check if PATTERN is true. (%options): Leave ARG as-is for 'delete-generations'. (guix-gc): Use 'assq' instead of 'assoc-ref' for 'delete-generations'. * guix/scripts/package.scm (delete-matching-generations): Replace (string-null? pattern) with (not pattern). Remove 'else' clause. (%options): Leave ARG as-is for 'delete-generations'. * guix/scripts/pull.scm (%options): Leave ARG as-is for 'list-generations'. (process-query): Replace (string-null? pattern) with (not pattern). * guix/scripts/system.scm (list-generations): Likewise, and remove 'else' clause. (process-command): Use #f instead of "" when no pattern is given. Ludovic Courtès
2019-07-05derivations: Simplify 'substitution-oracle'....* guix/derivations.scm (substitution-oracle)[valid?, dependencies]: Remove. [closure]: New procedure. Rename parameter from 'drv' to 'inputs-or-drv' and adjust accordingly. (derivation-build-plan): Pass INPUTS directly to 'substitution-oracle'. * guix/ui.scm (show-what-to-build)[substitutable-info]: Likewise. Ludovic Courtès
2019-07-05derivations: 'derivation-build-plan' recurses on substituables....This fixes a bug whereby "guix build texlive -n" would report: 0.0 MB would be downloaded: /gnu/store/…-texlive-20180414 instead of: The following derivation would be built: /gnu/store/…-texlive-texmf-20180414.drv 2,595.2 MB would be downloaded: /gnu/store/…-texlive-20180414-texmf.tar.xz /gnu/store/…-texlive-20180414 where 'texlive-texmf' is a non-substitutable dependency of 'texlive'. * guix/derivations.scm (dependencies-of-substitutables): New procedure. (derivation-build-plan): When 'input-substitutable-info' returns true, append the subset of DEPS that corresponds to SUBSTITUABLES to the first argument of 'loop'. * guix/ui.scm (show-what-to-build): Remove half-baked traversal of DOWNLOAD. * tests/derivations.scm ("derivation-build-plan and substitutes, non-substitutable dep"): New test. Ludovic Courtès
2019-06-27ui: 'show-derivation-outputs' accepts <derivation-input> records....* guix/ui.scm (show-derivation-outputs): Handle <derivation-input> records. Ludovic Courtès
2019-06-27ui: 'show-what-to-build' accepts derivation inputs....This is a followup to f8a9f99cd602ce1dc5307cb0c21ae718ad8796bb. * guix/ui.scm (show-what-to-build)[inputs]: New variables. [substitutable-info]: Build the derivation list from INPUTS. Pass INPUTS to 'derivation-build-plan'. Ludovic Courtès
2019-06-27ui: 'show-what-to-build' uses 'derivation-build-plan'....* guix/ui.scm (show-what-to-build)[build-or-substitutable?]: Remove. Use 'derivation-build-plan' instead of 'derivation-prerequisites-to-build', passing it all of DRV at once, and remove 'fold2' shenanigans and postprocessing of BUILD. Ludovic Courtès
2019-06-27ui: Add 'display-search-results' and use it....* guix/ui.scm (display-search-results): New procedure. * guix/scripts/package.scm (find-packages-by-description): Remove 'unzip2' call and return a list of pairs. (process-query): Change to use 'display-search-results'. * guix/scripts/system/search.scm (find-service-types): Remove 'unzip2' call and return a list of pairs. (guix-system-search): Use 'display-search-results'. Ludovic Courtès
2019-06-27ui: 'relevance' considers regexps connected with a logical and....* guix/ui.scm (relevance)[score]: Change to return 0 when one of REGEXPS doesn't match. * tests/ui.scm ("package-relevance"): New test. Ludovic Courtès
2019-06-03Add (guix diagnostics)....* guix/ui.scm (warning, info, report-error, leave) (location->string, guix-warning-port, program-name) (highlight-argument, %highlight-argument, define-diagnostic) (%warning-color, %info-color, %error-color) (print-diagnostic-prefix): Move to... * guix/diagnostics.scm: ... here. New file. * Makefile.am (MODULES): Add it. Ludovic Courtès
2019-05-09ui: Make package outputs searchable....* guix/ui.scm (relevance): Allow the "field" procedure of a metric to return a list, and handle that case appropriately. Update docstring. (%package-metrics): Add a metric for package outputs. * guix/scripts/package.scm (find-packages-by-description): Update docstring. * tests/guix-package.sh: Add a test case to verify that package outputs are included in search results. Co-authored-by: Tobias Geerinckx-Rice <me@tobias.gr> Chris Marusich
2019-04-14ui: Highlight heading of generation lists....* guix/ui.scm (display-generation): Highlight the "Generation" heading. Ludovic Courtès
2019-04-14colors: Add 'highlight'....* guix/colors.scm (%highlight-color): New variable. (highlight): New procedure. * guix/ui.scm (%highlight-argument)[highlight]: Remove. (%highlight-color): Remove. Ludovic Courtès
2019-04-11colors: Introduce a disjoint type and pre-compute ANSI escapes....* guix/colors.scm (color-table, color): Remove. (<color>): New record type. (print-color): New procedure. (define-color-table, color): New macros. (color-codes->ansi): New procedure. (%reset): New variable. (colorize-string): Rewrite accordingly. (color-rules): Adjust accordingly. * guix/status.scm (print-build-event): Adjust to new 'colorize-string' interface. * guix/ui.scm (%highlight-argument): Likewise. (%warning-colors, %info-colors, %error-colors, %hint-colors) (%highlight-colors): Remove. (%warning-color, %info-color, %error-color, %hint-color) (%highlight-color): New variables. Ludovic Courtès
2019-04-10ui: Highlight diagnostic format string arguments....* guix/ui.scm (highlight-argument): New macro. (%highlight-argument): New procedure. (define-diagnostic): Use 'highlight-argument'. Ludovic Courtès
2019-04-10ui: Colorize hints....* guix/ui.scm (%info-colors): Remove CYAN. (%hint-colors): New variable. (display-hint): Adjust so that the "hint:" prefix is colorized. Ludovic Courtès
2019-04-10ui: Colorize diagnostics....* guix/ui.scm (define-diagnostic): Add 'colors' parameter and pass it to 'print-diagnostic-prefix'. (warning, info, report-error): Add extra argument. (%warning-colors, %info-colors, %error-colors): New variables. (print-diagnostic-prefix): Add #:colors parameter and honor it. Ludovic Courtès
2019-04-10ui: Diagnostic procedures can display error location....* guix/ui.scm (define-diagnostic): Add optional 'location' parameter. Pass it to 'print-diagnostic-prefix'. (print-diagnostic-prefix): Add optional 'location' parameter and honor it. (report-load-error): Use 'report-error' and 'warning' instead of (format (current-error-port) …). Ludovic Courtès
2019-04-10ui: Factorize 'print-diagnostic-prefix'....* guix/ui.scm (define-diagnostic): Emit call to 'print-diagnostic-prefix'. (print-diagnostic-prefix): New procedure. Ludovic Courtès
2019-04-10ui: Make diagnostic message prefix translatable....* guix/ui.scm (define-diagnostic): Expect PREFIX to be enclosed in 'G_'. Emit call to 'gettext' on PREFIX. (warning, info, report-error): Wrap prefix in 'G_'. Ludovic Courtès
2019-04-10ui: Fix i18n for diagnostic messages....Until now, we'd pass 'gettext' the "augmented" format string, which 'gettext' would not find in message catalogs. Now we pass it FMT as is, which is what catalogs contain. * guix/ui.scm (define-diagnostic)[augmented-format-string]: Remove. Emit one 'format' call to print the prefix, and a second one to print the actual message. Ludovic Courtès