guix-commits
[Top][All Lists]
Advanced

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

03/03: guix system: Fix mistaken 'guix pull' warning upon 'reconfigure'.


From: guix-commits
Subject: 03/03: guix system: Fix mistaken 'guix pull' warning upon 'reconfigure'.
Date: Tue, 24 Mar 2020 13:54:54 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 637db76d7ad1af5323a6a6b87b8a6a2e6dfed754
Author: Ludovic Courtès <address@hidden>
AuthorDate: Tue Mar 24 18:12:30 2020 +0100

    guix system: Fix mistaken 'guix pull' warning upon 'reconfigure'.
    
    Fixes <https://bugs.gnu.org/38196>.
    Reported by Florian Pelz <address@hidden>.
    
    * guix/scripts/system.scm (maybe-suggest-running-guix-pull): Check
    whether 'current-profile' returns true instead of checking for the
    existence of ~root/.config/guix/current.  That way, "sudo guix system
    reconfigure" no longer emits a warning in that case.
---
 guix/scripts/system.scm | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 8d19382..61a3c95 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -27,6 +27,7 @@
   #:use-module ((guix status) #:select (with-status-verbosity))
   #:use-module (guix store)
   #:autoload   (guix store database) (register-path)
+  #:use-module (guix describe)
   #:use-module (guix grafts)
   #:use-module (guix gexp)
   #:use-module (guix derivations)
@@ -718,16 +719,11 @@ checking this by themselves in their 'check' procedure."
 
 (define (maybe-suggest-running-guix-pull)
   "Suggest running 'guix pull' if this has never been done before."
-  ;; The reason for this is that the 'guix' binding that we see here comes
-  ;; from either ~/.config/latest or, if it's missing, from the
-  ;; globally-installed Guix, which is necessarily older.  See
-  ;; <http://lists.gnu.org/archive/html/guix-devel/2014-08/msg00057.html> for
-  ;; a discussion.
-  (define latest
-    (string-append (config-directory) "/current"))
-
-  (unless (file-exists? latest)
-    (warning (G_ "~a not found: 'guix pull' was never run~%") latest)
+  ;; Check whether we're running a 'guix pull'-provided 'guix' command.  When
+  ;; 'current-profile' returns #f, we may be running the globally-installed
+  ;; 'guix' and thus run the risk of deploying an older 'guix'.  See
+  ;; <https://lists.gnu.org/archive/html/guix-devel/2014-08/msg00057.html>
+  (unless (or (current-profile) (getenv "GUIX_UNINSTALLED"))
     (warning (G_ "Consider running 'guix pull' before 'reconfigure'.~%"))
     (warning (G_ "Failing to do that may downgrade your system!~%"))))
 



reply via email to

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