[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/06: guix package: Export 'transaction-upgrade-entry'.
From: |
guix-commits |
Subject: |
02/06: guix package: Export 'transaction-upgrade-entry'. |
Date: |
Thu, 16 Jan 2020 12:31:25 -0500 (EST) |
civodul pushed a commit to branch master
in repository guix.
commit 84c5da08dda4fa8fd0e0f1e6a8a115190005f84a
Author: Ludovic Courtès <address@hidden>
AuthorDate: Thu Jan 16 10:57:19 2020 +0100
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.
---
guix/scripts/package.scm | 8 +++++---
tests/packages.scm | 11 +++++++----
2 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 0fe25ae..f4d92a6 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)))
diff --git a/tests/packages.scm b/tests/packages.scm
index 423c506..1ff35ec 100644
--- a/tests/packages.scm
+++ b/tests/packages.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès
<address@hidden>
+;;; Copyright © 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Ludovic
Courtès <address@hidden>
;;; Copyright © Jan (janneke) Nieuwenhuizen <address@hidden>
;;;
;;; This file is part of GNU Guix.
@@ -100,7 +100,8 @@
(let* ((old (dummy-package "foo" (version "1")))
(tx (mock ((gnu packages) find-best-packages-by-name
(const '()))
- ((@@ (guix scripts package) transaction-upgrade-entry)
+ (transaction-upgrade-entry
+ #f ;no store access needed
(manifest-entry
(inherit (package->manifest-entry old))
(item (string-append (%store-prefix) "/"
@@ -113,7 +114,8 @@
(new (dummy-package "foo" (version "2")))
(tx (mock ((gnu packages) find-best-packages-by-name
(const (list new)))
- ((@@ (guix scripts package) transaction-upgrade-entry)
+ (transaction-upgrade-entry
+ #f ;no store access needed
(manifest-entry
(inherit (package->manifest-entry old))
(item (string-append (%store-prefix) "/"
@@ -130,7 +132,8 @@
(dep (deprecated-package "foo" new))
(tx (mock ((gnu packages) find-best-packages-by-name
(const (list dep)))
- ((@@ (guix scripts package) transaction-upgrade-entry)
+ (transaction-upgrade-entry
+ #f ;no store access needed
(manifest-entry
(inherit (package->manifest-entry old))
(item (string-append (%store-prefix) "/"
- branch master updated (a2548a3 -> fb8a77f), guix-commits, 2020/01/16
- 02/06: guix package: Export 'transaction-upgrade-entry'.,
guix-commits <=
- 05/06: gnu: guile-picture-language: Add "guile3.0-picture-language" variant., guix-commits, 2020/01/16
- 04/06: gnu: guile: Add 3.0.0., guix-commits, 2020/01/16
- 01/06: publish: Export 'signed-string'., guix-commits, 2020/01/16
- 06/06: gnu: guile-syntax-highlight: Add "guile3.0-syntax-highlight" variant., guix-commits, 2020/01/16
- 03/06: records: Improve reporting of "invalid field specifier" errors., guix-commits, 2020/01/16