From patchwork Mon Oct 26 16:57:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ludovic_Court=C3=A8s?= X-Patchwork-Id: 24820 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 2839327BBF2; Mon, 26 Oct 2020 16:58:19 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9A41B27BBF1 for ; Mon, 26 Oct 2020 16:58:18 +0000 (GMT) Received: from localhost ([::1]:58298 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kX5p3-0001DA-Lb for patchwork@mira.cbaines.net; Mon, 26 Oct 2020 12:58:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42810) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kX5oo-00018R-JI for guix-patches@gnu.org; Mon, 26 Oct 2020 12:58:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:57804) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kX5oo-0005Sg-8l for guix-patches@gnu.org; Mon, 26 Oct 2020 12:58:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kX5oo-0006A0-7R for guix-patches@gnu.org; Mon, 26 Oct 2020 12:58:02 -0400 Subject: bug#44130: [PATCH] Add a recursive version of mkdir-p Resent-From: Ludovic =?utf-8?q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Mon, 26 Oct 2020 16:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 44130 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: divoplade Cc: 44130-done@debbugs.gnu.org Mail-Followup-To: 44130@debbugs.gnu.org, ludo@gnu.org, d@divoplade.fr Received: via spool by 44130-done@debbugs.gnu.org id=D44130.160373148123666 (code D ref 44130); Mon, 26 Oct 2020 16:58:02 +0000 Received: (at 44130-done) by debbugs.gnu.org; 26 Oct 2020 16:58:01 +0000 Received: from localhost ([127.0.0.1]:41115 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kX5om-00069a-Vh for submit@debbugs.gnu.org; Mon, 26 Oct 2020 12:58:01 -0400 Received: from eggs.gnu.org ([209.51.188.92]:42656) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kX5om-00069Q-4M for 44130-done@debbugs.gnu.org; Mon, 26 Oct 2020 12:58:00 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:58554) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kX5og-0005Rp-H5; Mon, 26 Oct 2020 12:57:54 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=33992 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1kX5oe-0004gG-FF; Mon, 26 Oct 2020 12:57:52 -0400 From: Ludovic =?utf-8?q?Court=C3=A8s?= References: <6ff632f5c1e378647cecc7177b7018fb8a0ee6d4.camel@divoplade.fr> <87y2jxnl0z.fsf@gnu.org> <85064b7663c320e8062b2db78151d22fc6fcddef.camel@divoplade.fr> <871rholwzj.fsf@gnu.org> <3dca955c97222648074515b1a2c5ace96a2f1fd6.camel@divoplade.fr> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 3 Brumaire an 229 de la =?utf-8?q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 26 Oct 2020 17:57:50 +0100 In-Reply-To: <3dca955c97222648074515b1a2c5ace96a2f1fd6.camel@divoplade.fr> (divoplade's message of "Fri, 23 Oct 2020 19:12:17 +0200") Message-ID: <87r1pkaprl.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches Hello! divoplade skribis: > Le vendredi 23 octobre 2020 à 18:37 +0200, Ludovic Courtès a écrit : >> >> What I was questioning is the temptation to make one-function >> packages >> as is common for instance in npm. > > Ah, so I can summarize. My solutions are: > > 1. Guile provides mkdir-p: Perfect! Yes, we can work towards that goal. > 2. I put the function in a package: not great, but acceptable. > 3. I depend on gash: not acceptable, there's only mkdir-p that's > interesting, the rest is for advanced system tools. > 4. I copy that function around: not acceptable. I agree that #4 is suboptimal, but I think you’re overstating it. > So, there's no temptation to make one-function packages. Well… :-) > Should I understand that you question the integration of one-function > packages into guix? If you don't want it in guix, then it's fine, I can > just use it only for myself, I have my own channel. In which case, > please just say so, so we can all move on to more interesting things. No no, like I wrote, I’m fine adding the ‘mkdir-p’ package, no problem; the project currently has no guideline against one-function packages. Anyway, I’ve applied the patch with the cosmetic changes below. Thanks! Ludo’. diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm index e3f547412b..d09e8d9737 100644 --- a/gnu/packages/guile-xyz.scm +++ b/gnu/packages/guile-xyz.scm @@ -4016,12 +4016,14 @@ errors.") (method git-fetch) (uri (git-reference (url "https://code.divoplade.fr/mkdir-p.git") - (commit "83e955ba612369336a69fe50fe023ad14fbe5d7c"))) - (sha256 (base32 "01k20rjcv6p0spmw8ls776aar6bfw0jxw46d2n12w0cb2p79xjv8")) + (commit (string-append "v" version)))) + (sha256 + (base32 "01k20rjcv6p0spmw8ls776aar6bfw0jxw46d2n12w0cb2p79xjv8")) + (file-name (git-file-name name version)) (snippet `(begin (with-output-to-file ".tarball-version" - (lambda _ (format #t "~a~%" "1.0.1"))) + (lambda _ (format #t "~a~%" ,version))) #t)))) (build-system gnu-build-system) (arguments `()) @@ -4034,14 +4036,12 @@ errors.") ("pkg-config" ,pkg-config) ("gettext" ,gnu-gettext))) (inputs `(("guile" ,guile-3.0))) - (propagated-inputs - `(("guile" ,guile-3.0))) - (synopsis "Implementation of a recursive mkdir for guile") + (synopsis "Implementation of a recursive @code{mkdir} for Guile") (description - "This package provides within the (mkdir-p) module the mkdir-p function -that tries to create the chain of directories recursively. It also provides -new versions of open-output-file, call-with-output-file and -with-output-to-file to create the directory of its argument if it does not -exist.") + "This package provides within the @code{(mkdir-p)} module the +@code{mkdir-p} function that tries to create the chain of directories +recursively. It also provides new versions of @code{open-output-file}, +@code{call-with-output-file} and @code{with-output-to-file} to create the +directory of its argument if it does not exist.") (home-page "https://mkdir-p.divoplade.fr") (license license:asl2.0)))