coreutils/doc
Daan De Meyer a357cfb021 cp: add --keep-directory-symlink option
When recursively copying files into OS trees, it often happens that
some subdirectory of the source directory is a symlink in the target
directory. Currently, cp will fail in that scenario with the error:

"cannot overwrite non-directory %s with directory %s"

However, we'd like cp in this scenario to follow the destination
directory symlink and copy the files into the symlinked directory
instead. Let's support this by adding a new option
--keep-directory-symlink that makes cp follow destination directory
symlinks.

We name the option --keep-directory-symlink to keep consistent with
tar which has the same option with the same effect.

* doc/coreutils.texi (cp invocation): Describe the new option.
* src/copy.h: Add the new setting.
* src/copy.h: Adjust to follow symlinks if setting enabled.
* src/cp.c (usage): Describe the new option.
(main): Accept the new option.
* tests/cp/keep-directory-symlink.sh: A new test.
* tests/local.mk: Reference the new test.
* NEWS: Mention the new feature.
2024-02-22 14:37:47 +00:00
..
.gitignore maint: copy FDL from gnulib instead of using it as module 2020-05-25 16:31:08 +02:00
coreutils.texi cp: add --keep-directory-symlink option 2024-02-22 14:37:47 +00:00
fdl.texi build: update gnulib submodule to latest 2022-01-02 16:14:40 +00:00
local.mk maint: update all copyright year number ranges 2024-01-01 13:27:23 +00:00
perm.texi maint: update all copyright year number ranges 2024-01-01 13:27:23 +00:00
sort-version.texi maint: update all copyright year number ranges 2024-01-01 13:27:23 +00:00