1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-03-28 15:54:58 +02:00
Files
coreutils/tests/cp/debug.sh
Pádraig Brady cc078f747f copy: reduce verbosity of -i and -u with --verbose
Since skipping of files is central to the operation of -i and -u,
and with -u one may be updating few files out of many,
reinstate the verbosity of this functionality as it was before 9.3.

* src/copy.c (copy_internal): Only output "skipped" message
with --debug.  Also adjust so message never changes with --debug.
* tests/cp/cp-i.sh: Adjust accordingly.
* tests/mv/mv-n.sh: Likewise.
* tests/cp/debug.sh: Add explicit test case for message.
* NEWS: Mention the change in behavior.
2023-04-25 11:17:54 +01:00

33 lines
1.2 KiB
Bash
Executable File

#!/bin/sh
# Ensure that cp --debug works as documented
# Copyright (C) 2023 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
print_ver_ cp
touch file || framework_failure_
cp --debug file file.cp >cp.out || fail=1
grep 'copy offload:.*reflink:.*sparse detection:' cp.out || fail=1
cp --debug --attributes-only file file.cp >cp.out || fail=1
returns_ 1 grep 'copy offload:.*reflink:.*sparse detection:' cp.out || fail=1
touch file.cp || framework_failure_
cp --debug --update=none file file.cp >cp.out || fail=1
grep 'skipped' cp.out || fail=1
Exit $fail