summaryrefslogtreecommitdiff
path: root/guix/scripts/system.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-04-06 12:00:29 +0200
committerLudovic Courtès <ludo@gnu.org>2016-04-06 12:00:29 +0200
commit933d2fe4cfb380f66af631a2203ec23c367e5b1a (patch)
treef10581ed0da1911eed9b02e69d999ba481d9d3c6 /guix/scripts/system.scm
parentf8835ff4b3dd59d59bf44838d05d3d60114d15d2 (diff)
parent998afc3608242b75051f43ece36d52474c51e285 (diff)
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/scripts/system.scm')
-rw-r--r--guix/scripts/system.scm18
1 files changed, 18 insertions, 0 deletions
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index 8ebeb4d595..566e7e8768 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