Pádraig Brady wrote:
> Perhaps 'sleep' is a shell builtin here which is confusing things?

Yes:
$ type sleep
sleep is a shell builtin

> Does the following help (I don't have easy access to an alpine system):

> diff --git a/tests/misc/usage_vs_getopt.sh b/tests/misc/usage_vs_getopt.sh
> index 3ffb7b0b1..f4f12136a 100755
> --- a/tests/misc/usage_vs_getopt.sh
> +++ b/tests/misc/usage_vs_getopt.sh
> @@ -87,7 +87,7 @@ for prg in $built_programs; do
>       '[' | expr | stty )
>         continue;;
>       # Wrap some utilities known by the shell by env.
> -    echo | false | kill | printf | pwd | test | true )
> +    echo | false | kill | printf | pwd | sleep | test | true )
>         prg="env $prg";;
>     esac
>     checkprg $prg
> 
> 

Yes. With this change, the failure disappears. And the other one as well(!).
Instead, a new failure appears (!!):
  FAIL: tests/cp/preserve-mode

This is reproducible, not spurious: I ran "make check" 3 times, 3 times the
same result.

Find attached tests/cp/preserve-mode.log.

+ initial_cwd_=/home/bruno/coreutils-9.3.147-d553ab/build
+ testdir_prefix_
+ printf gt
+ pfx_=gt
+ mktempd_ /home/bruno/coreutils-9.3.147-d553ab/build gt-preserve-mode.sh.XXXX
+ destdir_=/home/bruno/coreutils-9.3.147-d553ab/build
+ template_=gt-preserve-mode.sh.XXXX
+ MAX_TRIES_=4
+ destdir_slash_=/home/bruno/coreutils-9.3.147-d553ab/build/
+ unset TMPDIR
+ d=/home/bruno/coreutils-9.3.147-d553ab/build/gt-preserve-mode.sh.JT3x
+ :
+ test -d /home/bruno/coreutils-9.3.147-d553ab/build/gt-preserve-mode.sh.JT3x
+ ls -dgo /home/bruno/coreutils-9.3.147-d553ab/build/gt-preserve-mode.sh.JT3x
+ perms='drwx--S--- 2 4096 Aug 27 17:57 /home/bruno/coreutils-9.3.147-d553ab/build/gt-preserve-mode.sh.JT3x'
+ :
+ echo /home/bruno/coreutils-9.3.147-d553ab/build/gt-preserve-mode.sh.JT3x
+ return
+ test_dir_=/home/bruno/coreutils-9.3.147-d553ab/build/gt-preserve-mode.sh.JT3x
+ cd /home/bruno/coreutils-9.3.147-d553ab/build/gt-preserve-mode.sh.JT3x
+ srcdir=../..
+ builddir=..
+ export srcdir builddir
+ gl_init_sh_nl_='
'
+ IFS=' 	
'
+ expr 1 + 128
+ eval 'trap '"'"'Exit 129'"'"' 1'
+ trap 'Exit 129' 1
+ expr 2 + 128
+ eval 'trap '"'"'Exit 130'"'"' 2'
+ trap 'Exit 130' 2
+ expr 3 + 128
+ eval 'trap '"'"'Exit 131'"'"' 3'
+ trap 'Exit 131' 3
+ expr 13 + 128
+ eval 'trap '"'"'Exit 141'"'"' 13'
+ trap 'Exit 141' 13
+ expr 15 + 128
+ eval 'trap '"'"'Exit 143'"'"' 15'
+ trap 'Exit 143' 15
+ saved_IFS=' 	
'
+ IFS=:
+ new_PATH=
+ sep_=
+ test -d /home/bruno/coreutils-9.3.147-d553ab/build/src/.
+ new_PATH=/home/bruno/coreutils-9.3.147-d553ab/build/src
+ sep_=:
+ test -d /home/bruno/bin/.
+ new_PATH=/home/bruno/coreutils-9.3.147-d553ab/build/src:/home/bruno/bin
+ sep_=:
+ test -d /usr/local/bin/.
+ new_PATH=/home/bruno/coreutils-9.3.147-d553ab/build/src:/home/bruno/bin:/usr/local/bin
+ sep_=:
+ test -d /usr/sbin/.
+ new_PATH=/home/bruno/coreutils-9.3.147-d553ab/build/src:/home/bruno/bin:/usr/local/bin:/usr/sbin
+ sep_=:
+ test -d /usr/bin/.
+ new_PATH=/home/bruno/coreutils-9.3.147-d553ab/build/src:/home/bruno/bin:/usr/local/bin:/usr/sbin:/usr/bin
+ sep_=:
+ test -d /sbin/.
+ new_PATH=/home/bruno/coreutils-9.3.147-d553ab/build/src:/home/bruno/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin
+ sep_=:
+ test -d /bin/.
+ new_PATH=/home/bruno/coreutils-9.3.147-d553ab/build/src:/home/bruno/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ sep_=:
+ IFS=' 	
'
+ PATH=/home/bruno/coreutils-9.3.147-d553ab/build/src:/home/bruno/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ export PATH
+ trap remove_tmp_ EXIT
+ path_prepend_ ./src
+ test 1 '!=' 0
+ path_dir_=./src
+ abs_path_dir_=/home/bruno/coreutils-9.3.147-d553ab/build/./src
+ PATH=/home/bruno/coreutils-9.3.147-d553ab/build/./src:/home/bruno/coreutils-9.3.147-d553ab/build/src:/home/bruno/bin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
+ create_exe_shims_ /home/bruno/coreutils-9.3.147-d553ab/build/./src
+ return 0
+ shift
+ test 0 '!=' 0
+ export PATH
+ print_ver_ cp
+ require_built_ cp
+ skip_=no
+ test no '=' yes
+ test yes '=' yes
+ local i
+ env cp --version
cp (GNU coreutils) 9.3.147-d553ab
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://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 Torbjorn Granlund, David MacKenzie, and Jim Meyering.
+ umask 0022
+ touch a b
+ chmod 600 b
+ cp '--no-preserve=mode' b c
+ get_mode a
+ stat '-c%f' a
+ get_mode c
+ stat '-c%f' c
+ test 81a4 '=' 81a4
+ chmod 600 c
+ cp '--no-preserve=mode' a b
+ get_mode b
+ stat '-c%f' b
+ get_mode c
+ stat '-c%f' c
+ test 8180 '=' 8180
+ mkdir d1 d2
+ chmod 705 d2
+ cp '--no-preserve=mode' -r d2 d3
+ get_mode d1
+ stat '-c%f' d1
+ get_mode d3
+ stat '-c%f' d3
+ test 45ed '=' 41ed
+ fail=1
+ rm -f a b
+ touch a
+ chmod 600 a
+ cp '--no-preserve=mode' '--preserve=all' a b
+ get_mode a
+ stat '-c%f' a
+ get_mode b
+ stat '-c%f' b
+ test 8180 '=' 8180
+ mkfifo fifo
+ cp -a '--no-preserve=mode' fifo fifo_copy
+ get_mode fifo
+ stat '-c%f' fifo
+ get_mode fifo_copy
+ stat '-c%f' fifo_copy
+ test 11a4 '=' 11a4
+ rm -f a b c
+ touch a
+ chmod 660 a
+ cp a b
+ cp '--preserve=ownership' a c
+ get_mode b
+ stat '-c%f' b
+ get_mode c
+ stat '-c%f' c
+ test 81a0 '=' 81a0
+ Exit 1
+ set +e
+ exit 1
+ exit 1
+ remove_tmp_
+ __st=1
+ cleanup_
+ :
+ test  '=' yes
+ cd /home/bruno/coreutils-9.3.147-d553ab/build
+ chmod -R u+rwx /home/bruno/coreutils-9.3.147-d553ab/build/gt-preserve-mode.sh.JT3x
+ rm -rf /home/bruno/coreutils-9.3.147-d553ab/build/gt-preserve-mode.sh.JT3x
+ exit 1
FAIL tests/cp/preserve-mode.sh (exit status: 1)

Reply via email to