[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/03: profiles: Report "pseudo-upgrades" as upgrades, not downgrades.

From: Ludovic Courtès
Subject: 02/03: profiles: Report "pseudo-upgrades" as upgrades, not downgrades.
Date: Mon, 09 Feb 2015 17:18:50 +0000

civodul pushed a commit to branch master
in repository guix.

commit 3bea13bb1f571445185d376f76e1785a5777282e
Author: Ludovic Courtès <address@hidden>
Date:   Mon Feb 9 17:18:48 2015 +0100

    profiles: Report "pseudo-upgrades" as upgrades, not downgrades.
    Reported by Andreas Enge <address@hidden>
    at <>.
    * guix/profiles.scm (manifest-transaction-effects): Use 'version>=?'
      instead of 'version>?'.
    * tests/profiles.scm ("manifest-transaction-effects and
      pseudo-upgrades"): New test.
 guix/profiles.scm  |    4 ++--
 tests/profiles.scm |    8 ++++++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/guix/profiles.scm b/guix/profiles.scm
index ac20091..a0a259b 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -331,8 +331,8 @@ replace it."
        (let* ((pattern  (manifest-entry->pattern entry))
               (previous (manifest-lookup manifest pattern))
               (newer?   (and previous
-                             (version>? (manifest-entry-version entry)
-                                        (manifest-entry-version previous)))))
+                             (version>=? (manifest-entry-version entry)
+                                         (manifest-entry-version previous)))))
          (loop rest
                (if previous install (cons entry install))
                (if (and previous newer?)
diff --git a/tests/profiles.scm b/tests/profiles.scm
index c210123..833b08b 100644
--- a/tests/profiles.scm
+++ b/tests/profiles.scm
@@ -169,6 +169,14 @@
       (and (null? remove) (null? install) (null? upgrade)
            (equal? (list (cons guile-2.0.9 guile-1.8.8)) downgrade)))))
+(test-assert "manifest-transaction-effects and pseudo-upgrades"
+  (let* ((m0 (manifest (list guile-2.0.9)))
+         (t  (manifest-transaction (install (list guile-2.0.9)))))
+    (let-values (((remove install upgrade downgrade)
+                  (manifest-transaction-effects m0 t)))
+      (and (null? remove) (null? install) (null? downgrade)
+           (equal? (list (cons guile-2.0.9 guile-2.0.9)) upgrade)))))
 (test-assertm "profile-derivation"
   (mlet* %store-monad
       ((entry ->   (package->manifest-entry %bootstrap-guile))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]