emacs-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#39485: closed ([PATCH] make tests/cp/preserve-gid work with single b


From: GNU bug Tracking System
Subject: bug#39485: closed ([PATCH] make tests/cp/preserve-gid work with single binary)
Date: Sat, 08 Feb 2020 11:54:02 +0000

Your message dated Sat, 8 Feb 2020 11:53:52 +0000
with message-id <address@hidden>
and subject line Re: bug#39485: [PATCH] make tests/cp/preserve-gid work with 
single binary
has caused the debbugs.gnu.org bug report #39485,
regarding [PATCH] make tests/cp/preserve-gid work with single binary
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden.)


-- 
39485: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=39485
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: [PATCH] make tests/cp/preserve-gid work with single binary Date: Fri, 7 Feb 2020 17:05:06 +0100
* tests/cp/preserve-gid.sh: If configured with --enable-single-binary
copy the coreutils single binary, instead of the cp one-line launcher.

Bug: https://bugzilla.redhat.com/1800597
---
 tests/cp/preserve-gid.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/cp/preserve-gid.sh b/tests/cp/preserve-gid.sh
index e48584c1e..41cdbc6ca 100755
--- a/tests/cp/preserve-gid.sh
+++ b/tests/cp/preserve-gid.sh
@@ -110,7 +110,13 @@ 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"
-cp "$abs_path_dir_/cp" "$tmp_path"
+if test -x "$abs_path_dir_/coreutils"; 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"
+else
+  cp "$abs_path_dir_/cp" "$tmp_path"
+fi
 chmod -R a+rx "$tmp_path"
 
 t1() {
-- 
2.21.1




--- End Message ---
--- Begin Message --- Subject: Re: bug#39485: [PATCH] make tests/cp/preserve-gid work with single binary Date: Sat, 8 Feb 2020 11:53:52 +0000 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:73.0) Gecko/20100101 Thunderbird/73.0
On 07/02/2020 16:05, Kamil Dudka wrote:
* tests/cp/preserve-gid.sh: If configured with --enable-single-binary
copy the coreutils single binary, instead of the cp one-line launcher.

Bug: https://bugzilla.redhat.com/1800597
---
  tests/cp/preserve-gid.sh | 8 +++++++-
  1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tests/cp/preserve-gid.sh b/tests/cp/preserve-gid.sh
index e48584c1e..41cdbc6ca 100755
--- a/tests/cp/preserve-gid.sh
+++ b/tests/cp/preserve-gid.sh
@@ -110,7 +110,13 @@ 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"
-cp "$abs_path_dir_/cp" "$tmp_path"
+if test -x "$abs_path_dir_/coreutils"; 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"
+else
+  cp "$abs_path_dir_/cp" "$tmp_path"
+fi
  chmod -R a+rx "$tmp_path"
t1() {


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" ||
+     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


--- End Message ---

reply via email to

[Prev in Thread] Current Thread [Next in Thread]