From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 8H4ALFmXW2PvKQAAbAwnHQ (envelope-from ) for ; Fri, 28 Oct 2022 10:48:25 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id kIPzKlmXW2M4DQAAG6o9tA (envelope-from ) for ; Fri, 28 Oct 2022 10:48: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 6D1FD3E5E0 for ; Fri, 28 Oct 2022 10:48:25 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ooL2C-0000Ww-2J; Fri, 28 Oct 2022 04:48:12 -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 1ooL23-0000Sj-J2 for guix-patches@gnu.org; Fri, 28 Oct 2022 04:48:04 -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 1ooL23-00029w-BX for guix-patches@gnu.org; Fri, 28 Oct 2022 04:48:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ooL23-000279-67 for guix-patches@gnu.org; Fri, 28 Oct 2022 04:48:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57031] [PATCH v2 2/2] scripts: Warn the first time pull or package is run as root. Resent-From: zimoun Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 28 Oct 2022 08:48:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57031 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: "(" , 57031@debbugs.gnu.org Received: via spool by 57031-submit@debbugs.gnu.org id=B57031.16669468617968 (code B ref 57031); Fri, 28 Oct 2022 08:48:03 +0000 Received: (at 57031) by debbugs.gnu.org; 28 Oct 2022 08:47:41 +0000 Received: from localhost ([127.0.0.1]:60345 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooL1g-00024O-TT for submit@debbugs.gnu.org; Fri, 28 Oct 2022 04:47:41 -0400 Received: from mail-wm1-f53.google.com ([209.85.128.53]:39793) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ooL1a-00023B-Bu for 57031@debbugs.gnu.org; Fri, 28 Oct 2022 04:47:34 -0400 Received: by mail-wm1-f53.google.com with SMTP id i5-20020a1c3b05000000b003cf47dcd316so5954299wma.4 for <57031@debbugs.gnu.org>; Fri, 28 Oct 2022 01:47:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=STSXfoqAmQsYcchJhd2H6IEh0jzU2K4hGNSKO6jVTMM=; b=STMctmXIoL2UwzV41nieBGgPmA+RFp1WKknRDsJ0lMV83o2NZyObGF9BIxPeeUgkPO FTgpdwUFgXklulKjpoCVTfMzdQUKA6K2VGiUT+ulAXxqGvVfkB12VdjGIsH4UXJWzEZ9 z5zvNpp/6coeuP7GKrIC0PtAXVx7sO8h+oxZ58Q231uNRC1CO3F9I8zrULAsuB8DIkb3 TGux9oJe9daJbk6ELDN0hM5xK0L8sy9vQI4x2zamL03Wg01vYvAr6Jynux7F/4DF47xM n1+3DhTrORcx+8IlCXhlm21IPVn4+Uk/Ep5tmpVIpvgwjCVrBjUyoOKqJ9+HgA3iu2Jm YTQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:to:from:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=STSXfoqAmQsYcchJhd2H6IEh0jzU2K4hGNSKO6jVTMM=; b=6pnkLWIXVTF/q37wq2WF3SDzsGbab2SZhYZijDAwD+Q/TvzFJlpc9drOhUc6f2+jah 9JX6yNfAvIDj5n5PlfAHSlcfh6hiZ1iQFgmUn5DGR6aqBdq/qxIIlPgSYr6QicGvzRA1 wKF0dehmlxd50Ru6IycoBVJJV04Peh0vzjc/jHAozHwr6UErSyn1MZubDiNepxzGIjpb w9GTPa9/MQ6Thcr3I25JWwhSXEn7YL/L+z55D1YFGGfpT1Am/Pf0O03s3Fbq/NPw7CwE 2yI7FJUToEo2n6yGeBxNV03NHb8JNTWECimd98Jk773QUUwiq07ByVxylP7XfT8XAOpz AYUw== X-Gm-Message-State: ACrzQf1qNZyFtF1yIevZJCEQ8I0BkFH6B+Z7QXJvoBEa3ChXcruoIq0X WJgrbyq8vbbiXMUFp7HErkLz9zkigw4= X-Google-Smtp-Source: AMsMyM4HMpSTvydFk9+9SwSNICzhfmSi2eIAvILJuy+bPWTojk+aFu9AupKys8sMv283RAuYC6nLLQ== X-Received: by 2002:a5d:6c6f:0:b0:22e:3fdf:4b27 with SMTP id r15-20020a5d6c6f000000b0022e3fdf4b27mr34576761wrz.150.1666946848593; Fri, 28 Oct 2022 01:47:28 -0700 (PDT) Received: from lili ([2a01:e0a:59b:9120:65d2:2476:f637:db1e]) by smtp.gmail.com with ESMTPSA id j17-20020a05600c191100b003b47b913901sm14793135wmq.1.2022.10.28.01.47.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Oct 2022 01:47:28 -0700 (PDT) From: zimoun In-Reply-To: References: <20220911195941.8442-1-paren@disroot.org> <20220911195941.8442-2-paren@disroot.org> <86lep2jvty.fsf@gmail.com> Date: Thu, 27 Oct 2022 10:23:19 +0200 Message-ID: <864jvpbrpk.fsf@gmail.com> 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=1666946905; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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=STSXfoqAmQsYcchJhd2H6IEh0jzU2K4hGNSKO6jVTMM=; b=fewdH1a2QAwanVU9bfSKmyvj6WibdvTLeKFfH5aEFO8z4bxdHJL3NgTLmpcLVOc/1Qlrqk vQXHlR2VziUYRfSX/SFOrKzNct2v/g5lNJH5Cu8qfBa/buKk7UKrPAojvPVaNBwV2laYcA XpIUpLLqQ4/fkgfq36nJpa2SBdPT0dfN59ajW+7aIIF6WiMW1u1FIiFr8SrSvKfMNDk3IA 2tQu3JdJi2akWmOW2Q+vZ4A71d5hVl1DKpcyWxaD2wlbaW7G0bR/z4KGs2yFw2LssOVqld uR5TlgFcpd0a94Ul8Ri52HA9nI6zG1WC3fbpOdvJcke1ndU742lg/2Z2KlPuCg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1666946905; a=rsa-sha256; cv=none; b=MzmnNvCA+CO68zHsEcxSY5HL/ev6jsbFpu+ifBSvWEucxr57IfvPjiHelRZqt0b9SdgHje w7mHyxdhrNUtjzP/RNfSSR9Ao6v/13LtDeZK4Kd6EFNgufE0bRT8icpjxsdFQvnr2rjQwZ NkI5BI9CiLIUtvJd97nBkpnY/IgQhYvFDVXcl77BzdVeEoNZQaxkhYIsDQEeTihbHhWJL9 LzB28VL8FMe2Gb6OmdCUiATydjclxD6OrceUkq20fjD9bv5+HuvPmusfcCtgNHWsVyc0Te Op1MnUX6MnnMRejFc0l9AcSRv6ffatLXh+czMCUrATYhGnB5snNy/whD/ZDH2g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=STMctmXI; 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.49 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=STMctmXI; 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: 6D1FD3E5E0 X-Spam-Score: 6.49 X-Migadu-Scanner: scn0.migadu.com X-TUID: qHvMDP4aUqpS Hi, On Thu, 27 Oct 2022 at 06:52, "\( via Guix-patches" via wrote: > On Wed Oct 26, 2022 at 7:14 PM BST, zimoun wrote: >> > - (guix-package* opts)) >> > + (guix-package* opts #:root-hint? #t)) >> >> [...] >> >> > - (guix-package* opts)) >> > + (guix-package* opts #:root-hint? #t)) >> >> [...] >> >> > -(define (guix-package* opts) >> > +(define* (guix-package* opts #:key (root-hint? #f)) >> >> Why this =E2=80=99root-hint?=E2=80=99 argument? Is it useful or can we = drop it? > > This allows us to disable root hints for ``guix package'' variants, so eg > ``sudo guix show'' will not trigger the root hint. Ah, I see. But then, guix package --show=3Dhello would print the hint, no? > ;;;; guix/scripts.scm > > (define (warn-if-root hint-name) > (when (and (not (hint-given hint-name)) > (zero? (getuid))) > (record-hint hint-name) > (warning (G_ "this command is user-specific, so running it as root \ > > > +will affect only the 'root' user~%")))) > > ;;;; guix/scripts/package.scm > > (when root-hint? > (warn-if-root 'package-root-hint)) > > ;;;; guix/scripts/pull.scm > > (warn-if-root 'pull-root-hint) Something like that SGTM. Cheers, simon