Subject: Re: bug#17087: cp -i/yes gets ignored

From: Bernhard Voelker <[email-masked]>
Date: Wed, 26 Mar 2014 14:26:43 +0100

On 03/25/2014 07:25 AM, Paul Eggert wrote:
> (the second is just a code cleanup).

Oops, that 2nd patch
   http://git.sv.gnu.org/cgit/coreutils.git/commit/?id=7f669b40
now produces the following check failure:

FAIL: tests/mv/i-3
==================

++ initial_cwd_=/home/berny/coreutils
++ fail=0
+++ testdir_prefix_
+++ printf gt
++ pfx_=gt
+++ mktempd_ /home/berny/coreutils gt-i-3.sh.XXXX
+++ case $# in
+++ destdir_=/home/berny/coreutils
+++ template_=gt-i-3.sh.XXXX
+++ MAX_TRIES_=4
+++ case $destdir_ in
+++ case $template_ in
++++ unset TMPDIR
+++ d=/home/berny/coreutils/gt-i-3.sh.gj66
+++ case $d in
+++ test -d /home/berny/coreutils/gt-i-3.sh.gj66
++++ ls -dgo /home/berny/coreutils/gt-i-3.sh.gj66
++++ tr S -
+++ perms='drwx------ 2 4096 Mar 26 14:13 /home/berny/coreutils/gt-i-3.sh.gj66'
+++ case $perms in
+++ test 0 = 0
+++ echo /home/berny/coreutils/gt-i-3.sh.gj66
+++ return
++ test_dir_=/home/berny/coreutils/gt-i-3.sh.gj66
++ cd /home/berny/coreutils/gt-i-3.sh.gj66
++ gl_init_sh_nl_='
'
++ IFS=' 	
'
++ for sig_ in 1 2 3 13 15
+++ expr 1 + 128
++ eval 'trap '\''Exit 129'\'' 1'
+++ trap 'Exit 129' 1
++ for sig_ in 1 2 3 13 15
+++ expr 2 + 128
++ eval 'trap '\''Exit 130'\'' 2'
+++ trap 'Exit 130' 2
++ for sig_ in 1 2 3 13 15
+++ expr 3 + 128
++ eval 'trap '\''Exit 131'\'' 3'
+++ trap 'Exit 131' 3
++ for sig_ in 1 2 3 13 15
+++ expr 13 + 128
++ eval 'trap '\''Exit 141'\'' 13'
+++ trap 'Exit 141' 13
++ for sig_ in 1 2 3 13 15
+++ expr 15 + 128
++ eval 'trap '\''Exit 143'\'' 15'
+++ trap 'Exit 143' 15
++ trap remove_tmp_ 0
+ path_prepend_ ./src
+ test 1 '!=' 0
+ path_dir_=./src
+ case $path_dir_ in
+ abs_path_dir_=/home/berny/coreutils/./src
+ case $abs_path_dir_ in
+ PATH=/home/berny/coreutils/./src:/home/berny/coreutils/src:/home/berny/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/X11R6/bin:/usr/games:/sbin:/usr/sbin
+ create_exe_shims_ /home/berny/coreutils/./src
+ case $EXEEXT in
+ return 0
+ shift
+ test 0 '!=' 0
+ export PATH
+ print_ver_ mv
+ test yes = yes
+ local i
+ for i in '$*'
+ env mv --version
mv (GNU coreutils) 8.22.45-137a42
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Parker, David MacKenzie, and Jim Meyering.
+ require_controlling_input_terminal_
+ tty -s
+ test -t 0
+ test '' = no
+ skip_if_root_
+ uid_is_privileged_
++ id -u
+ my_uid=717
+ case $my_uid in
+ return 1
+ trap '' TTIN
++ uname -s
+ test Linux = FreeBSD
+ touch f g h i
+ chmod 0 g i
+ ls /dev/stdin
++ readlink -f /dev/stdin
+ tty=/dev/pts/1
+ test -r /dev/pts/1
+ pid=18300
+ mv f g
+ retry_delay_ check_overwrite_prompt .1 7
+ local test_func=check_overwrite_prompt
+ local init_delay=.1
+ local max_n_tries=7
+ shift 3
+ local attempt=1
+ local num_sleeps=1
+ local time_fail
+ test 1 -le 7
++ gawk -v n=1 -v s=.1 'BEGIN { print s * n }'
+ local delay=0.1
+ check_overwrite_prompt 0.1
+ local delay=0.1
+ case "$(cat out)" in
++ cat out
+ sleep 0.1
+ return 1
+ time_fail=1
++ expr 1 + 1
+ attempt=2
++ expr 1 '*' 2
+ num_sleeps=2
+ test 2 -le 7
++ gawk -v n=2 -v s=.1 'BEGIN { print s * n }'
+ local delay=0.2
+ check_overwrite_prompt 0.2
+ local delay=0.2
+ case "$(cat out)" in
++ cat out
+ sleep 0.2
+ return 1
+ time_fail=1
++ expr 2 + 1
+ attempt=3
++ expr 2 '*' 2
+ num_sleeps=4
+ test 3 -le 7
++ gawk -v n=4 -v s=.1 'BEGIN { print s * n }'
+ local delay=0.4
+ check_overwrite_prompt 0.4
+ local delay=0.4
+ case "$(cat out)" in
++ cat out
+ sleep 0.4
+ return 1
+ time_fail=1
++ expr 3 + 1
+ attempt=4
++ expr 4 '*' 2
+ num_sleeps=8
+ test 4 -le 7
++ gawk -v n=8 -v s=.1 'BEGIN { print s * n }'
+ local delay=0.8
+ check_overwrite_prompt 0.8
+ local delay=0.8
+ case "$(cat out)" in
++ cat out
+ sleep 0.8
+ return 1
+ time_fail=1
++ expr 4 + 1
+ attempt=5
++ expr 8 '*' 2
+ num_sleeps=16
+ test 5 -le 7
++ gawk -v n=16 -v s=.1 'BEGIN { print s * n }'
+ local delay=1.6
+ check_overwrite_prompt 1.6
+ local delay=1.6
+ case "$(cat out)" in
++ cat out
+ sleep 1.6
+ return 1
+ time_fail=1
++ expr 5 + 1
+ attempt=6
++ expr 16 '*' 2
+ num_sleeps=32
+ test 6 -le 7
++ gawk -v n=32 -v s=.1 'BEGIN { print s * n }'
+ local delay=3.2
+ check_overwrite_prompt 3.2
+ local delay=3.2
+ case "$(cat out)" in
++ cat out
+ sleep 3.2
+ return 1
+ time_fail=1
++ expr 6 + 1
+ attempt=7
++ expr 32 '*' 2
+ num_sleeps=64
+ test 7 -le 7
++ gawk -v n=64 -v s=.1 'BEGIN { print s * n }'
+ local delay=6.4
+ check_overwrite_prompt 6.4
+ local delay=6.4
+ case "$(cat out)" in
++ cat out
+ sleep 6.4
+ return 1
+ time_fail=1
++ expr 7 + 1
+ attempt=8
++ expr 64 '*' 2
+ num_sleeps=128
+ test 8 -le 7
+ test 1 = 0
+ fail=1
+ kill 18300
+ mv -f h i
+ test -f i
+ test -f h
+ case "$(cat out)" in
++ cat out
+ Exit 1
+ set +e
+ exit 1
+ exit 1
+ remove_tmp_
+ __st=1
+ cleanup_
+ :
+ cd /home/berny/coreutils
+ chmod -R u+rwx /home/berny/coreutils/gt-i-3.sh.gj66
+ rm -rf /home/berny/coreutils/gt-i-3.sh.gj66
+ exit 1

BTW: in check_overwrite_prompt, the file 'out' contains
   "mv: unwritable 'g' (mode 0000, ---------); try anyway?"

Have a nice day,
Berny