profiles: 'package->manifest-entry' preserves transformations by default.

Previously, transformations applied from a manifest (rather than via
"guix install") would be lost.  This change fixes that and simplifies
things.

Reported by zimoun at
<https://lists.gnu.org/archive/html/guix-devel/2021-02/msg00153.html>.

* guix/profiles.scm (default-properties): New procedure.
(package->manifest-entry): Use it for #:properties.
* guix/scripts/pack.scm (guix-pack)[with-transformations]: Remove.
Remove caller.
* guix/scripts/package.scm (transaction-upgrade-entry): Remove calls to
'manifest-entry-with-transformations'.
* tests/guix-package.sh: Add test.
* tests/transformations.scm ("options->transformation + package->manifest-entry"):
New test.
This commit is contained in:
Ludovic Courtès 2021-03-04 10:57:46 +01:00
parent c9d42d611c
commit 90ea8b16eb
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
5 changed files with 48 additions and 23 deletions

View file

@ -362,9 +362,16 @@ file name."
#t
lst)))
(define (default-properties package)
"Return the default properties of a manifest entry for PACKAGE."
;; Preserve transformation options by default.
(match (assq-ref (package-properties package) 'transformations)
(#f '())
(transformations `((transformations . ,transformations)))))
(define* (package->manifest-entry package #:optional (output "out")
#:key (parent (delay #f))
(properties '()))
(properties (default-properties package)))
"Return a manifest entry for the OUTPUT of package PACKAGE."
;; For each dependency, keep a promise pointing to its "parent" entry.
(letrec* ((deps (map (match-lambda