diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2023-01-07 15:22:14 +0100 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2023-01-16 13:41:27 +0100 |
| commit | 137b91f03bbb7f1df71cf10c4f79ae57fbcea400 (patch) | |
| tree | 02dcde29c2f45a810e2a714f33d6a2ec80ff0831 /tests/transformations.scm | |
| parent | f094c3831f382b7299a2aaa04d85f4b27320e9ec (diff) | |
transformations: Add '--with-version'.
This is a followup to 8aeccc6240ec45f0bc7bed655e0c8149ae4253eb.
* guix/transformations.scm (package-with-upstream-version): New procedure.
(transform-package-latest)[package-with-latest-upstream]: Remove.
Use 'package-with-upstream-version' instead.
(transform-package-version): New procedure.
(%transformations, %transformation-options)
(show-transformation-options-help/detailed): Add '-with-version'.
* tests/transformations.scm ("options->transformation, with-version"):
New test.
* doc/guix.texi (Package Transformation Options): Document '--with-version'.
(Defining Package Variants): Mention it.
Diffstat (limited to 'tests/transformations.scm')
| -rw-r--r-- | tests/transformations.scm | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/transformations.scm b/tests/transformations.scm index 5c136e1d48e..1fa2c0bba82 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-2022 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2016-2017, 2019-2023 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,23 @@ | |||
| 497 | `((with-latest . "foo"))))) | 497 | `((with-latest . "foo"))))) |
| 498 | (package-version (t p))))) | 498 | (package-version (t p))))) |
| 499 | 499 | ||
| 500 | (test-equal "options->transformation, with-version" | ||
| 501 | "1.0" | ||
| 502 | (mock ((guix upstream) %updaters | ||
| 503 | (delay (list (upstream-updater | ||
| 504 | (name 'dummy) | ||
| 505 | (pred (const #t)) | ||
| 506 | (description "") | ||
| 507 | (import (const (upstream-source | ||
| 508 | (package "foo") | ||
| 509 | (version "1.0") | ||
| 510 | (urls '("http://example.org"))))))))) | ||
| 511 | (let* ((p0 (dummy-package "foo" (version "7.7"))) | ||
| 512 | (p1 (dummy-package "bar" (inputs (list p0)))) | ||
| 513 | (t (options->transformation | ||
| 514 | `((with-version . "foo=1.0"))))) | ||
| 515 | (package-version (lookup-package-input (t p1) "foo"))))) | ||
| 516 | |||
| 500 | (test-equal "options->transformation, tune" | 517 | (test-equal "options->transformation, tune" |
| 501 | '(cpu-tuning . "superfast") | 518 | '(cpu-tuning . "superfast") |
| 502 | (let* ((p0 (dummy-package "p0")) | 519 | (let* ((p0 (dummy-package "p0")) |
