guix-commits
[Top][All Lists]
Advanced

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

10/10: pull: Record the URL, branch, and commit as a manifest entry prop


From: Ludovic Courtès
Subject: 10/10: pull: Record the URL, branch, and commit as a manifest entry property.
Date: Sat, 9 Jun 2018 06:02:39 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 77a1aac6cccc79d7c8085762f610e22e6ebfb43b
Author: Ludovic Courtès <address@hidden>
Date:   Sat Jun 9 11:31:18 2018 +0200

    pull: Record the URL, branch, and commit as a manifest entry property.
    
    * guix/scripts/pull.scm (derivation->manifest-entry): Turn COMMIT into a
    keyword parameter; add #:url and #:branch.  Add a 'source' property to
    the manifest entry.
    (build-and-install): Add #:url and #:branch and pass it to
    'derivation->manifest-entry'.
    (guix-pull): Adjust accordingly.
---
 guix/scripts/pull.scm | 26 +++++++++++++++++++++-----
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm
index c5ceebc..499de0e 100644
--- a/guix/scripts/pull.scm
+++ b/guix/scripts/pull.scm
@@ -199,8 +199,10 @@ modules in the old ~/.config/guix/latest style."
                  (list guile-json guile-git guile-bytestructures
                        guile-ssh gnutls)))
 
-(define (derivation->manifest-entry drv commit)
-  "Return a manifest entry for DRV, which represents Guix at COMMIT."
+(define* (derivation->manifest-entry drv
+                                     #:key url branch commit)
+  "Return a manifest entry for DRV, which represents Guix at COMMIT.  Record
+URL, BRANCH, and COMMIT as a property in the manifest entry."
   (mbegin %store-monad
     (what-to-build (list drv))
     (built-derivations (list drv))
@@ -212,10 +214,16 @@ modules in the old ~/.config/guix/latest style."
                           drv
                           (whole-package-for-legacy (string-append name "-"
                                                                    version)
-                                                    drv))))))))
+                                                    drv)))
+                (properties
+                 `((source (repository
+                            (version 0)
+                            (url ,url)
+                            (branch ,branch)
+                            (commit ,commit))))))))))
 
 (define* (build-and-install source config-dir
-                            #:key verbose? commit)
+                            #:key verbose? url branch commit)
   "Build the tool from SOURCE, and install it in CONFIG-DIR."
   (define update-profile
     (store-lift build-and-use-profile))
@@ -223,7 +231,10 @@ modules in the old ~/.config/guix/latest style."
   (mlet* %store-monad ((drv   (build-from-source source
                                                  #:commit commit
                                                  #:verbose? verbose?))
-                       (entry (derivation->manifest-entry drv commit)))
+                       (entry (derivation->manifest-entry drv
+                                                          #:url url
+                                                          #:branch branch
+                                                          #:commit commit)))
     (update-profile (string-append config-dir "/current")
                     (manifest (list entry)))))
 
@@ -306,6 +317,11 @@ certificates~%"))
                                     (canonical-package guile-2.2)))))
                  (run-with-store store
                    (build-and-install checkout (config-directory)
+                                      #:url url
+                                      #:branch (match ref
+                                                 (('branch . branch)
+                                                  branch)
+                                                 (_ #f))
                                       #:commit commit
                                       #:verbose?
                                       (assoc-ref opts 'verbose?))))))))))))



reply via email to

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