From patchwork Mon Oct 17 12:18:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\\(" X-Patchwork-Id: 43464 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 69F5827BBEA; Mon, 17 Oct 2022 13:19:27 +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=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,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 34E2327BBE9 for ; Mon, 17 Oct 2022 13:19:27 +0100 (BST) Received: from localhost ([::1]:36184 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1okP5a-00086o-Cc for patchwork@mira.cbaines.net; Mon, 17 Oct 2022 08:19:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58104) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okP5C-00084L-HW for guix-patches@gnu.org; Mon, 17 Oct 2022 08:19:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48608) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1okP5C-0006Qh-9M for guix-patches@gnu.org; Mon, 17 Oct 2022 08:19:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1okP5C-0006l5-3x for guix-patches@gnu.org; Mon, 17 Oct 2022 08:19:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58583] [PATCH 1/1] scripts: package: Forbid installation of the guix package. References: <20221017121642.15468-1-paren@disroot.org> In-Reply-To: <20221017121642.15468-1-paren@disroot.org> Resent-From: "(" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 17 Oct 2022 12:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58583 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58583@debbugs.gnu.org Cc: "\(" Received: via spool by 58583-submit@debbugs.gnu.org id=B58583.166600911825946 (code B ref 58583); Mon, 17 Oct 2022 12:19:02 +0000 Received: (at 58583) by debbugs.gnu.org; 17 Oct 2022 12:18:38 +0000 Received: from localhost ([127.0.0.1]:47686 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okP4n-0006kO-N3 for submit@debbugs.gnu.org; Mon, 17 Oct 2022 08:18:37 -0400 Received: from knopi.disroot.org ([178.21.23.139]:44206) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okP4l-0006kG-AH for 58583@debbugs.gnu.org; Mon, 17 Oct 2022 08:18:36 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id A717A4DBCA; Mon, 17 Oct 2022 14:18:34 +0200 (CEST) X-Virus-Scanned: SPAM Filter at disroot.org Received: from knopi.disroot.org ([127.0.0.1]) by localhost (disroot.org [127.0.0.1]) (amavisd-new, port 10024) with UTF8SMTP id JNmYG4ehTqLn; Mon, 17 Oct 2022 14:18:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1666009109; bh=ldZRAsN52bPmbU+2AoJEBuutUJRlSFOLGBm8KA+YX5Y=; h=From:To:Cc:Subject:Date; b=bcFc5q4S5JmkDfZRmGtCy9eaHMZr5cw/xvXr5Xs6oukIHfh2PR5ISm8EES/nOOVwt ZD6uMdnsFLZCa3E0ZtBsFujxLM195eymVahilKp5c1VkDh1nZjTSCJ5BE6C1BozhjR dIFcsOTyMejfU8ADMe4ULIUpSU6HEPcYWPEUz3YjjwBK990QbB+VErHsU6vea4XY3b J5fJc9xAYOGIWVsRkvxwernmvzRZlcfKFQ4D9xAh5dS/PG7D0UfUhrub0zinBWljNd nGt0Xv0H3I2LPTx3sxEkTQ67Y61U7V2uoM6huC++AAf1MgW9loy+lxkdDjyxeTVUP9 Xxq0ye41xtOQQ== Date: Mon, 17 Oct 2022 13:18:27 +0100 Message-Id: <20221017121827.15571-1-paren@disroot.org> 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" Reply-to: "\(" X-ACL-Warn: , "\( via Guix-patches" X-Patchwork-Original-From: "\( via Guix-patches" via From: "\\(" X-getmail-retrieved-from-mailbox: Patches * guix/scripts/package.scm (package->manifest-entry*): Fail if the package to be installed is guix from the default channel. --- guix/scripts/package.scm | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 7ba2661bbb..886415f41e 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -699,7 +699,15 @@ (define (store-item->manifest-entry item) (define (package->manifest-entry* package output) "Like 'package->manifest-entry', but attach PACKAGE provenance meta-data to -the resulting manifest entry." +the resulting manifest entry, and report an error if PACKAGE is the 'guix' +package from the default channel." + (when (and (string=? (package-name package) "guix") + (string-prefix? "gnu/" (location-file + (package-location package)))) + (report-error (G_ "the 'guix' package should not be installed")) + (newline (current-error-port)) + (display-hint (G_ "use 'guix pull' to fetch the latest Guix revision")) + (exit 1)) (manifest-entry-with-provenance (package->manifest-entry package output)))