unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 32632@debbugs.gnu.org
Subject: [bug#32632] [PATCH 1/3] pull: Add '--profile'.
Date: Tue,  4 Sep 2018 14:23:43 +0200	[thread overview]
Message-ID: <20180904122345.23979-1-ludo@gnu.org> (raw)
In-Reply-To: <20180904120925.23653-1-ludo@gnu.org>

* guix/scripts/pull.scm (show-help, %options): Add '--profile'.
(build-and-install): Change 'config-dir' argument to 'profile'.
(guix-pull): Honor '--profile'.
* doc/guix.texi (Invoking guix pull): Document it.
---
 doc/guix.texi         |  4 ++++
 guix/scripts/pull.scm | 19 ++++++++++++-------
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index ad82c6793..c11505011 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -2849,6 +2849,10 @@ is provided, the subset of generations that match @var{pattern}.
 The syntax of @var{pattern} is the same as with @code{guix package
 --list-generations} (@pxref{Invoking guix package}).
 
+@item --profile=@var{profile}
+@itemx -p @var{profile}
+Use @var{profile} instead of @file{~/.config/guix/current}.
+
 @item --bootstrap
 Use the bootstrap Guile to build the latest Guix.  This option is only
 useful to Guix developers.
diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm
index 18c04f05d..ebc5dc9b1 100644
--- a/guix/scripts/pull.scm
+++ b/guix/scripts/pull.scm
@@ -79,6 +79,8 @@ Download and deploy the latest version of Guix.\n"))
   (display (G_ "
   -l, --list-generations[=PATTERN]
                          list generations matching PATTERN"))
+  (display (G_ "
+  -p, --profile=PROFILE  use PROFILE instead of ~/.config/guix/current"))
   (display (G_ "
       --bootstrap        use the bootstrap Guile to build the new Guix"))
   (newline)
@@ -113,6 +115,10 @@ Download and deploy the latest version of Guix.\n"))
                  (lambda (opt name arg result)
                    (alist-cons 'ref `(branch . ,(string-append "origin/" arg))
                                result)))
+         (option '(#\p "profile") #t #f
+                 (lambda (opt name arg result)
+                   (alist-cons 'profile (canonicalize-profile arg)
+                               result)))
          (option '(#\n "dry-run") #f #f
                  (lambda (opt name arg result)
                    (alist-cons 'dry-run? #t (alist-cons 'graft? #f result))))
@@ -152,15 +158,12 @@ Download and deploy the latest version of Guix.\n"))
                                       #:heading (G_ "New in this revision:\n"))))
     (_ #t)))
 
-(define* (build-and-install instances config-dir
+(define* (build-and-install instances profile
                             #:key verbose?)
-  "Build the tool from SOURCE, and install it in CONFIG-DIR."
+  "Build the tool from SOURCE, and install it in PROFILE."
   (define update-profile
     (store-lift build-and-use-profile))
 
-  (define profile
-    (string-append config-dir "/current"))
-
   (mlet %store-monad ((manifest (channel-instances->manifest instances)))
     (mbegin %store-monad
       (update-profile profile manifest)
@@ -414,7 +417,9 @@ Use '~/.config/guix/channels.scm' instead."))
      (let* ((opts     (parse-command-line args %options
                                           (list %default-options)))
             (cache    (string-append (cache-directory) "/pull"))
-            (channels (channel-list opts)))
+            (channels (channel-list opts))
+            (profile  (or (assoc-ref opts 'profile)
+                          (string-append (config-directory) "/current"))))
 
        (cond ((assoc-ref opts 'query)
               (process-query opts))
@@ -456,7 +461,7 @@ Use '~/.config/guix/channels.scm' instead."))
                                          %bootstrap-guile
                                          (canonical-package guile-2.2)))))
                       (run-with-store store
-                        (build-and-install instances (config-directory)
+                        (build-and-install instances profile
                                            #:verbose?
                                            (assoc-ref opts 'verbose?)))))))))))))
 
-- 
2.18.0

  reply	other threads:[~2018-09-04 12:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-04 12:09 [bug#32632] [PATCH 0/3] 'guix describe' and improved provenance tracking Ludovic Courtès
2018-09-04 12:23 ` Ludovic Courtès [this message]
2018-09-04 12:23   ` [bug#32632] [PATCH 2/3] Add 'guix describe' Ludovic Courtès
2018-09-04 12:23   ` [bug#32632] [PATCH 3/3] guix package: Record package provenance in manifest entries Ludovic Courtès
2018-09-07  9:45 ` bug#32632: [PATCH 0/3] 'guix describe' and improved provenance tracking Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180904122345.23979-1-ludo@gnu.org \
    --to=ludo@gnu.org \
    --cc=32632@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).