diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2024-11-28 17:28:46 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2024-12-01 20:14:16 +0100 |
| commit | dbce5c2d47cda46854dc900a04ea101333d7d99a (patch) | |
| tree | 02725b30148663b89313aee152ca35044e7a3c82 /tests/transformations.scm | |
| parent | c6050cce28cfcbdc4c74886595da07005d33e3b0 (diff) | |
transformations: ‘package-with-upstream-version’ can preserve patches.
* guix/transformations.scm (upstream-fetch): New procedure.
(package-with-upstream-version): Add #:preserve-patches? and honor it.
Change-Id: Ib56b84957d8bdad2eebe2551e2a6e477506fc55e
Diffstat (limited to 'tests/transformations.scm')
| -rw-r--r-- | tests/transformations.scm | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/tests/transformations.scm b/tests/transformations.scm index 755211d65d9..5285d98f17e 100644 --- a/tests/transformations.scm +++ b/tests/transformations.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2016-2017, 2019-2023 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2016-2017, 2019-2024 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2021 Marius Bakke <marius@gnu.org> | 3 | ;;; Copyright © 2021 Marius Bakke <marius@gnu.org> |
| 4 | ;;; | 4 | ;;; |
| 5 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| @@ -497,6 +497,35 @@ | |||
| 497 | (let ((new (t coreutils))) | 497 | (let ((new (t coreutils))) |
| 498 | (assq-ref (package-properties new) 'transformations)))) | 498 | (assq-ref (package-properties new) 'transformations)))) |
| 499 | 499 | ||
| 500 | (test-equal "package-with-upstream-version" | ||
| 501 | '("42.0" "42.0" | ||
| 502 | ("http://example.org") | ||
| 503 | ("a" "b") (do something)) | ||
| 504 | (mock ((guix upstream) %updaters | ||
| 505 | (delay (list (upstream-updater | ||
| 506 | (name 'dummy) | ||
| 507 | (pred (const #t)) | ||
| 508 | (description "") | ||
| 509 | (import (const (upstream-source | ||
| 510 | (package "foo") | ||
| 511 | (version "42.0") | ||
| 512 | (urls '("http://example.org"))))))))) | ||
| 513 | (let* ((old (dummy-package "foo" (version "1.0") | ||
| 514 | (source (dummy-origin | ||
| 515 | (patches '("a" "b")) | ||
| 516 | (snippet '(do something)))))) | ||
| 517 | (new (package-with-upstream-version old)) | ||
| 518 | (new+patches (package-with-upstream-version | ||
| 519 | old #:preserve-patches? #t))) | ||
| 520 | (list (package-version new) (package-version new+patches) | ||
| 521 | |||
| 522 | ;; Source of NEW is directly an <upstream-source>. | ||
| 523 | (upstream-source-urls (package-source new)) | ||
| 524 | |||
| 525 | ;; Check that #:preserve-patches? #t gave us an origin. | ||
| 526 | (origin-patches (package-source new+patches)) | ||
| 527 | (origin-snippet (package-source new+patches)))))) | ||
| 528 | |||
| 500 | (test-equal "options->transformation, with-latest" | 529 | (test-equal "options->transformation, with-latest" |
| 501 | "42.0" | 530 | "42.0" |
| 502 | (mock ((guix upstream) %updaters | 531 | (mock ((guix upstream) %updaters |
