summaryrefslogtreecommitdiff
path: root/guix/scripts/time-machine.scm
AgeCommit message (Collapse)Author
2023-11-05time-machine: Warn when no command is given.Ludovic Courtès
* guix/scripts/time-machine.scm (guix-time-machine): Emit a warning when COMMAND-LINE is false. Change-Id: I26e6b608915ecaf6d9372f9b03dc5ebd1b4c68f9
2023-11-05time-machine: Make target commit check cheaper.Ludovic Courtès
Commit 79ec651a286c71a3d4c72be33a1f80e76a560031 introduced a check to error out when attempting to use ‘time-machine’ to travel to a commit before ‘v1.0.0’. This commit fixes a performance issue with the strategy used in 79ec651a286c71a3d4c72be33a1f80e76a560031 (the repository was opened, updated, and traversed a second time by ‘validate-guix-channel’) as well as a user interface issue (“Updating channel” messages would be printed too late). This patch reimplements the check in terms of the existing #:validate-pull mechanism, which is designed to avoid extra repository operations. Fixes <https://issues.guix.gnu.org/65788>. * guix/inferior.scm (cached-channel-instance): Change default value of #:validate-channels. Remove call to VALIDATE-CHANNELS; pass it as #:validate-pull to ‘latest-channel-instances’. * guix/scripts/time-machine.scm (%reference-channels): New variable. (validate-guix-channel): New procedure, written as a simplification of… (guix-time-machine)[validate-guix-channel]: … this. Remove. Pass #:reference-channels to ‘cached-channel-instance’. Reported-by: Simon Tournier <zimon.toutoune@gmail.com> Change-Id: I9b0ec61fba7354fe08b04a91f4bd32b72a35460c
2023-10-17scripts: time-machine: Handle EPIPE errors when displaying help.Simon Tournier
* guix/scripts/time-machine.scm (%options): Handle EPIPE errors when displaying help.
2023-09-05time-machine: Also validate the reference from a channels file.Maxim Cournoyer
* guix/scripts/time-machine.scm (guix-time-machine) <validate-guix-channel>: Update doc. Fall-back to use the Guix channel reference when REF is #f. Reported-by: Simon Tournier <zimon.toutoune@gmail.com> Co-authored-by: Simon Tournier <zimon.toutoune@gmail.com>
2023-08-17pull, time-machine: Add '-q' to ignore channel files.Ludovic Courtès
This also fixes <https://issues.guix.gnu.org/63726>. * guix/scripts/pull.scm (show-help, %options): Add '-q'. (channel-list): Honor it. * guix/scripts/time-machine.scm (show-help, %options): Add '-q'. * doc/guix.texi (Invoking guix pull, Invoking guix time-machine): Document it. Reported-by: Simon Tournier <zimon.toutoune@gmail.com>
2023-08-16scripts: time-machine: Error when attempting to visit too old commits.Maxim Cournoyer
* doc/guix.texi (Invoking guix time-machine): Document limitation. * guix/inferior.scm (cached-channel-instance): New VALIDATE-CHANNELS argument. Use it to validate channels when there are no cache hit. * guix/scripts/time-machine.scm (%options): Tag the given reference with 'tag-or-commit instead of 'commit. (%oldest-possible-commit): New variable. (guix-time-machine) <validate-guix-channel>: New nested procedure. Pass it to the 'cached-channel-instance' call. * tests/guix-time-machine.sh: New test. * Makefile.am (SH_TESTS): Register it. Suggested-by: Simon Tournier <zimon.toutoune@gmail.com> Reviewed-by: Ludovic Courtès <ludo@gnu.org> Reviewed-by: Simon Tournier <zimon.toutoune@gmail.com>
2023-03-13guix: Strip #:use-module lists.Ludovic Courtès
This was obtained by setting up this environment: guix shell -D guix --with-input=guile@3.0.9=guile-next \ --with-commit=guile-next=e2ed33ef0445c867fe56c247054aa67e834861f2 -- make -j5 then adding 'unused-module' to (@@ (guix build compiler) %warnings), building, and checking all the "unused module" warnings and removing those that were definitely unused.
2021-08-09inferior: 'cached-channel-instance' no longer calls 'show-what-to-build'.Ludovic Courtès
This allows the user of 'cached-channel-instance' to install the build handler of its choice. In particular, it allows "guix time-machine" to install a build notifier with the right options instead of using the defaults that 'cached-channel-instance' would pass to 'show-what-to-build*'. * guix/inferior.scm (cached-channel-instance): Remove call to 'show-what-to-build*'. (inferior-for-channels): Wrap body in 'with-build-handler'. * guix/scripts/time-machine.scm (guix-time-machine): Use 'with-build-handler'.
2021-03-11time-machine: Fail when unrecognized option.zimoun
* guix/scripts/time-machine (parse-args): Fail when unrecognized option. Co-authored-by: Ludovic Courtès <ludo@gnu.org>
2021-03-10Revert "inferior: Break cached-channel-instance into two procedures."Mathieu Othacehe
This reverts commit 7d63b775513e7049047222dbe403a4181f63828d because it raises some concerns, see: https://lists.gnu.org/archive/html/guix-devel/2021-03/msg00124.html.
2021-03-10inferior: Break cached-channel-instance into two procedures.Mathieu Othacehe
Break cached-channel-instance into two different procedures: channels->cached-profile and instances->cached-profile operating respectively on channels and channels instances. * guix/inferior.scm (cached-channel-instance): Rename it into ... (cached-profile): ... this new procedure. (channels->cached-profile, instances->cached-profile): New procedures. * guix/scripts/time-machine.scm (guix-time-machine): Adapt accordingly.
2020-09-10scripts: Use 'define-command' and have 'guix help' use that.Ludovic Courtès
This changes 'guix help' to print a short synopsis for each command and to group commands by category. * guix/scripts.scm (synopsis, category): New variables. (define-command-categories, define-command): New macros. (%command-categories): New variable. * guix/ui.scm (<command>): New record type. (source-file-command): New procedure. (command-files): Return absolute file names. (commands): Return a list of <command> records. (show-guix-help)[display-commands, category-predicate]: New procedures. Display commands grouped in three categories. * guix/scripts/archive.scm (guix-archive): Use 'define-command'. * guix/scripts/authenticate.scm (guix-authenticate): Likewise. * guix/scripts/build.scm (guix-build): Likewise. * guix/scripts/challenge.scm (guix-challenge): Likewise. * guix/scripts/container.scm (guix-container): Likewise. * guix/scripts/copy.scm (guix-copy): Likewise. * guix/scripts/deploy.scm (guix-deploy): Likewise. * guix/scripts/describe.scm (guix-describe): Likewise. * guix/scripts/download.scm (guix-download): Likewise. * guix/scripts/edit.scm (guix-edit): Likewise. * guix/scripts/environment.scm (guix-environment): Likewise. * guix/scripts/gc.scm (guix-gc): Likewise. * guix/scripts/git.scm (guix-git): Likewise. * guix/scripts/graph.scm (guix-graph): Likewise. * guix/scripts/hash.scm (guix-hash): Likewise. * guix/scripts/import.scm (guix-import): Likewise. * guix/scripts/install.scm (guix-install): Likewise. * guix/scripts/lint.scm (guix-lint): Likewise. * guix/scripts/offload.scm (guix-offload): Likewise. * guix/scripts/pack.scm (guix-pack): Likewise. * guix/scripts/package.scm (guix-package): Likewise. * guix/scripts/perform-download.scm (guix-perform-download): Likewise. * guix/scripts/processes.scm (guix-processes): Likewise. * guix/scripts/publish.scm (guix-publish): Likewise. * guix/scripts/pull.scm (guix-pull): Likewise. * guix/scripts/refresh.scm (guix-refresh): Likewise. * guix/scripts/remove.scm (guix-remove): Likewise. * guix/scripts/repl.scm (guix-repl): Likewise. * guix/scripts/search.scm (guix-search): Likewise. * guix/scripts/show.scm (guix-show): Likewise. * guix/scripts/size.scm (guix-size): Likewise. * guix/scripts/substitute.scm (guix-substitute): Likewise. * guix/scripts/system.scm (guix-system): Likewise. * guix/scripts/time-machine.scm (guix-time-machine): Likewise. * guix/scripts/upgrade.scm (guix-upgrade): Likewise. * guix/scripts/weather.scm (guix-weather): Likewise.
2020-07-11git: Add 'with-git-error-handling'.Ludovic Courtès
* guix/scripts/pull.scm (report-git-error, with-git-error-handling): Move to... * guix/git.scm: ... here. * guix/scripts/time-machine.scm: Adjust accordingly.
2020-06-16time-machine: Add '--disable-authentication'.Ludovic Courtès
* guix/inferior.scm (cached-channel-instance): Add #:authenticate? and pass it to 'latest-channel-instances'. * guix/scripts/time-machine.scm (show-help, %options): Add '--disable-authentication'. (%default-options): Add 'authenticate-channels?'. (guix-time-machine): Honor it.
2019-11-26Use 'offload?' instead of 'build-hook?' internally.Ludovic Courtès
* guix/scripts/archive.scm (%default-options): Replace 'build-hook?' with 'offload?'. * guix/scripts/build.scm (set-build-options-from-command-line): Pass #:offload? instead of #:use-build-hook?. (%standard-build-options): Use the 'offload? key instead of 'build-hook?. (%default-options): Replace 'build-hook?' with 'offload?'. * guix/scripts/copy.scm (%default-options): Likewise. * guix/scripts/deploy.scm (%default-options): Likewise. * guix/scripts/environment.scm (%default-options): Likewise. * guix/scripts/pack.scm (%default-options): Likewise. * guix/scripts/package.scm (%default-options): Likewise. * guix/scripts/pull.scm (%default-options): Likewise. * guix/scripts/system.scm (%default-options): Likewise. * guix/scripts/time-machine.scm (%default-options): Likewise. * guix/store.scm (set-build-options): Have #:use-build-hook? default to *unspecified*. Add #:offload?. Add call to 'warn-about-deprecation' when #:use-build-hook? is specified.
2019-11-15time-machine: Honor the standard build options.Ludovic Courtès
* guix/scripts/time-machine.scm (show-help): Call 'show-build-options-help'. (%options): Add %STANDARD-BUILD-OPTIONS. (%default-options): New variable. (parse-args): Pass (list %default-options) to 'parse-command-line' and remove #:build-options? parameter. (guix-time-machine): Call 'set-build-options-from-command-line' and wrap 'cached-channel-instance' call in 'with-status-verbosity'. * doc/guix.texi (Invoking guix time-machine): Mention common build options.
2019-11-15time-machine: Handle 'git-error' exceptions.Ludovic Courtès
* guix/scripts/pull.scm (with-git-error-handling): Export. * guix/scripts/time-machine.scm (guix-time-machine): Wrap body in 'with-git-error-handling'.
2019-11-15inferior: 'cached-channel-instance' takes an open store connection.Konrad Hinsen
* guix/inferior.scm (cached-channel-instance): Take an explicit 'store' argument. (inferior-for-channels): Wrap call to 'cached-channel-instance' in 'with-store'. * guix/time-machine.scm (guix-time-machine): Wrap call to 'cached-channel-instance' in 'with-store'. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2019-11-15Add 'guix time-machine'.Konrad Hinsen
* guix/scripts/time-machine.scm: New file. * Makefile.am: (MODULES): Add it. * guix/scripts/pull.scm (channel-list): Export. * guix/inferior.scm (cached-channel-instance): New procedure. (inferior-for-channels): Use it. * doc/guix.texi (Invoking guix time-machine): New section. (Channels): Cross-reference it. Signed-off-by: Ludovic Courtès <ludo@gnu.org>