From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id wDXVKj1JTWMs4wAAbAwnHQ (envelope-from ) for ; Mon, 17 Oct 2022 14:23:25 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id cGDXKj1JTWMrdgEA9RJhRA (envelope-from ) for ; Mon, 17 Oct 2022 14:23:25 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 66ECC5A5E for ; Mon, 17 Oct 2022 14:23:25 +0200 (CEST) Received: from localhost ([::1]:46634 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1okP9Q-0002LW-Is for larch@yhetil.org; Mon, 17 Oct 2022 08:23:24 -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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: "\(" X-ACL-Warn: , "\( via Guix-patches" From: "\( via Guix-patches" via X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1666009405; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=tOSAigkvxMyOlefT5VPmOnsHYjzfXXCi9PbkZxlLWAI=; b=j4pz6nR08SmyBPGVHErb9DZxc7kiECvsv0cEMw4r/lHP+q4k4s5doZIvyJXOFqW7ymhQ77 71+hWAtN7EjS/3z7DnUhWyrFpQJcLNRYyUA8SlhdKc/vGPY00/LOO/pIKMe2eegHpp02hg trm9U6I6RrKAMA2CpRdFOfStQuRTGWt/cNoA+xmM2DsRrr3LBtjxq/BWEdyNAPxI0FVM5X drczQhCOrxx6pjtakQtqoQcxKdTAVXLfBUoxLffEYPyRCZKbzS3RUgh3iXynwVGj7XgikI H3hRKlfETRTG8HtVSFhe0ztwW38+HaDobmwVBzze6MrS+lM6J5fZLxS1IwwiNg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1666009405; a=rsa-sha256; cv=none; b=XQWs/86VRZRsy3ROKNmC/k4gV64dVLS2imEvBw8kaaF2ND03bMgROgIpUymEo0SE4Sm9yG oj5/zI7MPncbL+XM+EDhGxCFSp3XGl0Pqi51sLArbMelYIhhy/jeW5GZ7tgCLkubZ0GNc+ Ty9q3Kgppf58bOVHXldIlrlL6yBPJZN/oJLjUyijt52aw5XPFiOj0fhyBEeL8rq3o7eNm6 3cXVUM97dcHctq1ABuP1tKSJqAsLxlmTQIqRUd6lXAbEPfCY30AM5EQzgDFTV0Idx7MRJc clSaUSzruz5fqtei4mA3fMCOsq/RGWGYXQXVCy/p6aCSv5mdHsGcIyoSrPyC/w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=disroot.org header.s=mail header.b=XhhKybaa; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.92 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=disroot.org header.s=mail header.b=XhhKybaa; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 66ECC5A5E X-Spam-Score: -2.92 X-Migadu-Scanner: scn1.migadu.com X-TUID: i9s/cD+rN6t3 * 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))) -- 2.38.0