From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id WOH1JVPmI2LbcAEAgWs5BA (envelope-from ) for ; Sat, 05 Mar 2022 23:38:11 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id oJ+TIlPmI2L8CwEAauVa8A (envelope-from ) for ; Sat, 05 Mar 2022 23:38:11 +0100 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 2BBCC143A5 for ; Sat, 5 Mar 2022 23:38:11 +0100 (CET) Received: from localhost ([::1]:33076 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nQd2Q-0008SI-Bm for larch@yhetil.org; Sat, 05 Mar 2022 17:38:10 -0500 Received: from eggs.gnu.org ([209.51.188.92]:53642) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nQd2I-0008Rr-QJ for guix-patches@gnu.org; Sat, 05 Mar 2022 17:38:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:55425) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nQd2I-0002vF-Ht for guix-patches@gnu.org; Sat, 05 Mar 2022 17:38:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nQd2I-0005JV-Fm for guix-patches@gnu.org; Sat, 05 Mar 2022 17:38:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#54180] [PATCH 00/12] Home: Clarify and better test symlink-manager.scm Resent-From: Maxime Devos Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 05 Mar 2022 22:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 54180 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 54180@debbugs.gnu.org Received: via spool by 54180-submit@debbugs.gnu.org id=B54180.164651985820394 (code B ref 54180); Sat, 05 Mar 2022 22:38:02 +0000 Received: (at 54180) by debbugs.gnu.org; 5 Mar 2022 22:37:38 +0000 Received: from localhost ([127.0.0.1]:49322 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nQd1u-0005Is-HJ for submit@debbugs.gnu.org; Sat, 05 Mar 2022 17:37:38 -0500 Received: from michel.telenet-ops.be ([195.130.137.88]:44592) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nQd1p-0005Ig-8y for 54180@debbugs.gnu.org; Sat, 05 Mar 2022 17:37:36 -0500 Received: from ptr-bvsjgyhxw7psv60dyze.18120a2.ip6.access.telenet.be ([IPv6:2a02:1811:8c09:9d00:3c5f:2eff:feb0:ba5a]) by michel.telenet-ops.be with bizsmtp id 2mdX270064UW6Th06mdXzR; Sat, 05 Mar 2022 23:37:31 +0100 Message-ID: From: Maxime Devos Date: Sat, 05 Mar 2022 23:37:31 +0100 In-Reply-To: <87ee3gm49e.fsf_-_@gnu.org> References: <20220227135342.10296-1-ludo@gnu.org> <20220227135342.10296-5-ludo@gnu.org> <87ee3gm49e.fsf_-_@gnu.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-cFAQ97xw8yc2MLsjtJaQ" User-Agent: Evolution 3.38.3-1 MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telenet.be; s=r22; t=1646519851; bh=/9e4kszHBNgpdJCmWV2OoWPalpTbdyeQBabUGWDNzlE=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=SrGm4w7XsidedEkQoWf4YR3dJPtze5+zWvwE2PkcBxF0DSS41gVJQnFDJn684l4Of qoLqo8xcu1+serqeELLl0zs5cW0HFc0+iiFR34WVjKkvLDHjoMXEHLRn+/JUmihYWG lFeQKy06xP1sKiH0prhjUIoICsbYD3Am2sa4bx0yFQmaHT+ESzO26z10u5rJ3ej5Sb ErpeYXAV8sEz6eFo8VJGHIgSoKaaz6nRQsZW6s3gDc3cdpXW45JJIrq0ctVVzE/KYo wY3xNTjPpsGfJHJKqRnMGUqaeLfhxaYD3DdPxDp/soRtb+n8CT9chNm8d78GWdcUvz BuiJB30Zc8q+w== 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" 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=1646519891; 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: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=/9e4kszHBNgpdJCmWV2OoWPalpTbdyeQBabUGWDNzlE=; b=UuxqDPmjBA0Cv3QZfsjd9NbgW2oNnrmjgS6QaxlpKY0aR+GJtheCBQDxOvucs73N5DFZBu DpSPzXTJaYjifY942Quk9kx2e16qa7CS+HO2i20A2+pTwKGk66BMuPmB6IrgdWcymMkoee sjkx11EvCX8GVjT4YS/l7sp9Eq+ss2Kxr2GsvcRJdhsZUukJLfL1g1zHsY2GQtNyDxf8MT mBFdBaPIc8zFDgb8qoN+7FX0l7tYYVqv2fnkOQ5Q1MkZUST7wxcutDjCjIgeY0kZjah5dU F9q5Hnn9JA4xwu9ZVU38pwWlqo88F3zkdYjo/u3hz1TMAvJ1Mia8SKiivF8usA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1646519891; a=rsa-sha256; cv=none; b=rEiNtQZb8VNHq51qnGBQmJRxOBmERT2ZtTjyB/xspTBf1lap5dNsBpw0hM6x8VAE04/5ou oTW1yXX533cWNOjDQ1/xyMXcWW5b865mTRXXVA6hlrDM1M+iQWS8h4t4l/h4N8OjyUnP/+ TCeO/e2IefxrlyAk3+r5XZL4apBClolsFKsUAVq8f53d9/oZ0kgbX59jPc81T8y0iE9ybp em3hE5bXWIIyD645CWtoBPprtH+4f+8IpFEdwImQLhFNCWjKbeOZrjs2fbSFG12yDOYeV4 oS4bo4bPnZpFzBOehca6sU9Mph5WFKzLu8KqwB3MV8bPBk3G+UmbTm4j3mPwNw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=SrGm4w7X; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (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: 3.66 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=telenet.be header.s=r22 header.b=SrGm4w7X; dmarc=fail reason="SPF not aligned (relaxed)" header.from=telenet.be (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: 2BBCC143A5 X-Spam-Score: 3.66 X-Migadu-Scanner: scn1.migadu.com X-TUID: unVCrS+KQAoX --=-cFAQ97xw8yc2MLsjtJaQ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s schreef op za 05-03-2022 om 23:19 [+0100]: > > Like with my comment on =E2=80=98Avoid extra 'lstat call.=E2=80=99, I w= ould move > > the > > (format #t (G_ "Removed ~a.\n") directory) outside the catch. > >=20 > > If 'format' somehow throws a ENOTEMPTY/ENOTDIR system-error, > > something > > is very wrong. >=20 > Precisely: we can keep the =E2=80=98format=E2=80=99 call after =E2=80=98r= mdir=E2=80=99 because we > know (1) it=E2=80=99s only going to be called if =E2=80=98rmdir=E2=80=99 = succeeds, and (2) it > won=E2=80=99t throw to =E2=80=98system-error=E2=80=99. Yes, we could keep it inside the 'catch', but that doesn't it's a good idea, because if format throws a ENOTEMPTY/ENOTDIR, shouldn't that be reported because that seems very wrong? WDYT of (define (delete-if-empty file) ;; Returns #t if deleted, #f if skipped because empty (catch ... (lambda () (rmdir directory) #t)=20 (lambda ... (cond ((=3D ENOTEMPTY ...) #false) ((=3D ENOTDIR ...) [TODO: if it was a regular file, shouldn't it still be del= eted?]) (#true (throw ...)))))) (if (delete-if-empty) (format ... "removed ...") (format ... "skipped ...")) ? --=-cFAQ97xw8yc2MLsjtJaQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYiPmKxccbWF4aW1lZGV2 b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7quoAQCo2ZM8EqCjSYUYCGXc1qnveOGC LwzAnZOQ3LpsEq6GZAEAy+WR6jmrb7Q3CEfBK4dumz2Iy7qz839iqmWLfF6SLQw= =eZvv -----END PGP SIGNATURE----- --=-cFAQ97xw8yc2MLsjtJaQ--