diff options
| author | Nicolas Graves via Guix-patches via <guix-patches@gnu.org> | 2024-02-04 00:07:11 +0100 |
|---|---|---|
| committer | Liliana Marie Prikler <liliana.prikler@gmail.com> | 2025-09-24 19:16:53 +0200 |
| commit | bd2470ca4d2c1bbb8a707b64d544e8aa2731f4ec (patch) | |
| tree | e4d6df18249b982c6de702efc452e9f39d1ce6e8 /tests | |
| parent | 68c4eab949fa40d055ace41be84780ef6ebbe643 (diff) | |
import: utils: Add function git->origin.
* guix/import/utils.scm: (git-origin, git->origin): Add procedures.
* guix/import/elpa.scm
(download-git-repository): Remove function download-git-repository.
(git-repository->origin): Remove function git-repository->origin.
(ref): Add function ref.
(melpa-recipe->origin): Use functions git->origin and ref.
* guix/import/go.scm
(git-checkout-hash): Remove function git-checkout-hash.
(transform-version): Add function transform-version.
(vcs->origin): Use functions git->origin and transform-version. Add
optional argument transform-version.
* tests/import/go.scm
(go-module->guix-package): Adapt test case to changes in guix/import/go.scm.
* guix/import/luanti.scm
(download-git-repository): Remove function download-git-repository.
(make-luanti-sexp): Use function git->origin.
* tests/luanti.scm
(make-package-sexp): Refresh function accordingly.
* guix/import/composer.scm
(make-php-sexp): Use function git->origin.
Change-Id: Ied05a63bdd60fbafe26fbbb4e115ff6f0bb9db3c
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/go.scm | 17 | ||||
| -rw-r--r-- | tests/luanti.scm | 8 |
2 files changed, 12 insertions, 13 deletions
diff --git a/tests/go.scm b/tests/go.scm index 1ba089c7885..a72f3068711 100644 --- a/tests/go.scm +++ b/tests/go.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2021 François Joulaud <francois.joulaud@radiofrance.com> ;;; Copyright © 2021 Sarah Morgensen <iskarian@mgsn.dev> +;;; Copyright © 2023 Nicolas Graves <ngraves@ngraves.fr> ;;; ;;; This file is part of GNU Guix. ;;; @@ -24,7 +25,7 @@ #:use-module (guix base32) #:use-module (guix build-system go) #:use-module (guix import go) - #:use-module (guix base32) + #:use-module (guix import utils) #:use-module ((guix utils) #:select (call-with-temporary-directory)) #:use-module (guix tests) #:use-module (ice-9 match) @@ -407,13 +408,11 @@ package.") (mock-http-get fixtures-go-check-test)) (mock ((guix http-client) http-fetch (mock-http-fetch fixtures-go-check-test)) - (mock ((guix git) update-cached-checkout - (lambda* (url #:key ref) - ;; Return an empty directory and its hash. - (values checkout - (nix-base32-string->bytevector - "0sjjj9z1dhilhpc8pq4154czrb79z9cm044jvn75kxcjv6v5l2m5") - #f))) - (go-module->guix-package* "github.com/go-check/check"))))))) + (mock ((guix import utils) git->origin + ;; Mock an empty directory by replacing hash. + (lambda* (url proc #:key ref #:rest args) + (git-origin url (peek-body proc) "\ +0sjjj9z1dhilhpc8pq4154czrb79z9cm044jvn75kxcjv6v5l2m5"))) + (go-module->guix-package* "github.com/go-check/check"))))))) (test-end "go") diff --git a/tests/luanti.scm b/tests/luanti.scm index 6ee0340e935..6df547c8f44 100644 --- a/tests/luanti.scm +++ b/tests/luanti.scm @@ -61,11 +61,11 @@ (origin (method git-fetch) (uri (git-reference - (url ,(and (not (eq? repo 'null)) repo)) - (commit #f))) + (url ,(and (not (eq? repo 'null)) repo)) + (commit #f))) + (file-name (git-file-name name version)) (sha256 - (base32 #f)) - (file-name (git-file-name name version)))) + (base32 #f)))) (build-system luanti-mod-build-system) ,@(maybe-propagated-inputs inputs) (home-page ,home-page) |
