summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMarius Bakke <marius@gnu.org>2021-09-04 19:07:52 +0200
committerMarius Bakke <marius@gnu.org>2021-09-08 18:03:50 +0200
commit16ef7b4938b14e68f8ca7504c9614f84530572ed (patch)
tree8e301c083c414d41875c4ab171bd90c7ee328b20 /tests
parent1dc3825e9940de44c1f170add7bd26d61830ce34 (diff)
transformations: Git tags and 'git describe' style IDs are used as version.
* guix/transformations.scm (commit->version-string): New procedure. Use git tags and 'git describe' style identifiers directly. (transform-package-source-commit): Adjust accordingly. * tests/transformations.scm ("options->transformation, with-commit, version transformation"): New test. * doc/guix.texi (Package Transformation Options): Mention the 'git describe' style.
Diffstat (limited to 'tests')
-rw-r--r--tests/transformations.scm21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/transformations.scm b/tests/transformations.scm
index 3417c994ec4..09839dc1c53 100644
--- a/tests/transformations.scm
+++ b/tests/transformations.scm
@@ -1,5 +1,6 @@
1;;; GNU Guix --- Functional package management for GNU 1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016, 2017, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org> 2;;; Copyright © 2016, 2017, 2019, 2020, 2021 Ludovic Courtès <ludo@gnu.org>
3;;; Copyright © 2021 Marius Bakke <marius@gnu.org>
3;;; 4;;;
4;;; This file is part of GNU Guix. 5;;; This file is part of GNU Guix.
5;;; 6;;;
@@ -235,6 +236,26 @@
235 (string=? (package-name dep2) "chbouib") 236 (string=? (package-name dep2) "chbouib")
236 (package-source dep2)))))))) 237 (package-source dep2))))))))
237 238
239(test-equal "options->transformation, with-commit, version transformation"
240 '("1.0" "1.0-rc1-2-gabc123" "git.abc123")
241 (map (lambda (commit)
242 (let* ((p (dummy-package "guix.scm"
243 (inputs `(("foo" ,(dummy-package "chbouib"
244 (source (origin
245 (method git-fetch)
246 (uri (git-reference
247 (url "https://example.org")
248 (commit "cabba9e")))
249 (sha256 #f)))))))))
250 (t (options->transformation
251 `((with-commit . ,(string-append "chbouib=" commit))))))
252 (let ((new (t p)))
253 (and (not (eq? new p))
254 (match (package-inputs new)
255 ((("foo" dep1))
256 (package-version dep1)))))))
257 '("v1.0" "1.0-rc1-2-gabc123" "abc123")))
258
238(test-equal "options->transformation, with-git-url" 259(test-equal "options->transformation, with-git-url"
239 (let ((source (git-checkout (url "https://example.org") 260 (let ((source (git-checkout (url "https://example.org")
240 (recursive? #t)))) 261 (recursive? #t))))