From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cyril Roelandt Subject: [PATCH] coreutils: fix test suite Date: Fri, 7 Mar 2014 00:49:55 +0100 Message-ID: <1394149795-30135-1-git-send-email-tipecaml@gmail.com> References: <87y50ouvgk.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35899) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLi8q-00028Y-9h for guix-devel@gnu.org; Thu, 06 Mar 2014 18:56:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WLi8l-0001vM-QJ for guix-devel@gnu.org; Thu, 06 Mar 2014 18:55:56 -0500 Received: from mail-we0-x22d.google.com ([2a00:1450:400c:c03::22d]:35363) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WLi8l-0001vF-Is for guix-devel@gnu.org; Thu, 06 Mar 2014 18:55:51 -0500 Received: by mail-we0-f173.google.com with SMTP id w61so4035815wes.4 for ; Thu, 06 Mar 2014 15:55:49 -0800 (PST) In-Reply-To: <87y50ouvgk.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: guix-devel@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 +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