From patchwork Sun Jul 17 10:20:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 3780 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id CC52327BBEA; Sun, 17 Jul 2022 11:21:26 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 4821D27BBE9 for ; Sun, 17 Jul 2022 11:21:26 +0100 (BST) Received: from localhost ([::1]:57268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oD1Ov-0005iO-Db for patchwork@mira.cbaines.net; Sun, 17 Jul 2022 06:21:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35668) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oD1OY-0005hz-CK for guix-patches@gnu.org; Sun, 17 Jul 2022 06:21:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:49018) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oD1OY-0003qX-3c for guix-patches@gnu.org; Sun, 17 Jul 2022 06:21:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oD1OX-0000bo-W3 for guix-patches@gnu.org; Sun, 17 Jul 2022 06:21:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#56612] [PATCH] guix install: Add '--manifest' option. Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 17 Jul 2022 10:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 56612 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 56612@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16580532462296 (code B ref -1); Sun, 17 Jul 2022 10:21:01 +0000 Received: (at submit) by debbugs.gnu.org; 17 Jul 2022 10:20:46 +0000 Received: from localhost ([127.0.0.1]:46777 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oD1OH-0000ax-Q9 for submit@debbugs.gnu.org; Sun, 17 Jul 2022 06:20:46 -0400 Received: from lists.gnu.org ([209.51.188.17]:44570) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oD1OG-0000aq-Fr for submit@debbugs.gnu.org; Sun, 17 Jul 2022 06:20:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35448) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oD1OG-0005gE-Ai for guix-patches@gnu.org; Sun, 17 Jul 2022 06:20:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:44068) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oD1OF-0003ns-Af; Sun, 17 Jul 2022 06:20:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:Subject:To:From:in-reply-to: references; bh=w3fC0/ATU6fZw3dm/eqojhXMzwkD4zq9PbC2KmKvse4=; b=scEX3PiTWsoy2p trHrsm92GKhzkt3OFcVt3+eli3V0j15C0SIThyK6bPDdT+F42PrR1B95DfsO9mYc+lX5xifm+Aby9 n+YqbISZuIeW2jNmKNHesrcHQEqJXrrWZSvUmmlp7oRavMcgZxSqyX+yKLVpGVtmDvQiIJLIIEQ/s DTSJyhFTv0KSM3IUgOa1iy6awyuhzi84jIr0tmQX9kDWuHmYfNiOUz6QAvqat1O+NB3BY2xqFv+th GTcGTvpvhNQOmZ2WZR0z+YdVYw8ZJdXewTvPKtgd8nnEmNZBx+zvMWAY77ijlRthC+WXK7Zo40m9P WE1uma9wbfNH1Mllg/TA==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201]:51886 helo=gnu.org) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oD1OE-0003Yk-Pq; Sun, 17 Jul 2022 06:20:42 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= Date: Sun, 17 Jul 2022 12:20:35 +0200 Message-Id: <20220717102035.9150-1-ludo@gnu.org> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * 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 +;;; Copyright © 2019, 2020, 2022 Ludovic Courtès ;;; ;;; 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 +# Copyright © 2019, 2020, 2022 Ludovic Courtès # # 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" <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