mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
profiles: Add 'manifest-transaction-removal-candidate?'.
* guix/profiles.scm (manifest-transaction-removal-candidate?): New procedure. * tests/profiles.scm ("manifest-transaction-removal-candidate?"): New test.
This commit is contained in:
parent
94a400beba
commit
6d382339de
2 changed files with 14 additions and 0 deletions
|
@ -96,6 +96,7 @@ (define-module (guix profiles)
|
|||
manifest-transaction-install-entry
|
||||
manifest-transaction-remove-pattern
|
||||
manifest-transaction-null?
|
||||
manifest-transaction-removal-candidate?
|
||||
manifest-perform-transaction
|
||||
manifest-transaction-effects
|
||||
|
||||
|
@ -564,6 +565,12 @@ (define (manifest-transaction-null? transaction)
|
|||
(($ <manifest-transaction> () ()) #t)
|
||||
(($ <manifest-transaction> _ _) #f)))
|
||||
|
||||
(define (manifest-transaction-removal-candidate? entry transaction)
|
||||
"Return true if ENTRY is a candidate for removal in TRANSACTION."
|
||||
(any (lambda (pattern)
|
||||
((entry-predicate pattern) entry))
|
||||
(manifest-transaction-remove transaction)))
|
||||
|
||||
(define (manifest-transaction-effects manifest transaction)
|
||||
"Compute the effect of applying TRANSACTION to MANIFEST. Return 4 values:
|
||||
the list of packages that would be removed, installed, upgraded, or downgraded
|
||||
|
|
|
@ -197,6 +197,13 @@ (define glibc
|
|||
(test-assert "manifest-transaction-null?"
|
||||
(manifest-transaction-null? (manifest-transaction)))
|
||||
|
||||
(test-assert "manifest-transaction-removal-candidate?"
|
||||
(let ((m (manifest (list guile-2.0.9)))
|
||||
(t (manifest-transaction
|
||||
(remove (list (manifest-pattern (name "guile")))))))
|
||||
(and (manifest-transaction-removal-candidate? guile-2.0.9 t)
|
||||
(not (manifest-transaction-removal-candidate? glibc t)))))
|
||||
|
||||
(test-assertm "profile-derivation"
|
||||
(mlet* %store-monad
|
||||
((entry -> (package->manifest-entry %bootstrap-guile))
|
||||
|
|
Loading…
Reference in a new issue