[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: make install -D create directories if -t
From: |
Bernhard Voelker |
Subject: |
Re: make install -D create directories if -t |
Date: |
Wed, 11 Jun 2014 09:21:40 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 |
On 06/11/2014 12:27 AM, Pádraig Brady wrote:
On 06/10/2014 11:10 PM, Bernhard Voelker wrote:
The attached patch implements this.
BTW: the Texinfo manual was falsely stating that [g]install
would ignore the -D option when -t was given (instead, it
complained with ENOENT for the target_directory):
`-D'
Create any missing parent directories of DEST, then copy SOURCE to
DEST. This option is ignored if a destination directory is
specified via `--target-directory=DIR'.
I've not looked in detail, but on the face of it
-D should be able to create the single dir (hierarchy),
either specified implicitly with DEST, or explicitly with -t.
Do you think it's worth amending with this?
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index bcd2b2e..710729b 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -9071,6 +9071,8 @@ Ignored; for compatibility with old Unix versions of
@command{install}.
@opindex -D
Create any missing parent directories of @var{dest},
then copy @var{source} to @var{dest}.
+In combination with --target-directory=@var{dir}, each missing directory
+of @var{dir} - including that - is created.
@item -d
@itemx --directory
the target_directory exists down after the option pparsing loop,
s/pp/p/
done
+static bool
+install_file_in_file_parents (char const *from, char *to,
+ const struct cp_options *x)
+{
+ return ( mkancesdirs_safe_wd (from, to, (struct cp_options *)x)
+ && install_file_in_file (from, to, x));
kinda hard to read that indenting
done
Thanks for the review.
Have a nice day,
Berny