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 CLOlCDbmWmMPLQEAbAwnHQ (envelope-from ) for ; Thu, 27 Oct 2022 22:12:38 +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 +Pu8CDbmWmO0aQAA9RJhRA (envelope-from ) for ; Thu, 27 Oct 2022 22:12:38 +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 E910FBDFC for ; Thu, 27 Oct 2022 22:12:37 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oo9ER-0005sw-UD; Thu, 27 Oct 2022 16:12:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oo9EQ-0005sY-Pf for guix-patches@gnu.org; Thu, 27 Oct 2022 16:12:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oo9EQ-000238-HW for guix-patches@gnu.org; Thu, 27 Oct 2022 16:12:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oo9EQ-0001Xt-4T for guix-patches@gnu.org; Thu, 27 Oct 2022 16:12:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58583] [PATCH 0/1] scripts: package: Forbid installation of the guix package. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 27 Oct 2022 20:12: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: "(" Cc: 58583@debbugs.gnu.org Received: via spool by 58583-submit@debbugs.gnu.org id=B58583.16669014815887 (code B ref 58583); Thu, 27 Oct 2022 20:12:02 +0000 Received: (at 58583) by debbugs.gnu.org; 27 Oct 2022 20:11:21 +0000 Received: from localhost ([127.0.0.1]:59447 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo9Dl-0001Ws-1U for submit@debbugs.gnu.org; Thu, 27 Oct 2022 16:11:21 -0400 Received: from mail-qt1-f174.google.com ([209.85.160.174]:33351) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oo9Di-0001We-Gy for 58583@debbugs.gnu.org; Thu, 27 Oct 2022 16:11:19 -0400 Received: by mail-qt1-f174.google.com with SMTP id cr19so2124476qtb.0 for <58583@debbugs.gnu.org>; Thu, 27 Oct 2022 13:11:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=iWPiM43mj6cxWBAfMiSXBLIiE9IXXnxp8cWkUjgES60=; b=JeiXGyx3KuLJIvt2ie03KnG86T9EKKoj+mlpFb/SOlyM29XhUXBf1AJ6S+aaftF4ct jrkv/X6td8k+nreOoMDZkn+SJwCTdtkz5/W7kFURuSPjitOSuo/a6wj27v1ihWFrlLmq K/uUPIY7CIMyz440ib97G2B4CRz8ivVWfbpc8pJrOrlsJugRX7kXuLK/94Q/iS2NWtLE wdH2KZR7utKFjLKMhUBrbF4k+a0/GCAdeEeWEexKZ5u/ttI8cnb3SQaJmDpcNehl09CE jPM1rwjHb1b0TM6f8xDZ7+oUrJAIRTluUL2UGGTi7oabpR5k3p0Lmh23chbHyMlhfTMc IOAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=iWPiM43mj6cxWBAfMiSXBLIiE9IXXnxp8cWkUjgES60=; b=jePWcVp/HrJLi/ozWqoYttNzDSs9sYTSwKH0ijZ7zcrwf4l0IIoV5TZ1pNLhfPP+Pt n3cJDgDgllK5FZQYKsrf8zF3JNI5qHN7S/E0opHVPOeVWUca45aPAodthtdURLdMflao Om+vtDuZKw+2fB739TaCR8hjumYKrh3Nhuu2hy4Frdj8rBsyLEZZuC01y4Es5VfMVc2D ZSx8OjNFd37Flr6IXKmxduRzSr0J5gb/9bi1XEz8gLAe/1UhSRP4P0dibe0K9QOoAS6B 3ydHztB8uxm7VvunfQAwyAsAotxqek8Flmuy1bpOMlQJzpcVeHAqciFpPg1aYn6gk7uO HuSg== X-Gm-Message-State: ACrzQf0Dek9bDOwKgm0NSzS4vz08cgjn8JViPvxWKlxAwv87GYxNdhsi r3uA4IGaR2GBKC9fvHGA7//bYis6z7V4zQ== X-Google-Smtp-Source: AMsMyM5HWRpmsI/uujgdGSdKRPA4lYnZznLCFRvIyA8ZCTnYSDjWJD6xFJqOsG4Mrsb/qrm/u3Tuhw== X-Received: by 2002:a05:622a:284:b0:39c:cbec:e1f0 with SMTP id z4-20020a05622a028400b0039ccbece1f0mr42535402qtw.451.1666901472713; Thu, 27 Oct 2022 13:11:12 -0700 (PDT) Received: from hurd (dsl-152-179.b2b2c.ca. [66.158.152.179]) by smtp.gmail.com with ESMTPSA id q32-20020a05620a2a6000b006f7ee901674sm1626876qkp.2.2022.10.27.13.11.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 13:11:12 -0700 (PDT) From: Maxim Cournoyer References: <20221017121642.15468-1-paren@disroot.org> <20221017165057.15648-1-paren@disroot.org> Date: Thu, 27 Oct 2022 16:11:11 -0400 In-Reply-To: <20221017165057.15648-1-paren@disroot.org> (paren@disroot.org's message of "Mon, 17 Oct 2022 17:50:57 +0100") Message-ID: <87eduthvs0.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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: , Sender: "Guix-patches" Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org 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=1666901558; h=from:from:sender:sender: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=iWPiM43mj6cxWBAfMiSXBLIiE9IXXnxp8cWkUjgES60=; b=H/U6kZUU7hKbyCnApD267RljlN2oxuSfqw4ec7V2xxMrPzVzvX8YbCaYYGJGjWv780qPg4 yu/QfVQX/ozRMQxqkhLeS0wd/jnvIrize6V8HYjGQdvCOJjE/LqzAx5XzBHlHse6B/7B4c vHwkHjpYGwXIxtOm4RHNtv4r9N4Z7pfDcxa2xObDL/4iyg3oXbuc70tYVzSUYxY109dezT 6xJGQrfl8OnAaHy1ajPsD4pR/bGzhJi8C45m0fXSrJUsbaMbNoHuh0Jl8BXpESX9YCFYtE nV9xwNJAhPX1+0mv8ESbFt3/yJDWrNinKr0mP6i9Opa6JW4U7caJb8jkWUXibQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1666901558; a=rsa-sha256; cv=none; b=V6gHZMghIZ+B2D68m7YVG1hMIFqwvgph1DxC4FbH7EKFLMDk3ieYOhuTFkmlvSQcTeF2Z7 f9Qsa+Cq+KazDIfm9d8JBz7AJaWylM1dO5JbZda6eupeaBR1qoiBqdMX/1KRXPihQ+8+Sn 7rDkzmFs+ZbH4oQzXWyfEIK/xcOm9+Zrjzjw4WtTl8nb1ROZabHJzmID2mJEArTgG4el2s RizTsxel6rBd3M1SiQo8vnEvpk4OSj3htwIlrc60k9q7I1oMzH1Kxn606iej2xi1Twlh+L VXXKiL/qTjIaTVxkYcfimjERpD1L/yRBOtaqWpKnPyLinf/frvINQoY7O4VqEQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=JeiXGyx3; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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: 6.79 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=JeiXGyx3; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); 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: E910FBDFC X-Spam-Score: 6.79 X-Migadu-Scanner: scn0.migadu.com X-TUID: p7fV2LfaAHmT Hello, "(" writes: > * 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..9f023ea7b5 100644 > --- a/guix/scripts/package.scm > +++ b/guix/scripts/package.scm > @@ -12,6 +12,7 @@ > ;;; Copyright =C2=A9 2018 Steve Sprang > ;;; Copyright =C2=A9 2022 Josselin Poiret > ;;; Copyright =C2=A9 2022 Antero Mejr > +;;; Copyright =C2=A9 2022 ( > ;;; > ;;; This file is part of GNU Guix. > ;;; > @@ -699,7 +700,14 @@ (define (store-item->manifest-entry item) >=20=20 > (define (package->manifest-entry* package output) > "Like 'package->manifest-entry', but attach PACKAGE provenance meta-da= ta to > -the resulting manifest entry." > +the resulting manifest entry, and report an error if PACKAGE is the 'gui= x' > +package from the default channel." > + (when (and (string=3D? (package-name package) "guix") > + (string-prefix? "gnu/" (location-file > + (package-location package)))) > + (report-error (G_ "the 'guix' package should not be installed~%")) > + (display-hint (G_ "use 'guix pull' to fetch the latest Guix revision= ")) > + (exit 1)) > (manifest-entry-with-provenance > (package->manifest-entry package output))) Instead of exiting directly here, would it make sense to use raise-exception with a compounded message and &fix-hint condition? When working with the Guix API, I prefer to encounter exceptions rather than errors + exit. For a recent example I used, see: https://issues.guix.gnu.org/58812#5-lineno360. --=20 Thanks, Maxim