1
0
mirror of https://git.savannah.gnu.org/git/guix.git synced 2026-05-28 12:01:49 +02:00

guix package: Re-apply package transformation when upgrading.

* guix/scripts/package.scm (transaction-upgrade-entry)[upgrade]: Add
'transform' parameter.  Pass PKG through it.  Use
'manifest-entry-with-transformations'.
Call 'options->transformation' to get the transformation procedure.
* tests/guix-package.sh: Add 'guix package -u' test.
* tests/packages.scm ("transaction-upgrade-entry, transformation options preserved"):
New test.
* doc/guix.texi (Invoking guix package): Mention that transformations
are preserved across upgrades.
(Package Transformation Options): Likewise.
This commit is contained in:
Ludovic Courtès
2020-09-25 17:16:34 +02:00
parent ad54a73bb8
commit 8e1907a724
4 changed files with 80 additions and 5 deletions
+23
View File
@@ -187,6 +187,29 @@
(string=? (manifest-pattern-version pattern) "1")
(string=? (manifest-pattern-output pattern) "out")))))))
(test-equal "transaction-upgrade-entry, transformation options preserved"
(derivation-file-name (package-derivation %store grep))
(let* ((old (dummy-package "emacs" (version "1")))
(props '((transformations . ((with-input . "emacs=grep")))))
(tx (transaction-upgrade-entry
%store
(manifest-entry
(inherit (package->manifest-entry old))
(properties props)
(item (string-append (%store-prefix) "/"
(make-string 32 #\e) "-foo-1")))
(manifest-transaction))))
(match (manifest-transaction-install tx)
(((? manifest-entry? entry))
(and (string=? (manifest-entry-version entry)
(package-version grep))
(string=? (manifest-entry-name entry)
(package-name grep))
(equal? (manifest-entry-properties entry) props)
(derivation-file-name
(package-derivation %store (manifest-entry-item entry))))))))
(test-assert "transaction-upgrade-entry, grafts"
;; Ensure that, when grafts are enabled, 'transaction-upgrade-entry' doesn't
;; try to build stuff.