aboutsummaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2019-04-17 13:56:40 +0200
committerLudovic Courtès <ludo@gnu.org>2019-04-17 13:56:40 +0200
commit72f749dcb83dbda9f98e28fa3622cc1d3db6275a (patch)
tree4d6024bdd77d54a8777a79fed90508c582fc17b6 /guix
parent14755829dc268a3983036908750f4ea40c5224b3 (diff)
downloadguix-72f749dcb83dbda9f98e28fa3622cc1d3db6275a.tar
guix-72f749dcb83dbda9f98e28fa3622cc1d3db6275a.tar.gz
pull: '--url', '--commit', and '--branch' apply to the 'guix' channel.
Suggested by pkill9 <pkill9@runbox.com>. * guix/scripts/pull.scm (channel-list): Apply REF and URL to the 'guix' channel. * doc/guix.texi (Invoking guix pull): Adjust accordingly.
Diffstat (limited to 'guix')
-rw-r--r--guix/channels.scm1
-rw-r--r--guix/scripts/pull.scm24
2 files changed, 12 insertions, 13 deletions
diff --git a/guix/channels.scm b/guix/channels.scm
index 9658cf9393..e93879e1b4 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -52,6 +52,7 @@
channel-location
%default-channels
+ guix-channel?
channel-instance?
channel-instance-channel
diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm
index 55137fce8f..71e13686c0 100644
--- a/guix/scripts/pull.scm
+++ b/guix/scripts/pull.scm
@@ -502,24 +502,22 @@ Use '~/.config/guix/channels.scm' instead."))
(url (or (assoc-ref opts 'repository-url)
(environment-variable))))
(if (or ref url)
- (match channels
- ((one)
- ;; When there's only one channel, apply '--url', '--commit', and
- ;; '--branch' to this specific channel.
- (let ((url (or url (channel-url one))))
- (list (match ref
+ (match (find guix-channel? channels)
+ ((? channel? guix)
+ ;; Apply '--url', '--commit', and '--branch' to the 'guix' channel.
+ (let ((url (or url (channel-url guix))))
+ (cons (match ref
(('commit . commit)
- (channel (inherit one)
+ (channel (inherit guix)
(url url) (commit commit) (branch #f)))
(('branch . branch)
- (channel (inherit one)
+ (channel (inherit guix)
(url url) (commit #f) (branch branch)))
(#f
- (channel (inherit one) (url url)))))))
- (_
- ;; Otherwise bail out.
- (leave
- (G_ "'--url', '--commit', and '--branch' are not applicable~%"))))
+ (channel (inherit guix) (url url))))
+ (remove guix-channel? channels))))
+ (#f ;no 'guix' channel, failure will ensue
+ channels))
channels)))