guix-commits
[Top][All Lists]
Advanced

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

03/04: guix package: 'guix package -r PKG -u' does not upgrade PKG.


From: Ludovic Courtès
Subject: 03/04: guix package: 'guix package -r PKG -u' does not upgrade PKG.
Date: Mon, 26 Jun 2017 16:52:15 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit fc8fdcf56ecc159cb4e85ffdde60a54c4fa5c04f
Author: Ludovic Courtès <address@hidden>
Date:   Mon Jun 26 22:48:57 2017 +0200

    guix package: 'guix package -r PKG -u' does not upgrade PKG.
    
    Fixes <http://bugs.gnu.org/27262>.
    Reported by Mark H Weaver <address@hidden>.
    
    * guix/scripts/package.scm (transaction-upgrade-entry): Check if ENTRY
    matches 'manifest-transaction-removal-candidate?' and return TRANSACTION
    if it does.
    (process-actions): Move 'options->removable' from step 2 to step 1.
---
 guix/scripts/package.scm | 14 +++++++++-----
 tests/guix-package.sh    | 19 +++++++++++++++++++
 2 files changed, 28 insertions(+), 5 deletions(-)

diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm
index 1f835ca..400623d 100644
--- a/guix/scripts/package.scm
+++ b/guix/scripts/package.scm
@@ -294,7 +294,11 @@ of relevance scores."
         (output (manifest-entry-output old)))
       transaction)))
 
-  (match entry
+  (match (if (manifest-transaction-removal-candidate? entry transaction)
+             'dismiss
+             entry)
+    ('dismiss
+     transaction)
     (($ <manifest-entry> name version output (? string? path))
      (match (vhash-assoc name (find-newest-available-packages))
        ((_ candidate-version pkg . rest)
@@ -875,11 +879,11 @@ processed, #f otherwise."
                               #:dry-run? dry-run?)))))
             opts)
 
-  ;; Then, process normal package installation/removal/upgrade.
+  ;; Then, process normal package removal/installation/upgrade.
   (let* ((manifest (profile-manifest profile))
-         (step1    (options->installable opts manifest
-                                         (manifest-transaction)))
-         (step2    (options->removable opts manifest step1))
+         (step1    (options->removable opts manifest
+                                       (manifest-transaction)))
+         (step2    (options->installable opts manifest step1))
          (step3    (manifest-transaction
                     (inherit step2)
                     (install (map transform-entry
diff --git a/tests/guix-package.sh b/tests/guix-package.sh
index 5ecb331..99952f1 100644
--- a/tests/guix-package.sh
+++ b/tests/guix-package.sh
@@ -279,8 +279,27 @@ guix package --bootstrap 
--install-from-file="$module_dir/package.scm"
 test "`guix package -A super-non-portable-emacs`" = ""
 test "`guix package -s super-non-portable-emacs | grep ^systems:`" = "systems: 
"
 
+# Don't upgrade packages marked for removal: <http://bugs.gnu.org/27262>.
+guix package --bootstrap -p "$profile" -i guile-bootstrap
+
+cat > "$module_dir/foo.scm"<<EOF
+(define-module (foo)
+  #:use-module (guix)
+  #:use-module (gnu packages bootstrap))
+
+(define-public x
+  (package (inherit %bootstrap-guile) (version "42")))
+EOF
+
+guix package --bootstrap -p "$profile" -r guile-bootstrap -u guile
+test ! -f "$profile/bin/guile"
+guix package --bootstrap -p "$profile" --roll-back
+test -f "$profile/bin/guile"
+rm "$profile-2-link"
+
 unset GUIX_PACKAGE_PATH
 
+
 # Using 'GUIX_BUILD_OPTIONS'.
 available="`guix package -A | sort`"
 GUIX_BUILD_OPTIONS="--dry-run --no-grafts"



reply via email to

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