summary refs log tree commit diff
path: root/scripts/guix.in
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-02-20 23:46:38 +0100
committerLudovic Courtès <ludo@gnu.org>2013-02-20 23:47:16 +0100
commitf651b477b701d086402c18665eca68b26c3bec6b (patch)
treee0d9d10df8488ddd63eff3be5c3f9d3c1d66b290 /scripts/guix.in
parent9bb2b96aabdbb245c4a409e96b25df2954cfe385 (diff)
downloadguix-f651b477b701d086402c18665eca68b26c3bec6b.tar.gz
Add "guix pull".
* guix/scripts/pull.scm: New file.
* Makefile.am (MODULES): Add it.
* doc/guix.texi (Invoking guix pull): New node.
  (Invoking guix package): Add cross-ref to it.
* guix/ui.scm (config-directory): New procedure.
* scripts/guix.in: When `GUIX_UNINSTALLED' is undefined, add
  $XDG_CONFIG_HOME/guix/latest to the search path.
* po/POTFILES.in: Add guix/scripts/pull.scm.
Diffstat (limited to 'scripts/guix.in')
-rw-r--r--scripts/guix.in12
1 files changed, 10 insertions, 2 deletions
diff --git a/scripts/guix.in b/scripts/guix.in
index 2fdde7d13a..1315789a9c 100644
--- a/scripts/guix.in
+++ b/scripts/guix.in
@@ -22,7 +22,8 @@
 ;; IMPORTANT: We must avoid loading any modules from Guix here,
 ;; because we need to adjust the guile load paths first.
 ;; It's okay to import modules from core Guile though.
-(use-modules (ice-9 regex))
+(use-modules (ice-9 regex)
+             (srfi srfi-26))
 
 (let ()
   (define-syntax-rule (push! elt v) (set! v (cons elt v)))
@@ -45,7 +46,14 @@
     (unless (getenv "GUIX_UNINSTALLED")
       (let ((module-dir (config-lookup "guilemoduledir")))
         (push! module-dir %load-path)
-        (push! module-dir %load-compiled-path))))
+        (push! module-dir %load-compiled-path))
+      (let ((updates-dir (and=> (or (getenv "XDG_CONFIG_HOME")
+                                    (and=> (getenv "HOME")
+                                           (cut string-append <> "/.config")))
+                                (cut string-append <> "/guix/latest"))))
+        (when (file-exists? updates-dir)
+          (push! updates-dir %load-path)
+          (push! updates-dir %load-compiled-path)))))
 
   (define (run-guix-main)
     (let ((guix-main (module-ref (resolve-interface '(guix ui))