From 15d092f94a3abd4ba328a9c9ac4531320ec381ec Mon Sep 17 00:00:00 2001 From: Bernhard Voelker Date: Wed, 11 Jun 2014 11:28:03 +0200 Subject: install: allow options -D and -t to be used together * src/install.c (install_file_in_file_parents): Factor out the creation of any parent directories into ... (mkancesdirs_safe_wd): ... this new function. (install_file_in_dir): Add the parameter 'mkdir_and_install', and call the above new function if it evaluates to true. (main): During parsing of the -t option, move the check whether the target_directory exists down after the option parsing loop, and do not complain about stat(optarg,...) failing if -D was given. Pass 'mkdir_and_install' to install_file_in_dir(). * doc/coreutils.texi (install invocation): Remove the (false) restriction that -D would be ignored together with -t. Instead, clarify install's new bahavior. Fix the node's reference in the top-level @direntry for consistency. * src/install/basic-1.sh: Add tests for the now-allowed combination of the -D and -t options. * NEWS: Mention the improvement. --- doc/coreutils.texi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 243b6d745..3cdfb72fe 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -70,7 +70,7 @@ * hostid: (coreutils)hostid invocation. Print numeric host identifier. * hostname: (coreutils)hostname invocation. Print or set system name. * id: (coreutils)id invocation. Print user identity. -* install: (coreutils)install invocation. Copy and change attributes. +* install: (coreutils)install invocation. Copy files and set attributes. * join: (coreutils)join invocation. Join lines on a common field. * kill: (coreutils)kill invocation. Send a signal to processes. * link: (coreutils)link invocation. Make hard links between files. @@ -9071,8 +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}. -This option is ignored if a destination directory is specified -via @option{--target-directory=DIR}. +Explicitly specifying the @option{--target-directory=@var{dir}} will similarly +ensure the presence of that hierarchy before copying @var{source} arguments. @item -d @itemx --directory -- cgit v1.2.3-54-g00ecf