From 6d382339de1c9fbe20ec056fb5200d5724a4aa44 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 26 Jun 2017 22:23:11 +0200 Subject: profiles: Add 'manifest-transaction-removal-candidate?'. * guix/profiles.scm (manifest-transaction-removal-candidate?): New procedure. * tests/profiles.scm ("manifest-transaction-removal-candidate?"): New test. --- guix/profiles.scm | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'guix') diff --git a/guix/profiles.scm b/guix/profiles.scm index dcb5186c7a..056406e303 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -96,6 +96,7 @@ 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 @@ remove software." (($ () ()) #t) (($ _ _) #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 -- cgit v1.2.3