From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:51737) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i4Vhi-0008AR-VE for guix-patches@gnu.org; Sun, 01 Sep 2019 15:40:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i4Vhi-0007gT-0L for guix-patches@gnu.org; Sun, 01 Sep 2019 15:40:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:48429) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1i4Vhh-0007fq-Sn for guix-patches@gnu.org; Sun, 01 Sep 2019 15:40:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1i4Vhh-0003F5-Nv for guix-patches@gnu.org; Sun, 01 Sep 2019 15:40:01 -0400 Subject: [bug#36976] [PATCH 1/1] download: Map file-name characters not allowed in store. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20190808144448.25147-1-h.goebel@crazy-compilers.com> <874l271tf6.fsf@gnu.org> Date: Sun, 01 Sep 2019 21:39:39 +0200 In-Reply-To: (Hartmut Goebel's message of "Tue, 27 Aug 2019 09:53:08 +0200") Message-ID: <87woerajr8.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Hartmut Goebel Cc: 36976@debbugs.gnu.org Hello, Hartmut Goebel skribis: > Thanks for the review and the coding suggestions.. > > Am 23.08.19 um 23:08 schrieb Ludovic Court=C3=A8s: >>> * guix/download.scm (safe-name): New function. >>> (download-to-store): NAME defaults to the "safe" basename of URL. >> What about moving this automatic renaming feature to (guix scripts >> download)? I=E2=80=99d rather not do it in the core APIs. > `download-to-store store` was defined as: > > =C2=A0=C2=A0 (define* (download-to-store store url #:optional (name (base= name url)) =E2=80=A6 > > When developing this patch, I decided to put it into the core since > users of this function would expect to be allowed to just pass any url > and don't need to take care about valid characters. If not doing the > automatic renaming here, users would need to perform the conversion > prior to calling this function in any case (except when 100% sure only > valid characters are used). Yes, but that=E2=80=99s OK to me: IMO, procedures have to focused on one th= ing; users can perform additional processing beforehand if they need it. Conversely, commands have to do the right thing by default, which is why I agree that =E2=80=98guix download=E2=80=99 should rename automatically wh= en needed. How does that sound? Ludo=E2=80=99.