guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

01/06: pull: '--url', '--commit', and '--branch' apply to the 'guix' cha


From: guix-commits
Subject: 01/06: pull: '--url', '--commit', and '--branch' apply to the 'guix' channel.
Date: Wed, 17 Apr 2019 09:32:52 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 72f749dcb83dbda9f98e28fa3622cc1d3db6275a
Author: Ludovic Courtès <address@hidden>
Date:   Wed Apr 17 13:56:40 2019 +0200

    pull: '--url', '--commit', and '--branch' apply to the 'guix' channel.
    
    Suggested by pkill9 <address@hidden>.
    
    * guix/scripts/pull.scm (channel-list): Apply REF and URL to the 'guix'
    channel.
    * doc/guix.texi (Invoking guix pull): Adjust accordingly.
---
 doc/guix.texi         |  5 +++--
 guix/channels.scm     |  1 +
 guix/scripts/pull.scm | 24 +++++++++++-------------
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index f8e7436..6b713aa 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -3646,8 +3646,9 @@ but it supports the following options:
 @item address@hidden
 @itemx address@hidden
 @itemx address@hidden
-Download code from the specified @var{url}, at the given @var{commit} (a valid
-Git commit ID represented as a hexadecimal string), or @var{branch}.
+Download code for the @code{guix} channel from the specified @var{url}, at the
+given @var{commit} (a valid Git commit ID represented as a hexadecimal
+string), or @var{branch}.
 
 @cindex @file{channels.scm}, configuration file
 @cindex configuration file for channels
diff --git a/guix/channels.scm b/guix/channels.scm
index 9658cf9..e93879e 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 55137fc..71e1368 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)))
 
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]