unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Cyril Roelandt <tipecaml@gmail.com>
To: guix-devel@gnu.org
Subject: [PATCH] coreutils: fix test suite
Date: Fri,  7 Mar 2014 00:49:55 +0100	[thread overview]
Message-ID: <1394149795-30135-1-git-send-email-tipecaml@gmail.com> (raw)
In-Reply-To: <87y50ouvgk.fsf@gnu.org>

* gnu/packages/patches/coreutils-skip-nohup.patch: patch taken from the git
  repository of coreutils, that makes sure tests/misc/nohup.sh does not fail
  when /dev/tty does not exist.
* gnu/packages/base.scm (coreutils): use it.
* gnu-system.am (dist_patch_DATA): add it.
---
 gnu-system.am                                   |  1 +
 gnu/packages/base.scm                           |  4 +++-
 gnu/packages/patches/coreutils-skip-nohup.patch | 28 +++++++++++++++++++++++++
 3 files changed, 32 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/coreutils-skip-nohup.patch

diff --git a/gnu-system.am b/gnu-system.am
index b5be893..97dc92c 100644
--- a/gnu-system.am
+++ b/gnu-system.am
@@ -252,6 +252,7 @@ dist_patch_DATA =						\
   gnu/packages/patches/cdparanoia-fpic.patch			\
   gnu/packages/patches/cmake-fix-tests.patch			\
   gnu/packages/patches/coreutils-dummy-man.patch		\
+  gnu/packages/patches/coreutils-skip-nohup.patch		\
   gnu/packages/patches/cpio-gets-undeclared.patch		\
   gnu/packages/patches/curl-fix-test172.patch			\
   gnu/packages/patches/dbus-localstatedir.patch			\
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index f828f35..89d90c9 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -240,7 +240,9 @@ used to apply commands with arbitrarily long arguments.")
             (sha256
              (base32
               "04hjzzv434fb8ak3hh3dyhdvg3hqjjwvjmjxqzk1gh2jh6cr8gjv"))
-            (patches (list (search-patch "coreutils-dummy-man.patch")))))
+            (patches (list (search-patch "coreutils-dummy-man.patch")
+                           ;; TODO: remove this patch for >= 8.23
+                           (search-patch "coreutils-skip-nohup.patch")))))
    (build-system gnu-build-system)
    (inputs `(("acl"  ,acl)                        ; TODO: add SELinux
              ("gmp"  ,gmp)))
diff --git a/gnu/packages/patches/coreutils-skip-nohup.patch b/gnu/packages/patches/coreutils-skip-nohup.patch
new file mode 100644
index 0000000..f5283a6
--- /dev/null
+++ b/gnu/packages/patches/coreutils-skip-nohup.patch
@@ -0,0 +1,28 @@
+commit 5dce6bdfafc930dfd17d5d16aea7d1add3472066
+Author: Pádraig Brady <P@draigBrady.com>
+Date:   Wed Mar 5 15:14:07 2014 +0000
+
+    tests: fix false failure in nohup.sh in non tty builds
+    
+    * tests/misc/nohup.sh: When running tests without a controlling tty,
+    an exec failure is triggered in a subshell, which causes POSIX
+    shells to immediately exit the subshell.  This was brought
+    to notice by the newly conforming bash 4.3.
+    Fixes http:/bugs.gnu.org/16940
+
+diff --git a/tests/misc/nohup.sh b/tests/misc/nohup.sh
+index 6d2b515..2328b43 100755
+--- a/tests/misc/nohup.sh
++++ b/tests/misc/nohup.sh
+@@ -63,6 +63,11 @@ rm -f nohup.out err
+ # to stderr must be fatal.  Requires stdout to be terminal.
+ if test -w /dev/full && test -c /dev/full; then
+ (
++  # POSIX shells immediately exit the subshell on exec error.
++  # So check we can write to /dev/tty before the exec, which
++  # isn't possible if we've no controlling tty for example.
++  test -c /dev/tty && >/dev/tty || exit 0
++
+   exec >/dev/tty
+   test -t 1 || exit 0
+   nohup echo hi 2> /dev/full
-- 
1.8.4.rc3

  reply	other threads:[~2014-03-06 23:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-04  9:35 core-updates: coreutils: FAIL: tests/misc/nohup Nikita Karetnikov
2014-03-04 13:36 ` Cyril Roelandt
2014-03-04 17:10   ` Ludovic Courtès
2014-03-05 21:24     ` Cyril Roelandt
2014-03-05 22:33       ` Ludovic Courtès
2014-03-06 23:49         ` Cyril Roelandt [this message]
2014-03-07  8:50           ` [PATCH] coreutils: fix test suite Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1394149795-30135-1-git-send-email-tipecaml@gmail.com \
    --to=tipecaml@gmail.com \
    --cc=guix-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).