summaryrefslogtreecommitdiff
path: root/guix/scripts
Commit message (Collapse)AuthorAge
* scripts/import: Use pretty printer from (guix scripts style).Ricardo Wurmus2022-05-29
| | | | | * guix/scripts/import.scm (guix-import): Use pretty-print-with-comments. (newline-rewriting-port): Remove procedure.
* substitute: Check for --help or --version options early.yarl-baudig@mailoo.org2022-05-27
| | | | | | | | | | | | | Running `guix archive --authorize` sets /etc/guix/acl to 600 via with-atomic-file-output via mkstemp!. Then running `guix substitute --help/--version` fails on "permission denied". While "guix substitute" is an internal tool, the options --help and --version exist and you should be able to run those from the command line. * guix/scripts/substitute.scm (guix-substitute): Earlier check for --help or --version. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix package: Sort search results by package version.Ludovic Courtès2022-05-26
| | | | | | | | Fixes <https://issues.guix.gnu.org/55480>. Reported by Greg Hogan <code@greghogan.com>. * guix/scripts/package.scm (find-packages-by-description): When PACKAGE1 and PACKAGE2 have the same name, sort by version.
* Move (gnu platform) and (gnu platforms ...) to guix/.Josselin Poiret2022-05-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gnu/platform.scm: * gnu/platforms/arm.scm: * gnu/platforms/hurd.scm: * gnu/platforms/mips.scm: * gnu/platforms/powerpc.scm: * gnu/platforms/riscv.scm: * gnu/platforms/s390.scm: * gnu/platforms/x86.scm: Move to guix/. * Makefile.am: * doc/guix.texi (Porting to a New Platform): * etc/release-manifest.scm: * gnu/ci.scm: * gnu/image.scm: * gnu/local.mk: * gnu/packages/bioinformatics.scm: * gnu/packages/bootstrap.scm: * gnu/packages/cross-base.scm: * gnu/packages/instrumentation.scm: * gnu/packages/linux.scm: * gnu/system/image.scm: * gnu/system/images/hurd.scm: * gnu/system/images/novena.scm: * gnu/system/images/pine64.scm: * gnu/system/images/pinebook-pro.scm: * gnu/system/images/rock64.scm: * guix/scripts/build.scm: * guix/scripts/system.scm: * guix/self.scm: Update (gnu platform...) to (guix platform...). Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
* scripts: package: Transform before creating manifest entries.Josselin Poiret2022-05-23
| | | | | | | | | | | * guix/scripts/package.scm (options->installable): Add TRANSFORM argument, to be able to directly transform the new packages before creating their manifest entries. (process-actions): Remove transform-entry, and step3, transforming directly in step2. * tests/guix-package.sh: Add test. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* scripts: build: Highlight the current system with --list-systems.Mathieu Othacehe2022-05-22
| | | | * guix/scripts/build.scm (list-systems): Highlight it.
* scripts: Add --list-systems and --list-targets options.Mathieu Othacehe2022-05-22
| | | | | | | | | | | | | | | | | | | | | | | | | Also factorize the --system and --target build options. Check that the passed system and target arguments are known platforms. * doc/guix.texi (Additional Build Options): Document the new --list-systems and --list-targets options. * guix/scripts/build.scm (show-cross-build-options-help, show-emulated-build-options-help, list-systems, list-targets): New procedures. (%standard-cross-build-options, %standard-emulated-build-options): New variables. (show-help): Remove --system and --target entries and use show-cross-build-options-help and show-emulated-build-options-help procedures instead. (%options): Remove --system and --target entries and use %standard-cross-build-options and %standard-emulated-build-options variables instead. * guix/scripts/archive.scm (show-help, %options): Adapt them. * guix/scripts/environment.scm: Ditto. * guix/scripts/graph.scm: Ditto. * guix/scripts/pack.scm: Ditto. * guix/scripts/pull.scm: Ditto. * guix/scripts/size.scm: Ditto. * guix/scripts/weather.scm: Ditto. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
* import: Add Elm importer.Philip McGrath2022-05-22
| | | | | | | | | | | * guix/import/elm.scm, guix/scripts/import/elm.scm: New files. * Makefile.am (MODULES): Add them. * guix/scripts/import.scm (importers): Add "elm". * doc/guix.texi (Invoking guix import): Document Elm importer. * doc/contributing.texi (Elm Packages): Mention it. * tests/elm.scm ("(guix import elm)"): New test group. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* guix: Remove unused import.Ricardo Wurmus2022-05-20
| | | | | * guix/scripts/pull.scm: Do not import with-file-lock/no-wait from (guix build syscalls).
* guix system: Highlight search results.Ludovic Courtès2022-04-29
| | | | | | | This is a followup to 5e0c3479759047311b6a518fd0bc512b232f201a. * guix/scripts/system/search.scm (guix-system-search): Pass #:regexps parameter to 'display-search-results'.
* publish: Send uncached narinfo replies from the main thread.Ludovic Courtès2022-04-29
| | | | | | | | | | | | | | | Fixes <https://issues.guix.gnu.org/54723>. Reported by Guillaume Le Vaillant <glv@posteo.net>. Regression introduced in f743f2046be2c5a338ab871ae8666d8f6de7440b. With commit f743f2046be2c5a338ab871ae8666d8f6de7440b, responses to pipelined GETs would end up being written concurrently by many threads. Thus the body of those responses could be interleaved and garbled. * guix/scripts/publish.scm: Revert f743f2046be2c5a338ab871ae8666d8f6de7440b. * tests/publish.scm ("/*.narinfo pipeline"): New test.
* scripts: pack: Fix typo.Alex Griffin2022-04-26
| | | | | | * guix/scripts/pack.scm (compressor-extenstion): Fix typo. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org>
* pack: Fix match error for multi-packages deb packs.Maxim Cournoyer2022-04-23
| | | | | | | * guix/scripts/pack.scm: Remove duplicated copyright line. (debian-archive)[single-entry]: Match one or anything, not one or zero. Reported-by: jgart <jgart@dismail.de>
* ui: Highlight package and service search results.Ludovic Courtès2022-04-19
| | | | | | | | | | | * guix/ui.scm (package->recutils): Add #:highlighting parameter and use it. (display-search-results): Add #:regexps parameter; call 'colorize-full-matches' and pass #:highlighting. * guix/scripts/package.scm (process-query): Pass #:regexps to 'display-search-results'. * guix/scripts/home.scm (search): Likewise. * guix/scripts/system/search.scm (service-type->recutils): Add #:highlighting parameter and use it.
* ui: Highlight important bits in recutils output.Ludovic Courtès2022-04-19
| | | | | | * guix/scripts/system/search.scm (service-type->recutils): Highlight the value of the 'name' field. * guix/ui.scm (package->recutils): Likewise for 'name' and 'version'.
* publish: Support systemd-style socket activation.Ludovic Courtès2022-04-14
| | | | | | | * guix/scripts/publish.scm (systemd-socket): New procedure. (guix-publish): Add 'style' variable. Adjust startup message depending on whether STYLE is 'systemd. * doc/guix.texi (Invoking guix publish): Mention socket activation.
* publish: Use SRFI-71 instead of SRFI-11.Ludovic Courtès2022-04-14
| | | | | * guix/scripts/publish.scm (make-request-handler): Use 'let' instead of 'let-values'.
* style: Correctly read dots in pairs and improper lists.Ludovic Courtès2022-04-14
| | | | | | | | | | Until now dots were read as symbols. * guix/scripts/style.scm (read-with-comments)[dot]: New variable. [dot?, reverse/dot]: New procedures. Use 'reverse/dot' instead of 'reverse' when reading lists. * tests/style.scm ("read-with-comments: dot notation") ("((a . 1) (b . 2))", "(a b c . boom)"): New tests.
* reconfigure: Fix typo on 'live-service-transient?'.Ludovic Courtès2022-04-11
| | | | | | | Fix typo introduced in e25eca35ff04e4234d0376fbb9a8e146869772c8. * guix/scripts/system/reconfigure.scm (running-services): Add question mark to 'live-service-transient?.
* services: herd: Adjust to <live-service> changes.Ludovic Courtès2022-04-10
| | | | | | | | | | | This is a followup to a2c759c8304c461d096ab763568e7f71546ff4e8. * guix/scripts/system/reconfigure.scm (running-services): Fill in the 'transient?' field of <live-service>. * tests/services.scm ("shepherd-service-upgrade: one unchanged, one upgraded, one new") ("shepherd-service-upgrade: service depended on is not unloaded") ("shepherd-service-upgrade: obsolete services that depend on each other"): Adjust calls to 'live-service'.
* guix describe: Add missing import.Ludovic Courtès2022-04-09
| | | | | | | Fixes a regression introduced in d4e858763c4303764729133c547b0a6dfe2354f9. * guix/scripts/describe.scm: Add missing autoload.
* ui: Move 'location->hyperlink' to (guix diagnostics).Ludovic Courtès2022-04-08
| | | | | | * guix/ui.scm (location->hyperlink): Move to... * guix/diagnostics.scm: ... here. * guix/scripts/system/search.scm: Adjust imports accordingly.
* ui: Move hyperlink facilities to (guix colors).Ludovic Courtès2022-04-08
| | | | | | | * guix/ui.scm (supports-hyperlinks?, file-hyperlink, hyperlink): Move to... * guix/colors.scm: ... here. * guix/scripts/home.scm, guix/scripts/system.scm, guix/scripts/system/search.scm: Adjust imports accordingly.
* shell: Add '--export-manifest'.Ludovic Courtès2022-04-04
| | | | | | | | | | | | * guix/scripts/shell.scm (show-help, %options): Add '--export-manifest'. (manifest-entry-version-prefix, manifest->code*) (export-manifest): New procedures. (guix-shell): Honor '--export-manifest'. * tests/guix-shell-export-manifest.sh: New file. * Makefile.am (SH_TESTS): Add it. * doc/guix.texi (Invoking guix shell): Document '--export-manifest'. (Invoking guix environment): Link to it. (Invoking guix pack): Likewise.
* environment: Export 'load-manifest'.Ludovic Courtès2022-04-04
| | | | | * guix/scripts/environment.scm (load-manifest): New procedure. (options/resolve-packages): Use it.
* packages: Add 'package-unique-version-prefix'.Ludovic Courtès2022-04-04
| | | | | | | * gnu/packages.scm (package-unique-version-prefix): New procedure. * guix/scripts/package.scm (manifest-entry-version-prefix): Use it. * tests/packages.scm ("package-unique-version-prefix, gcc@8") ("package-unique-version-prefix, grep"): New tests.
* weather: Colorize the output.Ludovic Courtès2022-04-01
| | | | | | * guix/colors.scm (coloring-procedure): Export. * guix/scripts/weather.scm (report-server-coverage): Highlight the server name and colorize the availability ratio.
* home: import: Clarify alias parsing code.Ludovic Courtès2022-03-20
| | | | | | | * guix/scripts/home/import.scm (generate-bash-configuration+modules) [bash-alias->pair]: Return #f on match failure. [parse-aliases]: Adjust accordingly and use 'match'. Remove 'filter' call.
* home: import: Properly parse aliases that contain quotes.Ludovic Courtès2022-03-20
| | | | | | | | | * guix/scripts/home/import.scm (generate-bash-configuration+modules): Define 'alias-rx'. [bash-alias->pair]: Use it. * tests/home-import.scm (match-home-environment-bash-service-with-alias): New variable. ("manifest->code: Bash service with aliases"): New test.
* guix home: Show "container" in '--help' output.Ludovic Courtès2022-03-19
| | | | | | This is a followup to 094a2cfbe45c104d0da30ff9d975d052ca0c118c. * guix/scripts/home.scm (show-help): Add "container".
* guix home: Add 'container' command.Ludovic Courtès2022-03-19
| | | | | | | | | | | | | | | | | * guix/scripts/home.scm (show-help, %options): Add '--network', '--share', and '--expose'. (not-config?, user-shell, spawn-home-container): New procedures. (%default-system-profile): New variable. (perform-action): Add #:file-system-mappings, #:container-command, and #:network?; honor them. (process-action): Adjust accordingly. (guix-home)[parse-sub-command]: Add "container". [parse-args]: New procedure. Use it instead of 'parse-command-line'. * tests/guix-home.sh: Add tests. * doc/guix.texi (Declaring the Home Environment): Mention 'guix home container' as a way to test configuration. (Invoking guix home): Document it.
* guix system: Call 'export-graph' with the right port argument.Ludovic Courtès2022-03-18
| | | | | * guix/scripts/system.scm (export-extension-graph) (export-shepherd-graph): Honor PORT.
* guix home: Implement the 'extension-graph' and 'shepherd-graph' actions.Ludovic Courtès2022-03-18
| | | | | | | | | | | | | | | Until now these two actions were silently ignored. * guix/scripts/home.scm (show-help, %options): Add "--graph-backend". (%default-options): Add 'graph-backend' key. (export-extension-graph, export-shepherd-graph): New procedures. (perform-action): Add #:graph-backend parameter. Add cases for the 'extension-graph' and 'shepherd-graph' actions. (process-action): Pass #:graph-backend to 'perform-action'. * guix/scripts/system.scm (service-node-type) (shepherd-service-node-type): Export * tests/guix-home.sh: Add tests. * doc/guix.texi (Invoking guix home): Document it.
* graph: Factorize 'lookup-backend'.Ludovic Courtès2022-03-18
| | | | | | | * guix/graph.scm (lookup-backend): New procedure. * guix/scripts/graph.scm (lookup-backend): Remove. * guix/scripts/system.scm (lookup-backend): Remove. * po/guix/POTFILES.in: Add 'guix/graph.scm'.
* scripts: import: gem: Fix recursive error handling.zimoun2022-03-07
| | | | | | | | Partly fixes <https://bugs.gnu.org/44115>. * guix/scripts/import/gem.scm (guix-import-gem): Handle error. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
* shell: Disable caching when '-p' is passed.Ludovic Courtès2022-03-02
| | | | | | | | | | | | Fixes <https://issues.guix.gnu.org/53658>. Reported by Guillaume Le Vaillant <glv@posteo.net>. Previously we would wrongfully cache things, by adding a new (profile . _) pair to the option alist, when the user runs: guix shell -p /path/to/profile -q * guix/scripts/shell.scm (profile-cached-gc-root): Add ('profile . _) case.
* pull: No longer print upgraded/added packages upon completion.Ludovic Courtès2022-02-27
| | | | | * guix/scripts/pull.scm (build-and-install): Remove call to 'display-profile-news' and adjust accordingly.
* pull: '--news' no longer shows package lists.Ludovic Courtès2022-02-27
| | | | | | | | | | * guix/scripts/pull.scm (display-channel-news): Return #t when news were displayed. (display-news): Add #:profile-news? parameter and honor it. Print something there were no news. (process-query): For 'display-news', call 'display-channel-news' directly. * doc/guix.texi (Invoking guix pull): Adjust accordingly.
* guix build: Warn when attempting to build an unsupported package.Ludovic Courtès2022-02-18
| | | | | | | | | | Fixes <https://issues.guix.gnu.org/51801>. Reported by Maxim Cournoyer <maxim.cournoyer@gmail.com>. * guix/scripts/build.scm (options->derivations)[warn-if-unsupported]: New procedure. [compute-derivation]: Use it. * tests/guix-build.sh: Add test.
* guix system: Fix 'describe' when booting the latest generation.Ludovic Courtès2022-02-15
| | | | | | | | | | | Fixes a regression introduced in 9679123ce083c69cdfd1505d95a4066d41280394, whereby 'guix system describe' would error out when /run/current-system points to /gnu/store/…-system, which is the case when booting the latest generation or after reconfigure. * guix/scripts/system.scm (process-command): For 'describe'. Try 'generation-number' with and without the optional argument.
* pull: '--list-generations' pipes its output to the pager.Ludovic Courtès2022-02-14
| | | | | | | * guix/scripts/pull.scm (process-query): For 'list-generations queries, use 'with-paginated-output-port'. (display-news-entry-title): Pass second argument to 'highlight'. (display-news-entry): Pass second argument to 'dim'.
* pull: '--list-generations' lists packages only with '--details'.Ludovic Courtès2022-02-14
| | | | | | * guix/scripts/pull.scm (show-help, %options): Add "--details". (process-query): Honor it. * doc/guix.texi (Invoking guix pull): Document it.
* publish: Do not sign the URL/Compression/FileSize narinfo fields.Ludovic Courtès2022-02-14
| | | | | | | | | | | | | | This will allow mirror operators to alter these non-normative bits of a narinfo without having to resign narinfos. * guix/scripts/publish.scm (narinfo-string): Remove URL/Compression/FileSize from BASE-INFO. Move them after "Signature". * tests/publish.scm ("/*.narinfo") ("/*.narinfo with properly encoded '+' sign") ("/*.narinfo with lzip + gzip") ("with cache, lzip + gzip"): Adjust accordingly. * tests/substitute.scm ("query narinfo with signature over relevant subset"): New test.
* deploy: Add '--execute'.Ludovic Courtès2022-02-02
| | | | | | | | * guix/scripts/deploy.scm (show-help, %options): Add '--execute'. (invoke-command): New procedure. (guix-deploy): Break arguments at "--" and handle '-x' and associated command. * doc/guix.texi (Invoking guix deploy): Document it.
* guix system: 'describe' shows the running system, not the current one.Ludovic Courtès2022-02-02
| | | | | | | | | * guix/profiles.scm (generation-number): Add optional 'base-profile' parameter and use it. * guix/scripts/system.scm (process-command): Add "/run/current-system" as first argument to 'generation-number'. * doc/guix.texi (Invoking guix system): Clarify that 'guix system describe' shows the running system.
* import: pypi: Use 'with-error-handling'.Ludovic Courtès2022-02-02
| | | | | * guix/scripts/import/pypi.scm (guix-import-pypi): Wrap body in 'with-error-handling'.
* home: 'reconfigure' checks for potential downgrades.Ludovic Courtès2022-01-28
| | | | | | | | | | * guix/scripts/home.scm (show-help, %options): Add "--allow-downgrades". (%default-options): Remove 'build-mode'; add 'validate-reconfigure'. (perform-action): Add #:validate-reconfigure. Call 'check-forward-update' when ACTION is 'reconfigure. (process-action): Pass #:validate-reconfigure to 'perform-action'. * gnu/home/services.scm (home-provenance): Export. * doc/guix.texi (Invoking guix home): Document '--allow-downgrades'.
* environment: '--check' does nothing when used with '--container'.Ludovic Courtès2022-01-25
| | | | | | | | Partly fixes <https://issues.guix.gnu.org/53355>. Reported by Chris Marusich <cmmarusich@gmail.com>. * guix/scripts/environment.scm (guix-environment*): Warn and do nothing when both '--check' and '--container' are used.
* package: Honor '--dry-run' when target profile is already in store.Ludovic Courtès2022-01-19
| | | | | | | | | | | | | | | | | | | Fixes <https://issues.guix.gnu.org/53267>. Reported by Tirifto <tirifto@posteo.cz>. Regression introduced in 65ffb9388c1c3d870cb07e4cb3ef12c9ac06a161. In the (unlikely) case where the profile we're targeting with "guix upgrade -n" or similar is already built, a new profile generation would be created and linked to despite the use of '-n'. This is because 65ffb9388c1c3d870cb07e4cb3ef12c9ac06a161 assumed that dry-run behavior would be handled solely by the build handler, which is not the case when there's nothing to build. * guix/scripts/package.scm (build-and-use-profile): Reintroduce #:dry-run? and honor it. (process-actions): Pass #:dry-run? to 'build-and-use-profile'. * tests/guix-package-net.sh: Add test.
* guix home: Default verbosity is the same as for 'guix system'.Ludovic Courtès2022-01-17
| | | | | | | | | Previously the default verbosity would always be 3, and 'verbosity-level' would thus have no effect. * guix/scripts/home.scm (verbosity-level): Change to level 3 for 'build'. (%default-options): Set 'verbosity' to #f.