diff options
author | Romain GARBAGE <romain.garbage@inria.fr> | 2025-04-25 10:32:20 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2025-05-05 12:15:47 +0200 |
commit | 79bc4ebb332d30c31913164b18105c6d8e637c7a (patch) | |
tree | cf7a54cb09806123e2c885a412561cfaef6c54cd /tests/transformations.scm | |
parent | 63088c295d81cc3d0e808c478d4fe479a2c90102 (diff) |
transformations: Git source transformations honour RECURSIVE?.
* guix/transformations.scm (package-git-url+recursive?): New variable.
(package-git-url): Remove variable.
(evaluate-git-replacement-specs): Use package-git-url+recursive?.
(transform-package-source-branch, transform-package-source-commit, transform-package-source-git-url): Update
according to changes above.
* doc/guix.texi (Package Transformation Options): Update documentation.
* tests/transformations.scm: Update tests. Add tests for RECURSIVE?
inheritance with WITH-COMMIT and WITH-SOURCE.
Change-Id: Id6a5e6957a9955c8173b06b3e14f2986c6dfc4bc
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests/transformations.scm')
-rw-r--r-- | tests/transformations.scm | 50 |
1 files changed, 48 insertions, 2 deletions
diff --git a/tests/transformations.scm b/tests/transformations.scm index 5285d98f17..9f5aacc41b 100644 --- a/tests/transformations.scm +++ b/tests/transformations.scm @@ -217,6 +217,28 @@ (test-equal "options->transformation, with-branch" (git-checkout (url "https://example.org") + (branch "devel")) + (let* ((p (dummy-package "guix.scm" + (inputs `(("foo" ,grep) + ("bar" ,(dummy-package "chbouib" + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://example.org") + (commit "cabba9e"))) + (sha256 #f))))))))) + (t (options->transformation '((with-branch . "chbouib=devel"))))) + (let ((new (t p))) + (and (not (eq? new p)) + (match (package-inputs new) + ((("foo" dep1) ("bar" dep2)) + (and (string=? (package-full-name dep1) + (package-full-name grep)) + (string=? (package-name dep2) "chbouib") + (package-source dep2)))))))) + +(test-equal "options->transformation, with-branch, recursive? inheritance" + (git-checkout (url "https://example.org") (branch "devel") (recursive? #t)) (let* ((p (dummy-package "guix.scm" @@ -226,7 +248,8 @@ (method git-fetch) (uri (git-reference (url "https://example.org") - (commit "cabba9e"))) + (commit "cabba9e") + (recursive? #t))) (sha256 #f))))))))) (t (options->transformation '((with-branch . "chbouib=devel"))))) (let ((new (t p))) @@ -240,6 +263,28 @@ (test-equal "options->transformation, with-commit" (git-checkout (url "https://example.org") + (commit "abcdef")) + (let* ((p (dummy-package "guix.scm" + (inputs `(("foo" ,grep) + ("bar" ,(dummy-package "chbouib" + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://example.org") + (commit "cabba9e"))) + (sha256 #f))))))))) + (t (options->transformation '((with-commit . "chbouib=abcdef"))))) + (let ((new (t p))) + (and (not (eq? new p)) + (match (package-inputs new) + ((("foo" dep1) ("bar" dep2)) + (and (string=? (package-full-name dep1) + (package-full-name grep)) + (string=? (package-name dep2) "chbouib") + (package-source dep2)))))))) + +(test-equal "options->transformation, with-commit, recursive? inheritance" + (git-checkout (url "https://example.org") (commit "abcdef") (recursive? #t)) (let* ((p (dummy-package "guix.scm" @@ -249,7 +294,8 @@ (method git-fetch) (uri (git-reference (url "https://example.org") - (commit "cabba9e"))) + (commit "cabba9e") + (recursive? #t))) (sha256 #f))))))))) (t (options->transformation '((with-commit . "chbouib=abcdef"))))) (let ((new (t p))) |