guix-commits
[Top][All Lists]
Advanced

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

05/05: guix build: '--with-commit' recognizes "v[0-9]" tags.


From: guix-commits
Subject: 05/05: guix build: '--with-commit' recognizes "v[0-9]" tags.
Date: Fri, 26 Jul 2019 05:23:34 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 4d04bc50d2df32be326e0f48f378dc581f873989
Author: Ludovic Courtès <address@hidden>
Date:   Fri Jul 26 11:17:31 2019 +0200

    guix build: '--with-commit' recognizes "v[0-9]" tags.
    
    * guix/scripts/build.scm (transform-package-source-commit)[replace]:
    Special case COMMIT that starts with "v[0-9]".
---
 guix/scripts/build.scm | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/guix/scripts/build.scm b/guix/scripts/build.scm
index ec58ba8..3ee0b73 100644
--- a/guix/scripts/build.scm
+++ b/guix/scripts/build.scm
@@ -341,10 +341,15 @@ strings like \"guile-next=cabba9e\" meaning that packages 
are built using
   (define (replace old url commit)
     (package
       (inherit old)
-      (version (string-append "git."
-                              (if (< (string-length commit) 7)
-                                  commit
-                                  (string-take commit 7))))
+      (version (if (and (> (string-length commit) 1)
+                        (string-prefix? "v" commit)
+                        (char-set-contains? char-set:digit
+                                            (string-ref commit 1)))
+                   (string-drop commit 1)        ;looks like a tag like "v1.0"
+                   (string-append "git."
+                                  (if (< (string-length commit) 7)
+                                      commit
+                                      (string-take commit 7)))))
       (source (git-checkout (url url) (commit commit)
                             (recursive? #t)))))
 



reply via email to

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