aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2015-02-06 17:39:10 +0100
committerLudovic Courtès <ludo@gnu.org>2015-02-06 17:39:10 +0100
commit3df5acf332fd7b5c21c09961eaa5353c1bd08c60 (patch)
tree1ca19006a7377c06543d1e79155da89ab8a06659
parent95c559c145c3db8e26ae4c0bb09af9193703f956 (diff)
downloadgnu-guix-3df5acf332fd7b5c21c09961eaa5353c1bd08c60.tar
gnu-guix-3df5acf332fd7b5c21c09961eaa5353c1bd08c60.tar.gz
pull: Always install the ~/.config/guix/latest symlink.
Before that, if two users on the same machine ran 'guix pull', the second one would have the "Guix already up to date" message and their ~/.config/guix/latest link would be left unchanged---effectively preventing them from updating. * guix/scripts/pull.scm (build-and-install): Install the 'latest' symlink regardless of whether TO-DO? is true or false.
-rw-r--r--guix/scripts/pull.scm30
1 files changed, 17 insertions, 13 deletions
diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm
index 16805bad3f..e6ed8d23eb 100644
--- a/guix/scripts/pull.scm
+++ b/guix/scripts/pull.scm
@@ -1,5 +1,5 @@
;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2013, 2014 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013, 2014, 2015 Ludovic Courtès <ludo@gnu.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -188,22 +188,26 @@ contained therein."
(mlet* %store-monad ((source (build-from-source tarball
#:verbose? verbose?))
(source-dir -> (derivation->output-path source))
- (to-do? (what-to-build (list source))))
- (if to-do?
- (mlet* %store-monad ((built? (built-derivations (list source))))
- (if built?
- (mlet* %store-monad
- ((latest -> (string-append config-dir "/latest"))
- (done (indirect-root-added latest)))
+ (to-do? (what-to-build (list source)))
+ (built? (built-derivations (list source))))
+ ;; Always update the 'latest' symlink, regardless of whether SOURCE was
+ ;; already built or not.
+ (if built?
+ (mlet* %store-monad
+ ((latest -> (string-append config-dir "/latest"))
+ (done (indirect-root-added latest)))
+ (if (and (file-exists? latest)
+ (string=? (readlink latest) source-dir))
+ (begin
+ (display (_ "Guix already up to date\n"))
+ (return #t))
+ (begin
(switch-symlinks latest source-dir)
(format #t
(_ "updated ~a successfully deployed under `~a'~%")
%guix-package-name latest)
- (return #t))
- (leave (_ "failed to update Guix, check the build log~%"))))
- (begin
- (display (_ "Guix already up to date\n"))
- (return #t)))))
+ (return #t))))
+ (leave (_ "failed to update Guix, check the build log~%")))))
(define (guix-pull . args)
(define (parse-options)