GNU bug report logs -
#44130
[PATCH] Add a recursive version of mkdir-p
Previous Next
Reported by: divoplade <d <at> divoplade.fr>
Date: Wed, 21 Oct 2020 23:31:02 UTC
Severity: normal
Tags: patch
Done: Ludovic Courtès <ludo <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Mon, 26 Oct 2020 17:57:50 +0100
with message-id <87r1pkaprl.fsf <at> gnu.org>
and subject line Re: [bug#44130] [PATCH] Add a recursive version of mkdir-p
has caused the debbugs.gnu.org bug report #44130,
regarding [PATCH] Add a recursive version of mkdir-p
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
44130: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=44130
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
[Message part 3 (text/plain, inline)]
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
[0001-Add-guile-mkdir-p.patch (text/x-patch, attachment)]
[Message part 5 (message/rfc822, inline)]
[Message part 6 (text/plain, inline)]
Hello!
divoplade <d <at> divoplade.fr> 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’.
[Message part 7 (text/x-patch, inline)]
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)))
This bug report was last modified 4 years and 265 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.