From patchwork Mon Oct 17 12:22:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "\\(" X-Patchwork-Id: 43465 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 1B41427BBEA; Mon, 17 Oct 2022 13:23:41 +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 B8E3C27BBE9 for ; Mon, 17 Oct 2022 13:23:40 +0100 (BST) Received: from localhost ([::1]:46634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1okP9f-0002LW-Uw for patchwork@mira.cbaines.net; Mon, 17 Oct 2022 08:23:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okP95-0002Hp-4e for guix-patches@gnu.org; Mon, 17 Oct 2022 08:23:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48616) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1okP94-00078G-Ry for guix-patches@gnu.org; Mon, 17 Oct 2022 08:23:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1okP94-0006sB-GH for guix-patches@gnu.org; Mon, 17 Oct 2022 08:23:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58583] [PATCH v2] 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:23: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.166600938026396 (code B ref 58583); Mon, 17 Oct 2022 12:23:02 +0000 Received: (at 58583) by debbugs.gnu.org; 17 Oct 2022 12:23:00 +0000 Received: from localhost ([127.0.0.1]:47694 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okP91-0006rg-TO for submit@debbugs.gnu.org; Mon, 17 Oct 2022 08:23:00 -0400 Received: from knopi.disroot.org ([178.21.23.139]:44416) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1okP8z-0006rY-Uv for 58583@debbugs.gnu.org; Mon, 17 Oct 2022 08:22:58 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 4F5ED4DC06; Mon, 17 Oct 2022 14:22:57 +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 ESMTP id lBDdPlTvWGFH; Mon, 17 Oct 2022 14:22:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1666009375; bh=+8QRP3AizEtJYXibtE30yFuYZXB7T22V/z/hO9fBxDc=; h=From:To:Cc:Subject:Date; b=XhhKybaaJPagUvBNmnrepOVEZ1rBpvJXcgi1GVao/gbAuHQvppUw1Wz+updybxo+g JaWYr/6A5HtGwz6MU/pW1FW7+j3wgtZvOEpz9xxZFUoeXCMLmU0y03tZdKqgQMj6WM VSnIGjXoibFs9zLnuzCtex/54AXac+U89Fwhn4D1iOP53WiBJlWErop7lxqs2pKxcT iGNcpdI47nAYjIy6ljPktWz7B/D6bfSjLubIpJ5wdWZIbgxmvRwTR1ZfOk8Vl+EnTR h+oYvjN7qEL7D+kevwrIematz/0M30v8TSYsnYsvJx9y4ImQ53xqRa2dchzZt+IzOs e8aHd4q0GMWiw== Date: Mon, 17 Oct 2022 13:22:54 +0100 Message-Id: <20221017122254.16230-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 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/guix/scripts/package.scm b/guix/scripts/package.scm index 7ba2661bbb..d0feb2063a 100644 --- a/guix/scripts/package.scm +++ b/guix/scripts/package.scm @@ -12,6 +12,7 @@ ;;; Copyright © 2018 Steve Sprang ;;; Copyright © 2022 Josselin Poiret ;;; Copyright © 2022 Antero Mejr +;;; Copyright © 2022 ( ;;; ;;; This file is part of GNU Guix. ;;; @@ -699,7 +700,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)))