[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
10/11: guix system: Warn against missing 'guix pull'.
From: |
Ludovic Courtès |
Subject: |
10/11: guix system: Warn against missing 'guix pull'. |
Date: |
Mon, 28 Mar 2016 20:52:33 +0000 |
civodul pushed a commit to branch master
in repository guix.
commit 7f949db03e5dffa7873ce63723c0a92a28594511
Author: Ludovic Courtès <address@hidden>
Date: Mon Mar 28 22:49:42 2016 +0200
guix system: Warn against missing 'guix pull'.
Suggested by Leo Famulari and others.
* guix/scripts/system.scm (maybe-suggest-running-guix-pull): New
procedure.
(perform-action): Call it when ACTION is 'reconfigure.
---
guix/scripts/system.scm | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 8ebeb4d..566e7e8 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -482,6 +482,21 @@ PATTERN, a string. When PATTERN is #f, display all the
system generations."
((disk-image)
(system-disk-image os #:disk-image-size image-size))))
+(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) "/latest"))
+
+ (unless (file-exists? latest)
+ (warning (_ "~a not found: 'guix pull' was never run~%") latest)
+ (warning (_ "Consider running 'guix pull' before 'reconfigure'.~%"))
+ (warning (_ "Failing to do that may downgrade your system!~%"))))
+
(define* (perform-action action os
#:key grub? dry-run? derivations-only?
use-substitutes? device target
@@ -498,6 +513,9 @@ building anything."
(define println
(cut format #t "~a~%" <>))
+ (when (eq? action 'reconfigure)
+ (maybe-suggest-running-guix-pull))
+
(mlet* %store-monad
((sys (system-derivation-for-action os action
#:image-size image-size
- branch master updated (e0b90db -> 34bf416), Ludovic Courtès, 2016/03/28
- 06/11: doc: Suggest 'dhclient -v'., Ludovic Courtès, 2016/03/28
- 08/11: store: Prepend mirror.hydra.gnu.org to %DEFAULT-SUBSTITUTE-URLS., Ludovic Courtès, 2016/03/28
- 04/11: doc: Clarify 'cow-store'., Ludovic Courtès, 2016/03/28
- 10/11: guix system: Warn against missing 'guix pull'.,
Ludovic Courtès <=
- 05/11: doc: Suggest running "info info" during system installation., Ludovic Courtès, 2016/03/28
- 02/11: doc: Augment documentation about security updates., Ludovic Courtès, 2016/03/28
- 03/11: doc: Make it clear that networking is needed for GuixSD installation., Ludovic Courtès, 2016/03/28
- 07/11: doc: Explain why the config file should be stored on the target., Ludovic Courtès, 2016/03/28
- 09/11: doc: We have even more than 3,000 packages., Ludovic Courtès, 2016/03/28
- 11/11: Update NEWS., Ludovic Courtès, 2016/03/28
- 01/11: nls: Update 'da' translation., Ludovic Courtès, 2016/03/28