From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id iNvGEUQlwWEoGAAAgWs5BA (envelope-from ) for ; Tue, 21 Dec 2021 01:52:20 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id kGCYDUQlwWFaQwAA1q6Kng (envelope-from ) for ; Tue, 21 Dec 2021 00:52:20 +0000 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 050C6BA1D for ; Tue, 21 Dec 2021 01:52:20 +0100 (CET) Received: from localhost ([::1]:53654 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzTO6-0006Nl-LI for larch@yhetil.org; Mon, 20 Dec 2021 19:52:18 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34372) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzTO0-0006NE-H6 for guix-patches@gnu.org; Mon, 20 Dec 2021 19:52:12 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:40232) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mzTNq-0007zC-0S for guix-patches@gnu.org; Mon, 20 Dec 2021 19:52:11 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mzTNp-00041T-S4 for guix-patches@gnu.org; Mon, 20 Dec 2021 19:52:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52691] [PATCH] git: Display a hint when CLONE* lacks permission. Resent-From: Tobias Geerinckx-Rice Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 21 Dec 2021 00:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52691 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52691@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.164004786915404 (code B ref -1); Tue, 21 Dec 2021 00:52:01 +0000 Received: (at submit) by debbugs.gnu.org; 21 Dec 2021 00:51:09 +0000 Received: from localhost ([127.0.0.1]:51778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzTMz-00040O-Ec for submit@debbugs.gnu.org; Mon, 20 Dec 2021 19:51:09 -0500 Received: from lists.gnu.org ([209.51.188.17]:55292) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzTMx-00040H-Ns for submit@debbugs.gnu.org; Mon, 20 Dec 2021 19:51:08 -0500 Received: from eggs.gnu.org ([209.51.188.92]:34270) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzTMx-0006Ff-DW for guix-patches@gnu.org; Mon, 20 Dec 2021 19:51:07 -0500 Received: from [2a02:c205:2020:6054::1] (port=35672 helo=tobias.gr) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzTMs-0007oA-QK for guix-patches@gnu.org; Mon, 20 Dec 2021 19:51:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=2018; bh=J+2op2u2pv4sf iwgYF08A37jVhwrdJ0kJcngs1kBD5c=; h=date:subject:to:from; d=tobias.gr; b=Q7bXDzrSrzvzSo3yuBPeb3iGFOJqeZuW9l/yRe7Or7AWaNKBBc/VKltFKYbwGCyRSHPz wgotB5Lzj2JavxgcqENj2wEemz7cKoFbIQsw0snJ+Gkm0ehU3Hgu9Ykai/Ikaq1N8EGNO+ LMRJlgTmjztcDoVB9S8XDmbcUSE4WP4WUgG4+qdNosVyo/4l77z0S4AhDWvBLEv4bdAdzo +4eg+ZKM6VyggvPGaTcxBpg+cGzXinQ6EbpcA3CJfywTnhU0cAqNDsyFyOhWq/oT5XgM+F 9W9XgAlhQYTwS9HoQfaiUukFsTBwp/vypGY31Bhj0GCgFYweFbL1nmcTZBNZQv1Q== Received: by submission.tobias.gr (OpenSMTPD) with ESMTPSA id 734c98ad (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Tue, 21 Dec 2021 00:50:56 +0000 (UTC) Date: Tue, 21 Dec 2021 01:51:02 +0100 Message-Id: <20211221005102.17638-1-me@tobias.gr> X-Mailer: git-send-email 2.34.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a02:c205:2020:6054::1 (failed) Received-SPF: pass client-ip=2a02:c205:2020:6054::1; envelope-from=me@tobias.gr; helo=tobias.gr X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RDNS_NONE=0.793, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action 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: Tobias Geerinckx-Rice X-ACL-Warn: , Tobias Geerinckx-Rice via Guix-patches From: Tobias Geerinckx-Rice 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=1640047940; h=from:from:sender:sender:reply-to: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:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=J+2op2u2pv4sfiwgYF08A37jVhwrdJ0kJcngs1kBD5c=; b=Of9OTrd4vdgB1ReuIkzJnahxAo5hj3imKTqn/iaLQDMewh5qPF/1m566fW/+bDjPD3M92X cNAIv3UITv489Uwh1lEjcbIBfbG0RSWDySWrH6cfcuPRSdkC2kpamem9x4016mTXztBEjY i5Gk0nvaWISjAkm0HlXGlbsu2SRPhiaIcgxgGnitpEj4ioiuMesFNscFs1RYJlIg2iA2Co vdXlV/jV+XZfEcY17Qv8vuPyqdw92NFUfeUcWnScg2JgKbKZGatFP+otu3vk3/ZSkXIxh1 3/GgYzLqMJSfURYjFSjiwXLUzJUNW0FnWh060tX66PBVy0Odz6INkksgBhaxhA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1640047940; a=rsa-sha256; cv=none; b=EZIqGBeJ8/zZa8ntbCOa4Ug58W9iI4k6Jf3+yEVCzt/JyTBwP/Fcy3KPNo5uN8ieGkLhM7 0fTXyv9WASp3QgC6qixc6PJnMd3OfkRphi+GYPOFNNAzUn0fX+Y6sCbFe1zk2yQm1gSFg5 646pEwqB5U84N7mEczkkvGEZTb+bRIfvn6jXqZNiDdvlUE6yRL7i21bUzFZ5wuht1O6hEf /1VPGL1I5y+S+hxYOpOiDjHYf1Gu8xFrJyEb8a3eF1S+9bzq1dkaQ05ftnSocWtX+Js0IA C+n2xn1k2ELN9MVYl8XBa9UhDc23M/f3OtXrseVCE7cN90j/fNWb3f9t3RiCnQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tobias.gr header.s=2018 header.b=Q7bXDzrS; 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: -4.52 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=tobias.gr header.s=2018 header.b=Q7bXDzrS; 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: 050C6BA1D X-Spam-Score: -4.52 X-Migadu-Scanner: scn0.migadu.com X-TUID: MAvb6bt8CbZo Without this, it's not obvious where users should even start looking: $ guix pull Updating channel 'guix' from Git repository at URL... guix pull: error: mkdir: Permission denied $ * guix/git.scm (clone*): Print DIRECTORY as a hint on EPERM. Reported by karrq on #guix. --- guix/git.scm | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/guix/git.scm b/guix/git.scm index dc2ca1be84..1b322be0fe 100644 --- a/guix/git.scm +++ b/guix/git.scm @@ -35,6 +35,7 @@ (define-module (guix git) #:use-module (guix gexp) #:use-module (guix sets) #:use-module ((guix diagnostics) #:select (leave warning)) + #:use-module (guix ui) #:use-module (guix progress) #:autoload (guix swh) (swh-download commit-id?) #:use-module (rnrs bytevectors) @@ -200,8 +201,16 @@ (define (clone* url directory) (clone url directory (make-clone-options #:fetch-options (make-default-fetch-options)))) - (lambda _ - (false-if-exception (rmdir directory))))) + (lambda args + (false-if-exception (rmdir directory)) + ;; Compensate for unixy errors, e.g., ‘error: mkdir: Permission denied’. + ;; XXX This displays the hint before the error. After would be nicer. + ;; XXX So would a generic mechanism for dealing with such errors. + (match args + ((system-error _ _ _ EPERM) + (display-hint (format #f (G_ "can you create and write to ~a?") + directory))) + (_ #f))))) (define (url+commit->name url sha1) "Return the string \"-\" where REPO-NAME is the name of -- 2.34.0