guix build: '--with-branch' strips slashes from the version string.

This fixes things like:

  guix build glibc \
    --with-git-url=glibc=git://sourceware.org/git/glibc.git \
    --with-branch=glibc=release/2.25/master

whereby slashes would before go straight to the 'version' field, leading
to an invalid store file name.

* guix/scripts/build.scm (transform-package-source-branch)[replace]:
Replace slashes with hyphens in BRANCH when building the version
string.
This commit is contained in:
Ludovic Courtès 2019-03-13 10:33:17 +01:00
parent 845c44012c
commit d831b19079
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

View File

@ -318,7 +318,10 @@ strings like \"guile-next=stable-3.0\" meaning that packages are built using
(define (replace old url branch)
(package
(inherit old)
(version (string-append "git." branch))
(version (string-append "git." (string-map (match-lambda
(#\/ #\-)
(chr chr))
branch)))
(source (git-checkout (url url) (branch branch)
(recursive? #t)))))