archrelease: copy trunk to extra-x86_64
[arch-packages.git] / coreutils / repos / core-x86_64 / coreutils-backup-62607.patch
blob7d39aa5e6add7fcad3654f458699ddf1108c8fac
1 From 1a80fab339d52db7e284b4f2f41068d5d8dd7e4e Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
3 Date: Mon, 3 Apr 2023 18:12:33 +0100
4 Subject: [PATCH] tests: cp: test --backup with subdirectories
6 * tests/cp/backup-dir.sh: Add a test to ensure
7 we rename appropriately when backing up through subdirs.
8 * NEWS: Mention the bug fix.
9 Addresses https://bugs.gnu.org/62607
10 ---
11 NEWS | 5 +++++
12 tests/cp/backup-dir.sh | 8 +++++++-
13 2 files changed, 12 insertions(+), 1 deletion(-)
15 diff --git a/tests/cp/backup-dir.sh b/tests/cp/backup-dir.sh
16 index 6573d58e0..5c17498cf 100755
17 --- a/tests/cp/backup-dir.sh
18 +++ b/tests/cp/backup-dir.sh
19 @@ -1,5 +1,5 @@
20 #!/bin/sh
21 -# Ensure that cp -b doesn't back up directories.
22 +# Ensure that cp -b handles directories appropriately
24 # Copyright (C) 2006-2023 Free Software Foundation, Inc.
26 @@ -29,4 +29,10 @@ cp -ab x y || fail=1
27 test -d y/x || fail=1
28 test -d y/x~ && fail=1
30 +# Bug 62607.
31 +# This would fail to backup using rename, and thus fail to replace the file
32 +mkdir -p {src,dst}/foo || framework_failure_
33 +touch {src,dst}/foo/bar || framework_failure_
34 +cp --recursive --backup src/* dst || fail=1
36 Exit $fail
37 --
38 2.26.2