[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#39485: [PATCH] make tests/cp/preserve-gid work with single binary
From: |
Kamil Dudka |
Subject: |
bug#39485: [PATCH] make tests/cp/preserve-gid work with single binary |
Date: |
Mon, 10 Feb 2020 15:36:58 +0100 |
On Saturday, February 8, 2020 12:53:52 PM CET Pádraig Brady wrote:
> Considering --enable-single-binary-exceptions may exclude cp,
> and also that coreutils(1) may be compiled during
> non --enable-single-binary build when building
> all programs for `make syntax-check` etc.
> we should add an extra guard.
>
> Also we can simplify by just copying coreutils to cp.
>
> I'll amend your change with the following and push later.
> Marking this as done.
>
> thanks!
> Pádraig
>
> diff --git a/tests/cp/preserve-gid.sh b/tests/cp/preserve-gid.sh
> index 41cdbc6ca..bba09df09 100755
> --- a/tests/cp/preserve-gid.sh
> +++ b/tests/cp/preserve-gid.sh
> @@ -110,10 +110,11 @@ cleanup_() { rm -rf "$tmp_path"; }
> # is not readable by our nameless IDs.
> test -d /tmp && TMPDIR=/tmp
> tmp_path=$(mktemp -d) || fail_ "failed to create temporary directory"
> -if test -x "$abs_path_dir_/coreutils"; then
> +if test -x "$abs_path_dir_/coreutils" &&
> + { test -l "$abs_path_dir_/cp" ||
This should be spelled `test -L` I guess.
> + test $(wc -l < "$abs_path_dir_/cp") = 1; } then
> # if configured with --enable-single-binary we need to use the single
> binary - cp "$abs_path_dir_/coreutils" "$tmp_path"
> - echo "#!$tmp_path/coreutils --coreutils-prog-shebang=cp" > "$tmp_path/cp"
> + cp "$abs_path_dir_/coreutils" "$tmp_path/cp" || framework_failure_ else
> cp "$abs_path_dir_/cp" "$tmp_path"
> fi
Otherwise looks good. Thank you for fixing it!
Kamil