summaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-01-16 10:57:19 +0100
committerLudovic Courtès <ludo@gnu.org>2020-01-16 18:30:57 +0100
commit84c5da08dda4fa8fd0e0f1e6a8a115190005f84a (patch)
treef9a553a07bb500e6ebc763ec5342c53445e13a0d /guix
parent4fe01b09ea0b304b963b7fd9f168439ddfb515c1 (diff)
downloadpatches-84c5da08dda4fa8fd0e0f1e6a8a115190005f84a.tar
patches-84c5da08dda4fa8fd0e0f1e6a8a115190005f84a.tar.gz
guix package: Export 'transaction-upgrade-entry'.
* guix/scripts/package.scm (transaction-upgrade-entry): Add 'store' parameter and use it instead of (%store). Export. * tests/packages.scm ("transaction-upgrade-entry, zero upgrades") ("transaction-upgrade-entry, one upgrade") ("transaction-upgrade-entry, superseded package"): Adjust accordingly.
Diffstat (limited to 'guix')
-rw-r--r--guix/scripts/package.scm8
1 files changed, 5 insertions, 3 deletions
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 0fe25aee6f..f4d92a649e 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -63,6 +63,8 @@
delete-matching-generations
guix-package
+ transaction-upgrade-entry ;mostly for testing
+
(%options . %package-options)
(%default-options . %package-default-options)
guix-package*))
@@ -205,7 +207,7 @@ non-zero relevance score."
(package-full-name package2))
(> score1 score2))))))))))
-(define (transaction-upgrade-entry entry transaction)
+(define (transaction-upgrade-entry store entry transaction)
"Return a variant of TRANSACTION that accounts for the upgrade of ENTRY, a
<manifest-entry>."
(define (supersede old new)
@@ -242,7 +244,7 @@ non-zero relevance score."
transaction)
((=)
(let ((candidate-path (derivation->output-path
- (package-derivation (%store) pkg))))
+ (package-derivation store pkg))))
;; XXX: When there are propagated inputs, assume we need to
;; upgrade the whole entry.
(if (and (string=? path candidate-path)
@@ -600,7 +602,7 @@ and upgrades."
(define upgraded
(fold (lambda (entry transaction)
(if (upgrade? (manifest-entry-name entry))
- (transaction-upgrade-entry entry transaction)
+ (transaction-upgrade-entry (%store) entry transaction)
transaction))
transaction
(manifest-entries manifest)))