From 137b91f03bbb7f1df71cf10c4f79ae57fbcea400 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sat, 7 Jan 2023 15:22:14 +0100 Subject: 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. --- tests/transformations.scm | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/transformations.scm b/tests/transformations.scm index 5c136e1d48..1fa2c0bba8 100644 --- a/tests/transformations.scm +++ b/tests/transformations.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2016-2017, 2019-2022 Ludovic Courtès +;;; Copyright © 2016-2017, 2019-2023 Ludovic Courtès ;;; Copyright © 2021 Marius Bakke ;;; ;;; This file is part of GNU Guix. @@ -497,6 +497,23 @@ (define (package-name* obj) `((with-latest . "foo"))))) (package-version (t p))))) +(test-equal "options->transformation, with-version" + "1.0" + (mock ((guix upstream) %updaters + (delay (list (upstream-updater + (name 'dummy) + (pred (const #t)) + (description "") + (import (const (upstream-source + (package "foo") + (version "1.0") + (urls '("http://example.org"))))))))) + (let* ((p0 (dummy-package "foo" (version "7.7"))) + (p1 (dummy-package "bar" (inputs (list p0)))) + (t (options->transformation + `((with-version . "foo=1.0"))))) + (package-version (lookup-package-input (t p1) "foo"))))) + (test-equal "options->transformation, tune" '(cpu-tuning . "superfast") (let* ((p0 (dummy-package "p0")) -- cgit v1.2.3