unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: 56612@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>
Subject: [bug#56612] [PATCH] guix install: Add '--manifest' option.
Date: Sun, 17 Jul 2022 12:20:35 +0200	[thread overview]
Message-ID: <20220717102035.9150-1-ludo@gnu.org> (raw)

* guix/scripts/install.scm (show-help, %options): Add "--manifest".
* tests/guix-package-aliases.sh" Test "guix install -m".
---
 guix/scripts/install.scm      |  8 ++++++--
 tests/guix-package-aliases.sh | 16 +++++++++++++---
 2 files changed, 19 insertions(+), 5 deletions(-)

Hi!

I think it’s convenient and quite natural to be able to type:

  guix install -m manifest.scm

Hence this patch.  Objections?  :-)

Thanks,
Ludo’.

diff --git a/guix/scripts/install.scm b/guix/scripts/install.scm
index 63e625f266..0d24d7c956 100644
--- a/guix/scripts/install.scm
+++ b/guix/scripts/install.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2019, 2020, 2022 Ludovic Courtès <ludo@gnu.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -33,6 +33,9 @@ (define (show-help)
 This is an alias for 'guix package -i'.\n"))
   (display (G_ "
   -p, --profile=PROFILE  use PROFILE instead of the user's default profile"))
+  (display (G_ "
+  -m, --manifest=FILE    create a new profile generation with the manifest
+                         from FILE"))
   ;; '--bootstrap' not shown here.
   (display (G_ "
   -v, --verbosity=LEVEL  use the given verbosity LEVEL"))
@@ -61,7 +64,8 @@ (define %options
          ;; Preserve some of the 'guix package' options.
          (append (filter (lambda (option)
                            (any (cut member <> (option-names option))
-                                '("profile" "dry-run" "verbosity" "bootstrap")))
+                                '("profile" "dry-run" "verbosity" "bootstrap"
+                                  "manifest")))
                          %package-options)
 
                  %transformation-options
diff --git a/tests/guix-package-aliases.sh b/tests/guix-package-aliases.sh
index 311838b768..99cb9176cd 100644
--- a/tests/guix-package-aliases.sh
+++ b/tests/guix-package-aliases.sh
@@ -1,5 +1,5 @@
 # GNU Guix --- Functional package management for GNU
-# Copyright © 2019, 2020 Ludovic Courtès <ludo@gnu.org>
+# Copyright © 2019, 2020, 2022 Ludovic Courtès <ludo@gnu.org>
 #
 # This file is part of GNU Guix.
 #
@@ -28,9 +28,10 @@ readlink_base ()
 }
 
 profile="t-profile-$$"
-rm -f "$profile"
+manifest="t-manifest-$$"
+rm -f "$profile" "$manifest"
 
-trap 'rm -f "$profile" "$profile-"[0-9]*' EXIT
+trap 'rm -f "$profile" "$profile-"[0-9]* "$manifest"' EXIT
 
 guix install --bootstrap guile-bootstrap -p "$profile"
 test -x "$profile/bin/guile"
@@ -55,6 +56,15 @@ guix remove --bootstrap guile-bootstrap -p "$profile"
 ! test -x "$profile/bin/guile"
 test `guix package -p "$profile" -I | wc -l` -eq 0
 
+# Installing from a manifest.
+cat > "$manifest" <<EOF
+(specifications->manifest '("guile-bootstrap"))
+EOF
+guix install -p "$profile" -m "$manifest" --bootstrap
+test -x "$profile/bin/guile"
+guix remove --bootstrap guile-bootstrap -p "$profile"
+! test -x "$profile/bin/guile"
+
 ! guix remove -p "$profile" this-is-not-installed --bootstrap
 
 ! guix remove -i guile-bootstrap -p "$profile" --bootstrap
-- 
2.36.1





             reply	other threads:[~2022-07-17 10:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-17 10:20 Ludovic Courtès [this message]
2022-07-19 10:01 ` [bug#56612] [PATCH] guix install: Add '--manifest' option Liliana Marie Prikler
2022-07-21  9:09   ` Ludovic Courtès
2022-07-21 10:37     ` Tobias Geerinckx-Rice via Guix-patches via
2022-07-22 20:58       ` 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=20220717102035.9150-1-ludo@gnu.org \
    --to=ludo@gnu.org \
    --cc=56612@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).