From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.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 EFcfOFndHWP95gAAbAwnHQ (envelope-from ) for ; Sun, 11 Sep 2022 15:06:33 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id hKfvN1ndHWMr+QAAauVa8A (envelope-from ) for ; Sun, 11 Sep 2022 15:06:33 +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 A416EC944 for ; Sun, 11 Sep 2022 15:06:33 +0200 (CEST) Received: from localhost ([::1]:55436 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oXMfQ-0006TX-4G for larch@yhetil.org; Sun, 11 Sep 2022 09:06:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXMew-0006TJ-DR for guix-patches@gnu.org; Sun, 11 Sep 2022 09:06:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:52394) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oXMew-00027c-3Z for guix-patches@gnu.org; Sun, 11 Sep 2022 09:06:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oXMev-0006cG-QA for guix-patches@gnu.org; Sun, 11 Sep 2022 09:06:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57031] [PATCH] scripts: Show a hint the first time some commands are run as root. Resent-From: "(" Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 11 Sep 2022 13:06:01 +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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 57031@debbugs.gnu.org Received: via spool by 57031-submit@debbugs.gnu.org id=B57031.166290155525416 (code B ref 57031); Sun, 11 Sep 2022 13:06:01 +0000 Received: (at 57031) by debbugs.gnu.org; 11 Sep 2022 13:05:55 +0000 Received: from localhost ([127.0.0.1]:41093 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXMeo-0006bs-LW for submit@debbugs.gnu.org; Sun, 11 Sep 2022 09:05:54 -0400 Received: from knopi.disroot.org ([178.21.23.139]:48676) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oXMem-0006bg-0g for 57031@debbugs.gnu.org; Sun, 11 Sep 2022 09:05:52 -0400 Received: from localhost (localhost [127.0.0.1]) by disroot.org (Postfix) with ESMTP id 5696D4A040; Sun, 11 Sep 2022 15:05:50 +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 3lpcZEERd2ZL; Sun, 11 Sep 2022 15:05:49 +0200 (CEST) Mime-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=disroot.org; s=mail; t=1662901529; bh=BpKEM/V0i+MGA3vyE0OH71E1xJcRSoUKVxuJiZ/mJQM=; h=Date:Cc:Subject:From:To:References:In-Reply-To; b=c/+7o62iP0r7S3mMhKpyc3llpcSvWX+1tFKtJLwqYucU2p35D0W7+0Bvr3G4uo0u8 iWt38OHHN9OrAym5s3rhOHEw769WHBYIHQ5WODhFrddSm2PCahTIwcJg2wVBtsC8QI f09rkxTXa9ZRTF8s4InaFnPmCWHhbo2dvCnlCKA4GYQBsibXXDjrGW/03Og1fxt3vh ltH8rEmtsLpsO0hMjlbDbYsU14DPq1vx9poQghD4iVJSaNRAVO4O6+geO86bnWE54s V940DgEpZUtxjFGVZnHbmHzG8AeB0Gsi6/aNDQxIRSYXsTT5zEj8qb/Sbg852XT2t0 qojhOKsukmqTA== Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Sun, 11 Sep 2022 14:05:28 +0100 Message-Id: References: <20220807111421.14771-1-paren@disroot.org> <20220807111929.15617-1-paren@disroot.org> <87tu5l1q8g.fsf_-_@gnu.org> In-Reply-To: <87tu5l1q8g.fsf_-_@gnu.org> 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-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1662901593; 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=5Ctv+WDi2pjS7L7h39mDmNhs0XwC480iQsa4lQb6Sa4=; b=WiPDKFj0ZQbttaK/32eGtZ/SYKdyEcbl0GJFrP59ajr1ERPGV5D7ydPK3pj6Ndf2XR/ZoP bs29/ydUeWFwayss/5dDw9nmuYsXWJ52umgiYTR800bd7XPNLAFbEnym7ZZvkeUIrStH6I NPXoYZvZ4PeL2cVUgWNxA+w7Mq7BoQiBgZ+K/QJ94AOEChF6MjRQFg3RbhlMEnegrPNHzf /LMozLMarURhbMR9lUO/gTNkBc2FIDtAHqQZK52CPOsJEO1/StLt59XT4SAAlp7ebBBdMU yTsgoR9bUeC5wJF/lpJf1ZFKKyG0+nwGuptJ0j/FRklajuttAbmcWOa6OkuIuA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1662901593; a=rsa-sha256; cv=none; b=Ip/ndfgZnj/LA6/eg1JqRQ/iKFBolkAMbFjutseHSuFtyFU9r60n35X9uxO2hVmoA7+Taj gVX+DpjyuV9ODWV9EmqyGvkqv3P0ILoeDQRLAl38D+E5ALqRg/y57UDx/O05t7D5T/PLhk Wxq1aYiEvZStCHSarv/TNQbhKcUODAYLUMnY1jGcAH+taVpIpG4RnL878a2gB8TswxsgaV XnQ5XoCvfDvWW3CE8NDH/FS/BQckuTb4xU1TPfN0D3aLdhXtPjR1p6N6tRJty4EhIV/pAV jEudEKc2XUXZUdbjtLmJqcv8zqfOs/pzJ0B+yazzhyDcriSbILwZVP0ZS2wBRQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=disroot.org header.s=mail header.b="c/+7o62i"; 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.31 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=disroot.org header.s=mail header.b="c/+7o62i"; 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: A416EC944 X-Spam-Score: -2.31 X-Migadu-Scanner: scn1.migadu.com X-TUID: je9wCxWruRUF Hey Ludo, On Mon Sep 5, 2022 at 10:11 PM BST, Ludovic Court=C3=A8s wrote: > One nitpick: Could you make moving the hint code from shell.scm to > ui.scm a separate commit? Sure! > > + (display-hint (G_ "`guix pull' is user-specific, not system-w= ide; > > +running it as root will only affect the `root' user."))) > > Please use Texinfo markup in hints: @command{guix pull}, etc. (Likewise > for the second hint.) Oh, I didn't realize you could do that. > > +(define* (guix-package* opts #:key (root-hint? #f)) > > "Run the 'guix package' command on OPTS, an alist resulting for comm= and-line > > -option processing with 'parse-command-line'." > > +option processing with 'parse-command-line'. If ROOT-HINT? is #T, a h= int is > > +shown on the first usage of this procedure that informs users about Gu= ix's > > +support for per-user package management." > > (with-error-handling > > + (when (and root-hint? > > + (not (hint-given? 'package-root-hint)) > > + (=3D (getuid) 0)) > > Unless I=E2=80=99m mistaken, =E2=80=98root-hint?=E2=80=99 is always true;= should we just remove > it? No, it's not always true; we don't use `#:root-hint #t' in `guix search' an= d `guix show', so that `sudo guix show foobar' doesn't trigger the root hint. > BTW, when running =E2=80=98sudo guix install=E2=80=99, the hint is going = to > ~root/.cache/guix, right? Probably -.o.- -- (