diff options
author | Ludovic Courtès <ludovic.courtes@inria.fr> | 2023-08-11 16:54:26 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2023-08-17 17:33:53 +0200 |
commit | 9c8098424b5be3abf21144c74162ec39c0c2e799 (patch) | |
tree | bcb6d3db0306256e6638fd6d10fe4c0bc296912e /guix/scripts | |
parent | 3363ff1867bb02c4aa4955db917ef1d67f2c47e6 (diff) |
pull, time-machine: Add '-q' to ignore channel files.
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>
Diffstat (limited to 'guix/scripts')
-rw-r--r-- | guix/scripts/pull.scm | 15 | ||||
-rw-r--r-- | guix/scripts/time-machine.scm | 8 |
2 files changed, 20 insertions, 3 deletions
diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm index 9b78d4b5ca..759c3a94a3 100644 --- a/guix/scripts/pull.scm +++ b/guix/scripts/pull.scm @@ -85,6 +85,9 @@ Download and deploy the latest version of Guix.\n")) (display (G_ " -C, --channels=FILE deploy the channels defined in FILE")) (display (G_ " + -q, --no-channel-files + inhibit loading of user and system 'channels.scm'")) + (display (G_ " --url=URL download \"guix\" channel from the Git repository at URL")) (display (G_ " --commit=COMMIT download the specified \"guix\" channel COMMIT")) @@ -133,6 +136,9 @@ Download and deploy the latest version of Guix.\n")) (cons* (option '(#\C "channels") #t #f (lambda (opt name arg result) (alist-cons 'channel-file arg result))) + (option '(#\q "no-channel-files") #f #f + (lambda (opt name arg result) + (alist-cons 'ignore-channel-files? #t result))) (option '(#\l "list-generations") #f #t (lambda (opt name arg result) (cons `(query list-generations ,arg) @@ -735,6 +741,9 @@ transformations specified in OPTS (resulting from '--url', '--commit', or (define file (assoc-ref opts 'channel-file)) + (define ignore-channel-files? + (assoc-ref opts 'ignore-channel-files?)) + (define default-file (string-append (config-directory) "/channels.scm")) @@ -750,9 +759,11 @@ transformations specified in OPTS (resulting from '--url', '--commit', or (define channels (cond (file (load-channels file)) - ((file-exists? default-file) + ((and (not ignore-channel-files?) + (file-exists? default-file)) (load-channels default-file)) - ((file-exists? global-file) + ((and (not ignore-channel-files?) + (file-exists? global-file)) (load-channels global-file)) (else %default-channels))) diff --git a/guix/scripts/time-machine.scm b/guix/scripts/time-machine.scm index e4fe511382..87000d82ec 100644 --- a/guix/scripts/time-machine.scm +++ b/guix/scripts/time-machine.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2019 Konrad Hinsen <konrad.hinsen@fastmail.net> -;;; Copyright © 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2019, 2020, 2021, 2023 Ludovic Courtès <ludo@gnu.org> ;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com> ;;; Copyright © 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com> ;;; @@ -63,6 +63,9 @@ Execute COMMAND ARGS... in an older version of Guix.\n")) (display (G_ " -C, --channels=FILE deploy the channels defined in FILE")) (display (G_ " + -q, --no-channel-files + inhibit loading of user and system 'channels.scm'")) + (display (G_ " --url=URL use the Git repository at URL")) (display (G_ " --commit=COMMIT use the specified COMMIT")) @@ -86,6 +89,9 @@ Execute COMMAND ARGS... in an older version of Guix.\n")) (cons* (option '(#\C "channels") #t #f (lambda (opt name arg result) (alist-cons 'channel-file arg result))) + (option '(#\q "no-channel-files") #f #f + (lambda (opt name arg result) + (alist-cons 'ignore-channel-files? #t result))) (option '("url") #t #f (lambda (opt name arg result) (alist-cons 'repository-url arg |