From 46b23e1a436d209d6b96daee4bc398f102267502 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Sun, 8 Feb 2015 18:52:00 +0100 Subject: profiles: Distinguish downgrades from upgrades. Fixes . * guix/profiles.scm (manifest-transaction-effects): Return downgraded packages as a fourth value. * guix/ui.scm (show-manifest-transaction): Adjust accordingly. * tests/profiles.scm ("manifest-transaction-effects and downgrades"): New test. --- tests/profiles.scm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'tests') diff --git a/tests/profiles.scm b/tests/profiles.scm index d816248994..c210123f74 100644 --- a/tests/profiles.scm +++ b/tests/profiles.scm @@ -1,5 +1,5 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2013, 2014 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015 Ludovic Courtès ;;; Copyright © 2014 Alex Kost ;;; ;;; This file is part of GNU Guix. @@ -155,12 +155,20 @@ (t (manifest-transaction (install (list guile-2.0.9 glibc)) (remove (list (manifest-pattern (name "coreutils"))))))) - (let-values (((remove install upgrade) + (let-values (((remove install upgrade downgrade) (manifest-transaction-effects m0 t))) - (and (null? remove) + (and (null? remove) (null? downgrade) (equal? (list glibc) install) (equal? (list (cons guile-1.8.8 guile-2.0.9)) upgrade))))) +(test-assert "manifest-transaction-effects and downgrades" + (let* ((m0 (manifest (list guile-2.0.9))) + (t (manifest-transaction (install (list guile-1.8.8))))) + (let-values (((remove install upgrade downgrade) + (manifest-transaction-effects m0 t))) + (and (null? remove) (null? install) (null? upgrade) + (equal? (list (cons guile-2.0.9 guile-1.8.8)) downgrade))))) + (test-assertm "profile-derivation" (mlet* %store-monad ((entry -> (package->manifest-entry %bootstrap-guile)) -- cgit 1.4.1