diff options
author | Greg Hogan <code@greghogan.com> | 2024-11-22 14:29:39 +0000 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2024-12-02 12:00:52 +0100 |
commit | 522732d5c15e44fc9e061f36a41f7129edfee66f (patch) | |
tree | 45d104e441f18df825faaeb59f6224ba62ea7e97 /tests | |
parent | 62f8399e6ac76af85ed72157bea2885d531c06fb (diff) |
packages: 'package-input-rewriting/spec' optionally replace hidden.
Commit eee95b5a879b7096dffd533f24107cf8926b621e changed package
rewriting to ignore hidden packages. This patch permits the previous use
by adding an option to rewrite hidden packages.
* guix/packages.scm (package-input-rewriting/spec)[rewrite]: When P is
hidden, return it as-is unless #:replace-hidden? has been enabled.
* tests/packages.scm ("package-input-rewriting/spec, replace hidden
package"): New test.
* doc/guix.texi (Defining Package Variants): Update.
Change-Id: I0a7988cac70e0c6b88b0fe6e27c1036fa723e030
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/packages.scm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/packages.scm b/tests/packages.scm index a623628447..7c28e75c45 100644 --- a/tests/packages.scm +++ b/tests/packages.scm @@ -1628,6 +1628,21 @@ (match (delete-duplicates pythons eq?) ((p) (eq? p python))))) +(test-assert "package-input-rewriting/spec, replace hidden package" + ;; Rewrite hidden packages when requested. + (let* ((python (hidden-package python)) + (p0 (dummy-package "chbouib" + (build-system trivial-build-system) + (inputs (list python)))) + (rewrite (package-input-rewriting/spec + `(("python" . ,(const sed))) + #:replace-hidden? #t)) + (p1 (rewrite p0))) + (match (package-inputs p1) + ((("python" python)) + (and (string=? (package-full-name python) + (package-full-name sed))))))) + (test-equal "package-input-rewriting/spec, graft" (derivation-file-name (package-derivation %store sed)) |