diff options
| author | Pádraig Brady <P@draigBrady.com> | 2023-04-03 18:12:33 +0100 |
|---|---|---|
| committer | Pádraig Brady <P@draigBrady.com> | 2023-04-04 12:00:11 +0100 |
| commit | 5891d28edebe229f1a6057275e281b10c1f2247b (patch) | |
| tree | 290134b343e7066d1d157c7c033dc0663c3674fb /tests/cp/backup-dir.sh | |
| parent | tests: tee: avoid false failure due to fifo usage (diff) | |
| download | coreutils-5891d28edebe229f1a6057275e281b10c1f2247b.tar.gz coreutils-5891d28edebe229f1a6057275e281b10c1f2247b.zip | |
cp: fix --backup with subdirectories
* gnulib: Reference the latest gnulib including the
fix to the backupfile module in commit 94496522.
* tests/cp/backup-dir.sh: Add a test to ensure
we rename appropriately when backing up through subdirs.
* NEWS: Mention the bug fix.
Fixes https://bugs.gnu.org/62607
Diffstat (limited to '')
| -rwxr-xr-x | tests/cp/backup-dir.sh | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/cp/backup-dir.sh b/tests/cp/backup-dir.sh index 6573d58e0..5c17498cf 100755 --- a/tests/cp/backup-dir.sh +++ b/tests/cp/backup-dir.sh @@ -1,5 +1,5 @@ #!/bin/sh -# Ensure that cp -b doesn't back up directories. +# Ensure that cp -b handles directories appropriately # Copyright (C) 2006-2023 Free Software Foundation, Inc. @@ -29,4 +29,10 @@ cp -ab x y || fail=1 test -d y/x || fail=1 test -d y/x~ && fail=1 +# Bug 62607. +# This would fail to backup using rename, and thus fail to replace the file +mkdir -p {src,dst}/foo || framework_failure_ +touch {src,dst}/foo/bar || framework_failure_ +cp --recursive --backup src/* dst || fail=1 + Exit $fail |
