summaryrefslogtreecommitdiff
path: root/guix/scripts
Commit message (Collapse)AuthorAge
* style: Gracefully handle failure to locate a source file.Ludovic Courtès2022-07-12
| | | | | * guix/scripts/style.scm (absolute-location): Raise an error when 'search-path' returns #f.
* style: For 'let' and similar forms, emit one binding per line.Ludovic Courtès2022-07-04
| | | | | | | | | | | | | | | | | | Previously, 'let' bindings could be rendered like this: (let ((x 1) (y 2) (z 3)) ...) With this change, each bindings goes in its own line. Partly fixes <https://issues.guix.gnu.org/56297>. Reported by Maxime Devos <maximedevos@telenet.be>. * guix/scripts/style.scm (pretty-print-with-comments)[list-of-lists?]: New procedure. Use it. * tests/style.scm: Add tests with 'let' and 'substitute-keyword-arguments'.
* style: Add option '--list-stylings'.base-for-series-12975Hartmut Goebel2022-07-04
| | | | | | * guix/scripts/style.scm (show-stylings): New procedure. (%options, show-help): Add "--list-stylings". * doc/guix.texi (Invoking guix style): Document "-l".
* challenge: Do nothing when passed zero arguments.Ludovic Courtès2022-07-03
| | | | | | | | | | Previously, 'guix challenge' without arguments would list live store items that had been locally built. This was deemed confusing, especially since 'list-live' is an expensive operation. * guix/scripts/challenge.scm (guix-challenge): Warn and exit with 0 when FILES is empty. * doc/guix.texi (Invoking guix challenge): Update accordingly.
* substitute: Use SRFI-71 instead of SRFI-11.Ludovic Courtès2022-06-26
| | | | | | * guix/scripts/substitute.scm (display-narinfo-data) (open-connection-for-uri/cached) (process-substitution): Use SRFI-71 instead of SRFI-11.
* guix system: Inline menu-entries in to bootcfg in perform-action.Christopher Baines2022-06-23
| | | | | | | This avoids an exception when generating images, where the reading of boot parameters fails. * guix/scripts/system.scm (perform-action): Inline menu-entries in to bootcfg.
* refresh: Repurpose '-L' for '--load-path'.Ludovic Courtès2022-06-22
| | | | | | | | | | | This incompatible change fixes an inconsistency with other commands where '-L' is short for '--load-path'. * guix/scripts/refresh.scm (%options): Add --load-path option from %STANDARD-BUILD-OPTIONS. Remove #\L shortcut for --list-updaters, and remove --load-path option that lacked the #\L shortcut. (show-help): Update accordingly. * doc/guix.texi (Invoking guix refresh): Update accordingly.
* style: Keep values next to their keyword.Ludovic Courtès2022-06-22
| | | | | | | | | This ensures we print '#:key value' rather than insert a newline between '#:key' and 'value' as was the case before. * guix/scripts/style.scm (pretty-print-with-comments)[print-sequence]: When ITEM is a keyword, loop with FIRST? = true. * tests/style.scm: Add test.
* challenge: Colorize output.Ludovic Courtès2022-06-19
| | | | | * guix/scripts/challenge.scm (good-news, bad-news): New procedures. (summarize-report, summarize-report-list): Use them and 'highlight'.
* shell: Fix '--export-manifest' for cached profiles and when '-p' is used.Ludovic Courtès2022-06-16
| | | | | | | | Fixes <https://issues.guix.gnu.org/55521>. * guix/scripts/shell.scm (export-manifest): When computing 'manifest', honor the 'profile key. * tests/guix-shell-export-manifest.sh: Add test.
* shell: Do not auto-detect manifest when '-p' is used.Ludovic Courtès2022-06-16
| | | | | | | | Previous, "guix shell -p /path/to/profile" would have manifest/guix.scm auto-detection turned on. * guix/scripts/shell.scm (auto-detect-manifest)[options-contain-payload?]: Return #t for 'profile.
* refresh: Switch to SRFI-71.Ludovic Courtès2022-06-15
| | | | | * guix/scripts/refresh.scm (update-package): Use SRFI-71 'let' instead of SRFI-11 'let-values'.
* challenge: When using '--diff', do not attempt to chmod symlinks.Ludovic Courtès2022-06-15
| | | | | | | This is a followup to 2a2856d5ccd9a9b7df8a94333a277b971a39b150. * guix/scripts/challenge.scm (make-directory-writable): Do not call 'make-file-writable' on symlinks.
* import: Add hex.pm importer.Hartmut Goebel2022-06-15
| | | | | | | | | | | | | hex.pm is a package repository for Erlang and Elixir. * guix/scripts/import.scm (importers): Add "hexpm". * guix/scripts/import/hexpm.scm, guix/import/hexpm.scm, guix/hexpm-download.scm: New files. * guix/import/utils.scm (source-spec->object): Add "hexpm-fetch" to list of fetch methods. * guix/upstream.scm (package-update/hexpm-fetch): New function. (%method-updates) Add it. * Makefile.am: Add them.
* pull: Tweak cache directory validation code.Ludovic Courtès2022-06-15
| | | | | | | | | | | This is a followup to 7c52cad0464175370c44bd4695e4c01a62b8268f. * guix/scripts/pull.scm (guix-pull): Move cache directory validation code to... (validate-cache-directory-ownership): ... here. New procedure. Use SRFI-71 instead of SRFI-11. Use 'formatted-message' for the error message, with ASCII quotation marks, and use Texinfo markup for '&fix-hint'.
* pull: Fix typo in error message.Tobias Geerinckx-Rice2022-06-12
| | | | * guix/scripts/pull.scm (guix-pull): Report the right user name/ID.
* challenge: Actually delete nars that have been extracted.Ludovic Courtès2022-06-13
| | | | | | | | | Fixes <https://issues.guix.gnu.org/55809>. Reported by Vagrant Cascadian <vagrant@reproducible-builds.org>. * guix/scripts/challenge.scm (make-directory-writable): New procedure. (call-with-mismatches)[restore-file*]: New procedure. Use it instead of 'restore-file'.
* pull: Fail if cache directory ownership is suspect.Tobias Geerinckx-Rice2022-06-05
| | | | | | | | | New users frequently run ‘sudo guix pull’ which breaks subsequent unprivileged ‘guix pull’s until manually fixed with chmod -R. * guix/scripts/pull.scm (guix-pull): Fail if the cache directory (or its innermost extant parent) is not owned by the user pulling the Guix, with a hint about ‘sudo -i’.
* packages: Add 'specifications->packages'.Antero Mejr2022-06-06
| | | | | | | | | | | | * gnu/packages.scm (specifications->packages): New procedure. * guix/scripts/home/import.scm (manifest+configuration-files->code): Use it. * tests/home-import.scm (match-home-environment-no-services) (match-home-environment-no-services-nor-packages) (match-home-environment-bash-service) (match-home-environment-bash-service-with-alias): Adjust 'packages' field accordingly. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
* guix system: Don't suggest reconfiguration during reconfiguration.Tobias Geerinckx-Rice2022-05-29
| | | | | | | * guix/scripts/system.scm (process-action): Add 'reconfigure to the warning's guard clause. Reported by johnjaye on #guix.
* guix home: Add 'edit' sub-command.Ludovic Courtès2022-06-04
| | | | | | | | | | * guix/scripts/home/edit.scm: New file. * Makefile.am (MODULES): Add it. * guix/scripts/home.scm (show-help): Add "edit". (process-command): Handle it. (guix-home): Add it. * po/guix/POTFILES.in: Add 'guix/scripts/home/edit.scm'. * doc/guix.texi (Invoking guix home): Document it.
* guix system: Add 'edit' sub-command.Ludovic Courtès2022-06-04
| | | | | | | | | | * guix/scripts/system/edit.scm: New file. * Makefile.am (MODULES): Add it. * guix/scripts/system.scm (show-help): Mention "edit". (actions): Add it. (process-command): Handle it. * doc/guix.texi (Invoking guix system): Document it. * po/guix/POTFILES.in: Add guix/scripts/system/edit.scm.
* edit: Extract 'spawn-editor' procedure.Ludovic Courtès2022-06-04
| | | | | * guix/scripts/edit.scm (spawn-editor): New procedure, with code from... (guix-edit): ... here. Use it.
* shell: '--export-manifest -D x -D y' generates a valid manifest.Ludovic Courtès2022-06-01
| | | | | | * guix/scripts/shell.scm (manifest->code*): Add missing 'list' in generated 'concatenate-manifests' call. * tests/guix-shell-export-manifest.sh: Add test.
* 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.