unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: divoplade <d@divoplade.fr>
To: 44130@debbugs.gnu.org
Subject: [bug#44130] [PATCH] Add a recursive version of mkdir-p
Date: Thu, 22 Oct 2020 01:29:48 +0200	[thread overview]
Message-ID: <6ff632f5c1e378647cecc7177b7018fb8a0ee6d4.camel@divoplade.fr> (raw)

[-- Attachment #1: Type: text/plain, Size: 757 bytes --]

Dear guix,

I need this mkdir-p function in any non-trivial program I write. I had
3 bad choices:

1. Lobby guile to provide this function out of the box (this will take
time);
2. Copy that of guix, or gash, or any other: this does not seem
acceptable to me, because this function will surely evolve (for
instance, if guile gets suport for mingw and we start running guile
programs on windows) and I don't want to update more than one version
of this function;
3. Depend on guix, gash or another package: this would be too large a
dependency for my programs.

So I wrote it in its own package and I intend to depend on it for my
other projects. It would be best if you could accept this package in
guix proper.

What do you think?

Best regards,

divoplade

[-- Attachment #2: 0001-Add-guile-mkdir-p.patch --]
[-- Type: text/x-patch, Size: 2323 bytes --]

From 1a1798a99b09ef7df0f183d99ea9a4717b9406d7 Mon Sep 17 00:00:00 2001
From: divoplade <d@divoplade.fr>
Date: Thu, 22 Oct 2020 01:14:27 +0200
Subject: [PATCH] Add guile-mkdir-p

As there is no guile function to create directories recursively, a lot of
packages bundle their own. For instance, Guile as Shell or Guix. This also
happens to me, as I need this function in any substantial program.
---
 gnu/packages/guile-xyz.scm | 39 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/gnu/packages/guile-xyz.scm b/gnu/packages/guile-xyz.scm
index 88c0586dc9..2504deb3af 100644
--- a/gnu/packages/guile-xyz.scm
+++ b/gnu/packages/guile-xyz.scm
@@ -4007,3 +4007,42 @@ features not found in the standard read procedure such as a compatible mode
 with support for other RnRS standards and a tolerant mode that continues on
 errors.")
     (license license:expat)))
+
+(define-public guile-mkdir-p
+  (package
+    (name "guile-mkdir-p")
+    (version "1.0.1")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://code.divoplade.fr/mkdir-p.git")
+             (commit "83e955ba612369336a69fe50fe023ad14fbe5d7c")))
+       (sha256 (base32 "01k20rjcv6p0spmw8ls776aar6bfw0jxw46d2n12w0cb2p79xjv8"))
+       (snippet
+        `(begin
+           (with-output-to-file ".tarball-version"
+             (lambda _ (format #t "~a~%" "1.0.1")))
+           #t))))
+    (build-system gnu-build-system)
+    (arguments `())
+    (native-inputs
+     `(("guile" ,guile-3.0)
+       ("texinfo" ,texinfo)
+       ("autoconf" ,autoconf)
+       ("autoconf-archive" ,autoconf-archive)
+       ("automake" ,automake)
+       ("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")
+    (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.")
+    (home-page "https://mkdir-p.divoplade.fr")
+    (license license:asl2.0)))
-- 
2.28.0


             reply	other threads:[~2020-10-22  1:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-21 23:29 divoplade [this message]
2020-10-23 13:12 ` [bug#44130] [PATCH] Add a recursive version of mkdir-p Ludovic Courtès
2020-10-23 14:14   ` divoplade
2020-10-23 16:37     ` Ludovic Courtès
2020-10-23 17:12       ` divoplade
2020-10-26 16:57         ` bug#44130: " Ludovic Courtès
2020-10-23 19:36 ` [bug#44130] " zimoun
2020-10-23 22:00   ` [bug#44130] Recursive mkdir divoplade
2020-10-23 22:11   ` [bug#44130] [PATCH] Add a recursive version of mkdir-p divoplade
2020-10-23 20:01 ` Leo Prikler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6ff632f5c1e378647cecc7177b7018fb8a0ee6d4.camel@divoplade.fr \
    --to=d@divoplade.fr \
    --cc=44130@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).