From MAILER-DAEMON Fri Apr 01 00:00:40 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1alqGG-0003PB-E9
	for mharc-coreutils@gnu.org; Fri, 01 Apr 2016 00:00:40 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:55654)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1alqGC-0003Oi-CP
	for coreutils@gnu.org; Fri, 01 Apr 2016 00:00:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1alqG8-000462-Ao
	for coreutils@gnu.org; Fri, 01 Apr 2016 00:00:36 -0400
Received: from mail-qg0-x22f.google.com ([2607:f8b0:400d:c04::22f]:35253)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1alqG7-000457-Rb
	for coreutils@gnu.org; Fri, 01 Apr 2016 00:00:32 -0400
Received: by mail-qg0-x22f.google.com with SMTP id y89so86285946qge.2
	for <coreutils@gnu.org>; Thu, 31 Mar 2016 21:00:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:subject:message-id:date:to:mime-version;
	bh=+IbX7sPTpadNLQcgSOf56ZHNTdo9gqDknfT6GA/tNB4=;
	b=q2qsaFdoONwXy0ktV2wDuTDS4MtfhU09YyyfX3E03ajaXndKUQh4A6Jntx1X8RqRY+
	/HgBerVnvmJcisp3R6dhQPqHIXKBZhtEHbj3UL3e/PulFO3Qz+sVEDt3+FaUsukijEDr
	gORmi8tcKwWnaGPxNNleBjSsbkSt0lGvutQpurl73ldnvP8eBgIkxIUNf/u+h1bsVAPI
	AZMXGFJyJpbS1+DANt67Cfcpy1ZAtefoQHokjHeujUAY87ASr3GuTXrWDnh6+0Y4TKHr
	qct7aDBh7pKqbbabLZbGwPS4nxt5HZr7F6zgneNkXYoa6XT37PxTkCgIZdBK79hj75ac
	6vtA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:subject:message-id:date:to:mime-version;
	bh=+IbX7sPTpadNLQcgSOf56ZHNTdo9gqDknfT6GA/tNB4=;
	b=TzjNmk6kYi1vDFUaXYxbu4AN0+4YFUUKjPA28h6U11H4Z+jT6xY4Tg6PBWydOAQjbo
	g0d+tNMOM0y/R1IpjLkh3hBPUIQItYtLhGs546XvOr8lemOxzdplllixFNg2kns/RCb0
	jvClvAhspoCBdMr+0VTcK8rnVTMoZaHGlRxWIHs4EvjVBjUplpGk9N/3vnlAHzn+ux17
	Tnku2dTSuLftd1tsaN7B/53/MIQCS8Ff+0UzEoZhcuQU3OeRNKzLQf/s1tjOz4thsApE
	PIwXPEi6Zytop3r6/VYUCutF2zYtzUk/6tVBp8SbBoEsHMXuF1WlYvLq/Tw+q2WC4irc
	dAEw==
X-Gm-Message-State: AD7BkJI3oQaVJFUoxIE403ugNipAzUPOWEVTrug4gAEs1XWyrm5kSTtzPK7HR+isO65E6A==
X-Received: by 10.140.23.18 with SMTP id 18mr5389748qgo.91.1459483230840;
	Thu, 31 Mar 2016 21:00:30 -0700 (PDT)
Received: from ix.home (pool-100-38-105-55.nycmny.fios.verizon.net.
	[100.38.105.55]) by smtp.gmail.com with ESMTPSA id
	y206sm5332450qhc.0.2016.03.31.21.00.29 for <coreutils@gnu.org>
	(version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
	Thu, 31 Mar 2016 21:00:29 -0700 (PDT)
From: Assaf Gordon <assafgordon@gmail.com>
Content-Type: multipart/mixed;
	boundary="Apple-Mail=_FC5B7AFA-B561-46F6-9838-ABB055A66DD9"
Subject: minor test failures on Alpine linux (linux kernel + musl libc +
	busybox utils)
Message-Id: <41580611-09E0-4A36-B456-D9AC4452F2A8@gmail.com>
Date: Fri, 1 Apr 2016 00:00:28 -0400
To: Coreutils <coreutils@gnu.org>
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\))
X-Mailer: Apple Mail (2.2102)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2607:f8b0:400d:c04::22f
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 01 Apr 2016 04:00:38 -0000


--Apple-Mail=_FC5B7AFA-B561-46F6-9838-ABB055A66DD9
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=utf-8

Hello,

I'm experimenting with testing coreutils on Alpine Linux ( =
https://alpinelinux.org/ ).
Alpine is a lightweight Linux-based system, with musl libc and busybox =
utilities - so not very GNU-like, and possibly not POSIX compliant.
These minor failures are obviously not a priority, but I suspect such =
systems will become more common in the future (due to usage in small VMs =
/ containers). Most of them are problems with the tests, not with the =
programs.

I'll provide brief notes here, with more details in the attachments.

The failures are:
 FAIL: tests/ln/sf-1.sh
 FAIL: tests/misc/help-version.sh
 FAIL: tests/misc/sort-debug-warn.sh
 FAIL: tests/misc/wc-files0.sh

=3D=3D=3D tests/misc/help-version.sh =3D=3D=3D

This fails because musk-libc disables the UTMP mechanism on purpose:
  =
http://wiki.musl-libc.org/wiki/FAQ#Q:_why_is_the_utmp.2Fwtmp_functionality=
_only_implemented_as_stubs_.3F

The file 'utmp.h' contains:
  $ cat /usr/include/utmp.h
  [...]
  #define _PATH_UTMP "/dev/null/utmp"
  #define _PATH_WTMP "/dev/null/wtmp"
  #define UTMP_FILE _PATH_UTMP
  #define WTMP_FILE _PATH_WTMP
  #define UTMP_FILENAME _PATH_UTMP
  #define WTMP_FILENAME _PATH_WTMP

which means that 'readutmp.m4' passes all the normal detection checks, =
but the compiled 'pinky' and 'who' use the hard-coded (and non-existing) =
file:
   $ ./src/pinky
   ./src/pinky: /dev/null/utmp: Not a directory
   $ ./src/who
   ./src/who: /dev/null/utmp: Not a directory

Perhaps additional checks be made in 'readutmp.m4', or alternatively =
skip 'pinky' tests if the file is invalid?



=3D=3D=3D tests/ln/sf-1.sh =3D=3D=3D

fails because of (non-portable?) printf usage:

    + printf %0*d 256 0
    ash: %0*d: invalid format

The attached patch replaces the printf usage into a more portable one.
(an alternative would be to use 'env printf' invoking coreutils' printf, =
but other tests use the built-in printf with embedded "%${size}d" =
syntax).

regarding the portability of "*" in printf, the POSIX page says:
http://pubs.opengroup.org/onlinepubs/9699919799/utilities/printf.html

  APPLICATION USAGE
  [..]
  No provision is made in this volume of POSIX.1-2008 which allows field =
widths and precisions to=20
  be specified as '*' since the '*' can be replaced directly in the =
format operand using shell
  variable substitution. Implementations can also provide this feature =
as an extension if they so choose.





=3D=3D=3D tests/misc/wc-files0.sh =3D=3D=3D

This fails because the "expected" output file is generated using the =
$'\t' syntax,
and it seems BusyBox ash does not support it (if I read the log =
correctly):

The test script has:

   printf '%s\n' "0 0 0 '1'$'\\n''2'" > exp || framework_failure_

And the failure log has:

   + diff -u exp out
   --- exp
   +++ out
   @@ -1 +1 @@
   -0 0 0 '1''\n''2'
   +0 0 0 '1'$'\n''2'
   + fail=3D1

The attached 'alp-bug-shell-dollar-sign.txt' gives example of the syntax =
on few shells, it seems ASH is the exception.



=3D=3D=3D tests/misc/sort-debug-warn.sh =3D=3D=3D

The failure is in the last debug message.
The expected message is for an invalid forced locale, but musl-libc =
seems to accept the invalid locale:

   + diff -u exp out
   --- exp
   +++ out
   @@ -29,4 +29,4 @@
    sort: using simple byte comparison
    sort: using simple byte comparison
    sort: using simple byte comparison
   -sort: failed to set locale; using simple byte comparison
   +sort: using =E2=80=98missing=E2=80=99 sorting rules
   + fail=3D1

The flow is:
1. 'LC_ALL=3Dmissing sort --debug ...' calls 'hard_locale()'
2. most libc implementations return 'C' for invalid locales, thus =
'hard_locale' returns false.
3. musl-libc implementation return 'missing' and 'hard_locale' returns =
true.
4. the incorrect debug message is printed.

The attached 'alp-bug-LC-ALL-missing.txt' contains a tiny C program to =
demonstrate this, with results from several libc implementations.



Comments welcomed. I'm happy to test things further if needed.

regards,
 - assaf


--Apple-Mail=_FC5B7AFA-B561-46F6-9838-ABB055A66DD9
Content-Disposition: attachment;
	filename=0001-tests-avoid-non-portable-printf.patch
Content-Type: application/octet-stream;
	name="0001-tests-avoid-non-portable-printf.patch"
Content-Transfer-Encoding: quoted-printable

=46rom=20316104f3b85c58bc0897470b19168ea1d12c37cd=20Mon=20Sep=2017=20=
00:00:00=202001=0AFrom:=20Assaf=20Gordon=20<assafgordon@gmail.com>=0A=
Date:=20Thu,=2031=20Mar=202016=2023:07:57=20-0400=0ASubject:=20[PATCH]=20=
tests:=20avoid=20non-portable=20printf=0A=0A*=20tests/ln/sf-1.sh:=20=
avoid=20using=20'%0*d'=20in=20printf,=20as=20this=20is=20not=0A=20=20=
supported=20on=20some=20built-in=20shell=20implementations=20(e.g.=20=
Busybox=20ash).=0A---=0A=20tests/ln/sf-1.sh=20|=202=20+-=0A=201=20file=20=
changed,=201=20insertion(+),=201=20deletion(-)=0A=0Adiff=20--git=20=
a/tests/ln/sf-1.sh=20b/tests/ln/sf-1.sh=0Aindex=20ccf91a2..b6eb19f=20=
100755=0A---=20a/tests/ln/sf-1.sh=0A+++=20b/tests/ln/sf-1.sh=0A@@=20=
-35,7=20+35,7=20@@=20esac=0A=20#=20coreutils-8.22=20would=20fail=20to=20=
replace=20{ENOTDIR,ELOOP,ENAMETOOLONG}_link=20below.=0A=20=
name_max_plus1=3D$(expr=20$(stat=20-f=20-c=20%l=20.)=20+=201)=0A=20test=20=
$name_max_plus1=20-gt=201=20||=20skip_=20'Error=20determining=20=
NAME_MAX'=0A-long_name=3D$(printf=20'%0*d'=20$name_max_plus1=200)=0A=
+long_name=3D$(printf=20"%0${name_max_plus1}d"=200)=0A=20for=20f=20in=20=
''=20f;=20do=0A=20=20=20ln=20-s$f=20missing=20ENOENT_link=20||=20fail=3D1=0A=
=20=20=20ln=20-s$f=20a/b=20ENOTDIR_link=20||=20fail=3D1=0A--=20=0A1.9.1=0A=
=0A=

--Apple-Mail=_FC5B7AFA-B561-46F6-9838-ABB055A66DD9
Content-Disposition: attachment;
	filename=alp-bug-LC-ALL-missing.txt
Content-Type: text/plain;
	name="alp-bug-LC-ALL-missing.txt"
Content-Transfer-Encoding: quoted-printable

/*
 Test 'setlocale()' behaviour.
 Copyright (C) 2016 Assaf Gordon
 license: GNU All permissive license.
=20
 compile:
    cc -o print-locale print-locale.c
 test:
    ./print-locale
    LC_ALL=3DC ./print-locale
    LC_ALL=3Dmissing ./print-locale
*/
#include <locale.h>
#include <stdlib.h>
#include <stdio.h>

int main(void)
{
  char* p =3D getenv("LC_ALL");
  printf("LC_ALL env var =3D '%s'\n", p?p:"(NULL)");

  p =3D setlocale(LC_ALL,"");
  printf("setlocale(LC_ALL,\"\") =3D '%s'\n", p?p:"(NULL)");
 =20
  p =3D setlocale(LC_ALL,NULL);
  printf("LC_ALL from setlocale =3D '%s'\n", p?p:"(NULL)");

  p =3D setlocale(LC_COLLATE,NULL);
  printf("LC_COLLATE from setlocale =3D '%s'\n", p?p:"(NULL)");

  return 0;
}

=3D=3D=3D=3D glibc (Ubuntu) =3D=3D=3D=3D

$ ./print-locale=20
LC_ALL env var =3D '(NULL)'
setlocale(LC_ALL,"") =3D 'en_US.UTF-8'
LC_ALL from setlocale =3D 'en_US.UTF-8'
LC_COLLATE from setlocale =3D 'en_US.UTF-8'

$ LC_ALL=3DC ./print-locale=20
LC_ALL env var =3D 'C'
setlocale(LC_ALL,"") =3D 'C'
LC_ALL from setlocale =3D 'C'
LC_COLLATE from setlocale =3D 'C'

$ LC_ALL=3Dmissing ./print-locale=20
LC_ALL env var =3D 'missing'
setlocale(LC_ALL,"") =3D '(NULL)'
LC_ALL from setlocale =3D 'C'
LC_COLLATE from setlocale =3D 'C'


=3D=3D=3D=3D musl libc =3D=3D=3D=3D=3D=3D=3D

$ ./print-locale
LC_ALL env var =3D '(NULL)'
setlocale(LC_ALL,"") =3D 'C.UTF-8;C;C;C;C;C'
LC_ALL from setlocale =3D 'C.UTF-8;C;C;C;C;C'
LC_COLLATE from setlocale =3D 'C'

$ LC_ALL=3Dc ./print-locale
LC_ALL env var =3D 'C'
setlocale(LC_ALL,"") =3D 'C;C;C;C;C;C'
LC_ALL from setlocale =3D 'C;C;C;C;C;C'
LC_COLLATE from setlocale =3D 'C'

$ LC_ALL=3Dmissing ./print-locale
LC_ALL env var =3D 'missing'
setlocale(LC_ALL,"") =3D =
'missing;missing;missing;missing;missing;missing'
LC_ALL from setlocale =3D =
'missing;missing;missing;missing;missing;missing'
LC_COLLATE from setlocale =3D 'missing'

=3D=3D=3D=3D FreeBSD =3D=3D=3D=3D=20

$ ./print-locale
LC_ALL env var =3D '(NULL)'
setlocale(LC_ALL,"") =3D 'C'
LC_ALL from setlocale =3D 'C'
LC_COLLATE from setlocale =3D 'C'

$ LC_ALL=3DC ./print-locale
LC_ALL env var =3D 'C'
setlocale(LC_ALL,"") =3D 'C'
LC_ALL from setlocale =3D 'C'
LC_COLLATE from setlocale =3D 'C'

$ LC_ALL=3Dmissing ./print-locale
LC_ALL env var =3D 'missing'
setlocale(LC_ALL,"") =3D '(NULL)'
LC_ALL from setlocale =3D 'C'
LC_COLLATE from setlocale =3D 'C'


=3D=3D=3D=3D OpenBSD =3D=3D=3D=3D

$ ./print-locale                                                         =
     =20
LC_ALL env var =3D '(NULL)'
setlocale(LC_ALL,"") =3D 'C'
LC_ALL from setlocale =3D 'C'
LC_COLLATE from setlocale =3D 'C'

$ LC_ALL=3DC ./print-locale                                              =
       =20
LC_ALL env var =3D 'C'
setlocale(LC_ALL,"") =3D 'C'
LC_ALL from setlocale =3D 'C'
LC_COLLATE from setlocale =3D 'C'

$ LC_ALL=3Dmissing ./print-locale
LC_ALL env var =3D 'missing'
setlocale(LC_ALL,"") =3D 'C/missing/C/C/C/C'
LC_ALL from setlocale =3D 'C/missing/C/C/C/C'
LC_COLLATE from setlocale =3D 'C'

--Apple-Mail=_FC5B7AFA-B561-46F6-9838-ABB055A66DD9
Content-Disposition: attachment;
	filename=alp-bug-shell-dollar-sign.txt
Content-Type: text/plain;
	name="alp-bug-shell-dollar-sign.txt"
Content-Transfer-Encoding: 7bit

BusyBox's ash:
    $ echo a$'\t'b
    a       b
    $ echo "a$'\t'b"
    a'\t'b

Bash:
    $ echo a$'\t'b
    a       b
    $ echo "a$'\t'b"
    a$'\t'b

zsh:
    % echo a$'\t'b
    a       b
    % echo "a$'\t'b"
    a$'     'b

ksh on Ubuntu (mksh: MirBSD Korn Shell v46):
    $ echo a$'\t'b
    a       b
    $ echo "a$'\t'b"
    a$'     'b

FreeBSD 10.1 default bourne sh
    $ echo a$'\t'b
    a       b
    $ echo "a$'\t'b"
    a$'\t'b

ksh on OpenBSD 5.8 (KSH v5.2.14 99/07/13.2)
    $ echo a$'\t'b
    a$      b
    $ echo "a$'\t'b"
    a$'     'b


--Apple-Mail=_FC5B7AFA-B561-46F6-9838-ABB055A66DD9
Content-Disposition: attachment;
	filename=alpine-test-suite.log.xz
Content-Type: application/octet-stream;
	name="alpine-test-suite.log.xz"
Content-Transfer-Encoding: base64

/Td6WFoAAATm1rRGAgAhARYAAAB0L+Wj4VRUHeJdAB7uSgoQ6nC0252FNu5Nn4GX8PZUCgcDxym0
MvM4dBDLXdh1X77AH5IKdzy+tK+ID3u0lGpsLQ0ZTxWuV60YKX3kPIQwkJtwJf3/oHukBlDVErkX
bMXDwEBCA8KjpuQ5t61b1ALCNcOjt9Wyj1jiIUP5PKem1LzF1kcd/R7ZbGYoOA20bTHnCJ8F1mSI
ig3S4zXnrjv6agMBdezFC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7/Yxuiclq29AOvcVvJ2PGYEOw6mXKUJef0n8bf7PuRF6jwVjK70q9kJnVb7i
xNWug7l5A9z5eyZFLp4OkU4FW7a8EvL8S/DnpPCTSNHQ1szeZ+aohbRLBR1kS4ZRxvLMaxKBJkcH
rxTr9V+ioBxLCHgB6yfj7SjpkpUr9cqpJwMfnGSAIMp/x01zrDpKjMy6vIpYBmoyIjzqnyhHydid
9Z0xg43zLuw7frWLR7sSGfH4qyO8//d9Sjm3pu2XN1Wom9SMlvv4AWPw3LRAIHTWq79DRssLkofi
XRNijnBEs3RqTQcqPqpXDmLSDf39Da8wCeQsY5/S1b4g8XqyZzclVHY+l8xqmHIUFhk3y6trtsQX
oFVFnftiL9sIcqzXW5gw93f1UJKQ072BAO+zwziPYE+rQ4UoVVo0mMhG9gAAAOUdJY0jeXgWAAH+
O9WoBQAVlKqBscRn+wIAAAAABFla
--Apple-Mail=_FC5B7AFA-B561-46F6-9838-ABB055A66DD9
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=us-ascii




--Apple-Mail=_FC5B7AFA-B561-46F6-9838-ABB055A66DD9--


From MAILER-DAEMON Fri Apr 01 06:16:11 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1alw7f-0001gI-5e
	for mharc-coreutils@gnu.org; Fri, 01 Apr 2016 06:16:11 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:49174)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <siadat@gmail.com>) id 1alw7b-0001fT-Jq
	for coreutils@gnu.org; Fri, 01 Apr 2016 06:16:09 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <siadat@gmail.com>) id 1alw7a-0004Xf-38
	for coreutils@gnu.org; Fri, 01 Apr 2016 06:16:07 -0400
Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]:36001)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <siadat@gmail.com>) id 1alw7Z-0004Xb-OG
	for coreutils@gnu.org; Fri, 01 Apr 2016 06:16:06 -0400
Received: by mail-wm0-x230.google.com with SMTP id 127so14664873wmu.1
	for <coreutils@gnu.org>; Fri, 01 Apr 2016 03:16:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:reply-to:in-reply-to:references:date:message-id
	:subject:from:to;
	bh=ZV9ndsWnCus7tA5pqy+LXva0BHkIHLoQHMD2DLmdB8U=;
	b=psMhy3nNW3Ij4EQNcJXU9ATkPUZ5f01kBNwI12QQdAK0+5ns8BhURFtK/mGDCeU/oL
	N5Azl6AmU+RZEVhzFqmp+o5mQck/zDq6JUnjPX1v56TCmABKtBa5XvGrTi7WpBXZ4HRd
	kAwma2WSeoL0bXVU/mMkFHVlLxUZIVRqcX1nK6n5L9LH9mn7XNBxSE4ZFl5atPK9i3RI
	KBSAyXu4me4jQqkZgqy8iZZ1eSSnsbwYE7LSV+J9ntLgM8BG73gTWecyrzAVM98BqrhM
	aJLhjy/fVcCLHwqMTZviZqGS8y6JYe7geEwV1/gy/2xav7oAXzlodUuK+QHkawYWO/Z3
	biZQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:mime-version:reply-to:in-reply-to:references
	:date:message-id:subject:from:to;
	bh=ZV9ndsWnCus7tA5pqy+LXva0BHkIHLoQHMD2DLmdB8U=;
	b=eJCVuirsDq1CbpdCVbMFZovWJtHDOJRNUkZDNyt2suPt8CBYMXVTE9SGV4TRcv6bFR
	VSR0VL4kDKJPm/p0CQpujD+HuukDnWq3P2qNKSKE881cpo94WZ7o/3mObcfrhXB1OPJK
	G9qc1TDmlWVXC91NTtDccZqqkAy5AilAhJ/jFu6dg39gJOIoMgNUG7s96Xnh9ICLFfT0
	MfSUmCziCLJmfJEIjIOp/Z4/AcmA2b0agsKTXXlR1HyjNz++wsvd9OB3k3/kkloAJGdL
	+/cvmex2g83Fucikaf9tjxbq5qiWO0pNTLBusNs/ooUFrOuxoHenvlV/C2HXXSQyqdaY
	DKlg==
X-Gm-Message-State: AD7BkJINDBLMFgVZflC5fQ2VVSePOxOXSeJtykRmJzjLAfOukwVaIcxGEY6mAurxtPWad6AsDh/tGyBBz3aTcQ==
MIME-Version: 1.0
X-Received: by 10.28.234.151 with SMTP id g23mr2952342wmi.40.1459505764605;
	Fri, 01 Apr 2016 03:16:04 -0700 (PDT)
Received: by 10.194.164.135 with HTTP; Fri, 1 Apr 2016 03:16:04 -0700 (PDT)
In-Reply-To: <20160311132236.GB4797@chaz.gmail.com>
References: <56e29626.04371c0a.9ea5f.73c1@mx.google.com>
	<56E2BB4D.8060500@draigBrady.com>
	<20160311132236.GB4797@chaz.gmail.com>
Date: Fri, 1 Apr 2016 14:46:04 +0430
Message-ID: <CABjNzKFEmV=nVk-9vxQi88fgSz3NhG6zN=MM6ryU12JyhOkL=g@mail.gmail.com>
Subject: Re: [PATCH] wc: add -v option to print total counts every second.
From: Sina Siadat <siadat@gmail.com>
To: Stephane Chazelas <stephane.chazelas@gmail.com>,
	=?UTF-8?Q?P=C3=A1draig_Brady?= <P@draigbrady.com>, 
	coreutils <coreutils@gnu.org>
Content-Type: text/plain; charset=UTF-8
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2a00:1450:400c:c09::230
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: siadat@gmail.com
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 01 Apr 2016 10:16:09 -0000

I am sorry for the long delay. Thank you very much for your feedbacks.
I updated the patch to implement what you suggested. The flag is
renamed to --progress[=SECONDS].

>Also note that  you have to choose between bytes and lines, you
>can't have both, that's really two different modes of operations.

I didn't exactly get this part. Does this mean that we cannot show the
counting progress for both lines and bytes? Chars is always zero in
the this patch, but progress for lines and bytes (-l -c) seem to be
working. Please correct me if I'm wrong :).

>Adding timer capability to awk could be another approach.

That sounds interesting! Could you give an example of how you would go
about implementing that? An example usage would be great.

Below is the updated patch with --progress[=SECONDS]:

 src/wc.c | 148 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 129 insertions(+), 19 deletions(-)

diff --git a/src/wc.c b/src/wc.c
index 94cbaff..43653cf 100644
--- a/src/wc.c
+++ b/src/wc.c
@@ -37,6 +37,8 @@
 #include "stat-size.h"
 #include "xfreopen.h"

+#include "xdectoint.h"
+
 #if !defined iswspace && !HAVE_ISWSPACE
 # define iswspace(wc) \
     ((wc) == to_uchar (wc) && isspace (to_uchar (wc)))
@@ -60,9 +62,17 @@ static uintmax_t total_chars;
 static uintmax_t total_bytes;
 static uintmax_t max_line_length;

+static uintmax_t progress_total_lines;
+static uintmax_t progress_total_words;
+static uintmax_t progress_total_chars;
+static uintmax_t progress_total_bytes;
+static uintmax_t progress_max_line_length;
+
 /* Which counts to print. */
 static bool print_lines, print_words, print_chars, print_bytes;
 static bool print_linelength;
+static bool print_progress;
+static uintmax_t progress_interval_seconds;

 /* The print width of each count.  */
 static int number_width;
@@ -85,7 +95,8 @@ struct fstatus
    non-character as a pseudo short option, starting with CHAR_MAX + 1.  */
 enum
 {
-  FILES0_FROM_OPTION = CHAR_MAX + 1
+  FILES0_FROM_OPTION = CHAR_MAX + 1,
+  PROGRESS_OPTION = CHAR_MAX + 2
 };

 static struct option const longopts[] =
@@ -96,6 +107,7 @@ static struct option const longopts[] =
   {"words", no_argument, NULL, 'w'},
   {"files0-from", required_argument, NULL, FILES0_FROM_OPTION},
   {"max-line-length", no_argument, NULL, 'L'},
+  {"progress", optional_argument, NULL, PROGRESS_OPTION},
   {GETOPT_HELP_OPTION_DECL},
   {GETOPT_VERSION_OPTION_DECL},
   {NULL, 0, NULL, 0}
@@ -135,6 +147,7 @@ the following order: newline, word, character,
byte, maximum line length.\n\
                            If F is - then read names from standard input\n\
   -L, --max-line-length  print the maximum display width\n\
   -w, --words            print the word counts\n\
+  --progress[=SECONDS]   print the counts every SECONDS (default is 1)\n\
 "), stdout);
       fputs (HELP_OPTION_DESCRIPTION, stdout);
       fputs (VERSION_OPTION_DESCRIPTION, stdout);
@@ -143,10 +156,11 @@ the following order: newline, word, character,
byte, maximum line length.\n\
   exit (status);
 }

-/* FILE is the name of the file (or NULL for standard input)
+/* file is the name of the file (or NULL for standard input)
    associated with the specified counters.  */
 static void
-write_counts (uintmax_t lines,
+write_counts (FILE * restrict stream,
+              uintmax_t lines,
               uintmax_t words,
               uintmax_t chars,
               uintmax_t bytes,
@@ -159,31 +173,70 @@ write_counts (uintmax_t lines,

   if (print_lines)
     {
-      printf (format_int, number_width, umaxtostr (lines, buf));
+      fprintf (stream, format_int, number_width, umaxtostr (lines, buf));
       format_int = format_sp_int;
     }
   if (print_words)
     {
-      printf (format_int, number_width, umaxtostr (words, buf));
+      fprintf (stream, format_int, number_width, umaxtostr (words, buf));
       format_int = format_sp_int;
     }
   if (print_chars)
     {
-      printf (format_int, number_width, umaxtostr (chars, buf));
+      fprintf (stream, format_int, number_width, umaxtostr (chars, buf));
       format_int = format_sp_int;
     }
   if (print_bytes)
     {
-      printf (format_int, number_width, umaxtostr (bytes, buf));
+      fprintf (stream, format_int, number_width, umaxtostr (bytes, buf));
       format_int = format_sp_int;
     }
   if (print_linelength)
     {
-      printf (format_int, number_width, umaxtostr (linelength, buf));
+      fprintf (stream, format_int, number_width, umaxtostr (linelength, buf));
     }
   if (file)
-    printf (" %s", strchr (file, '\n') ? quotef (file) : file);
-  putchar ('\n');
+    fprintf (stream, " %s", strchr (file, '\n') ? quotef (file) : file);
+}
+
+static void
+write_counts_progress (int signum)
+{
+  if (isatty (STDERR_FILENO))
+    fprintf (stderr, "\r");
+
+  write_counts (stderr, progress_total_lines, progress_total_words,
+                progress_total_chars, progress_total_bytes,
progress_max_line_length, NULL);
+
+  if (isatty (STDERR_FILENO))
+    fflush (stderr);
+  else
+    fprintf (stderr, "\n");
+
+  alarm (progress_interval_seconds);
+}
+
+static void
+write_counts_final (uintmax_t lines,
+                    uintmax_t words,
+                    uintmax_t chars,
+                    uintmax_t bytes,
+                    uintmax_t linelength,
+                    const char *file)
+{
+  if (print_progress) {
+      if (isatty (STDERR_FILENO))
+        fprintf (stderr, "\r");
+
+      /* Update the counts for the final time, if stdout is not a tty.  */
+      if (!isatty (STDOUT_FILENO)) {
+          write_counts_progress (0);
+          fprintf (stderr, "\n");
+      }
+  }
+
+  write_counts (stdout, lines, words, chars, bytes, linelength, file);
+  fprintf (stdout, "\n");
 }

 /* Count words.  FILE_X is the name of the file (or NULL for standard
@@ -249,7 +302,10 @@ wc (int fd, char const *file_x, struct fstatus
*fstatus, off_t current_pos)
             current_pos = lseek (fd, 0, SEEK_CUR);
           if (0 <= current_pos && current_pos < hi_pos
               && 0 <= lseek (fd, hi_pos, SEEK_CUR))
-            bytes = hi_pos - current_pos;
+            {
+              bytes = hi_pos - current_pos;
+              progress_total_bytes = bytes;
+            }
         }

       fdadvise (fd, 0, 0, FADVISE_SEQUENTIAL);
@@ -262,6 +318,7 @@ wc (int fd, char const *file_x, struct fstatus
*fstatus, off_t current_pos)
               break;
             }
           bytes += bytes_read;
+          progress_total_bytes += bytes_read;
         }
     }
   else if (!count_chars && !count_complicated)
@@ -279,6 +336,7 @@ wc (int fd, char const *file_x, struct fstatus
*fstatus, off_t current_pos)
             }

           bytes += bytes_read;
+          progress_total_bytes += bytes_read;

           char *p = buf;
           char *end = p + bytes_read;
@@ -288,7 +346,12 @@ wc (int fd, char const *file_x, struct fstatus
*fstatus, off_t current_pos)
             {
               /* Avoid function call overhead for shorter lines.  */
               while (p != end)
-                lines += *p++ == '\n';
+                {
+                  if (*p++ == '\n') {
+                      lines ++;
+                      progress_total_lines ++;
+                  }
+                }
             }
           else
             {
@@ -297,6 +360,7 @@ wc (int fd, char const *file_x, struct fstatus
*fstatus, off_t current_pos)
                 {
                   ++p;
                   ++lines;
+                  ++progress_total_lines;
                 }
             }

@@ -347,6 +411,7 @@ wc (int fd, char const *file_x, struct fstatus
*fstatus, off_t current_pos)
             }

           bytes += bytes_read;
+          progress_total_bytes += bytes_read;
           p = buf;
           bytes_read += prev;
           do
@@ -396,15 +461,20 @@ wc (int fd, char const *file_x, struct fstatus
*fstatus, off_t current_pos)
               p += n;
               bytes_read -= n;
               chars++;
+              progress_total_chars++;
               switch (wide_char)
                 {
                 case '\n':
                   lines++;
+                  progress_total_lines++;
                   /* Fall through. */
                 case '\r':
                 case '\f':
                   if (linepos > linelength)
-                    linelength = linepos;
+                    {
+                      linelength = linepos;
+                      progress_max_line_length = linepos;
+                    }
                   linepos = 0;
                   goto mb_word_separator;
                 case '\t':
@@ -416,6 +486,7 @@ wc (int fd, char const *file_x, struct fstatus
*fstatus, off_t current_pos)
                 case '\v':
                 mb_word_separator:
                   words += in_word;
+                  progress_total_words += in_word;
                   in_word = false;
                   break;
                 default:
@@ -448,8 +519,12 @@ wc (int fd, char const *file_x, struct fstatus
*fstatus, off_t current_pos)
 # endif
         }
       if (linepos > linelength)
-        linelength = linepos;
+        {
+          linelength = linepos;
+          progress_max_line_length = linepos;
+        }
       words += in_word;
+      progress_total_words += in_word;
     }
 #endif
   else
@@ -468,17 +543,22 @@ wc (int fd, char const *file_x, struct fstatus
*fstatus, off_t current_pos)
             }

           bytes += bytes_read;
+          progress_total_bytes += bytes_read;
           do
             {
               switch (*p++)
                 {
                 case '\n':
                   lines++;
+                  progress_total_lines++;
                   /* Fall through. */
                 case '\r':
                 case '\f':
                   if (linepos > linelength)
-                    linelength = linepos;
+                    {
+                      linelength = linepos;
+                      progress_max_line_length = linepos;
+                    }
                   linepos = 0;
                   goto word_separator;
                 case '\t':
@@ -490,6 +570,7 @@ wc (int fd, char const *file_x, struct fstatus
*fstatus, off_t current_pos)
                 case '\v':
                 word_separator:
                   words += in_word;
+                  progress_total_words += in_word;
                   in_word = false;
                   break;
                 default:
@@ -506,14 +587,19 @@ wc (int fd, char const *file_x, struct fstatus
*fstatus, off_t current_pos)
           while (--bytes_read);
         }
       if (linepos > linelength)
-        linelength = linepos;
+        {
+          linelength = linepos;
+          progress_max_line_length = linepos;
+        }
       words += in_word;
+      progress_total_words += in_word;
     }

   if (count_chars < print_chars)
     chars = bytes;

-  write_counts (lines, words, chars, bytes, linelength, file_x);
+  progress_total_chars += chars;
+  write_counts_final (lines, words, chars, bytes, linelength, file_x);
   total_lines += lines;
   total_words += words;
   total_chars += chars;
@@ -665,6 +751,22 @@ main (int argc, char **argv)
         print_words = true;
         break;

+      case PROGRESS_OPTION:
+        print_progress = true;
+
+        if (optarg)
+          {
+            progress_interval_seconds = xdectoumax (optarg, 0, UINTMAX_MAX, "",
+                                                    _("invalid seconds"),
+                                                    0);
+            if (progress_interval_seconds < 1)
+              progress_interval_seconds = 1;
+          }
+        else
+          progress_interval_seconds = 1;
+
+        break;
+
       case 'L':
         print_linelength = true;
         break;
@@ -742,6 +844,14 @@ main (int argc, char **argv)
       ai = argv_iter_init_argv (files);
     }

+  if (print_progress)
+    {
+      struct sigaction action;
+      action.sa_handler = write_counts_progress;
+      sigaction (SIGALRM, &action, NULL);
+      alarm (progress_interval_seconds);
+    }
+
   if (!ai)
     xalloc_die ();

@@ -819,8 +929,8 @@ main (int argc, char **argv)
     readtokens0_free (&tok);

   if (1 < argv_iter_n_args (ai))
-    write_counts (total_lines, total_words, total_chars, total_bytes,
-                  max_line_length, _("total"));
+    write_counts_final (total_lines, total_words, total_chars, total_bytes,
+                        max_line_length, _("total"));

   argv_iter_free (ai);


From MAILER-DAEMON Fri Apr 01 13:35:33 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1am2yr-0007WT-OF
	for mharc-coreutils@gnu.org; Fri, 01 Apr 2016 13:35:33 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:60447)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1am2yp-0007VO-0z
	for coreutils@gnu.org; Fri, 01 Apr 2016 13:35:31 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1am2yj-0002vd-UR
	for coreutils@gnu.org; Fri, 01 Apr 2016 13:35:30 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:51061)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1am2yj-0002vS-O7
	for coreutils@gnu.org; Fri, 01 Apr 2016 13:35:25 -0400
Received: from localhost.localdomain (unknown [109.77.200.45])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id B34AD4A7F;
	Fri,  1 Apr 2016 18:35:23 +0100 (IST)
Subject: Re: minor test failures on Alpine linux (linux kernel + musl libc +
	busybox utils)
To: Assaf Gordon <assafgordon@gmail.com>, Coreutils <coreutils@gnu.org>
References: <41580611-09E0-4A36-B456-D9AC4452F2A8@gmail.com>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <56FEB15B.1020609@draigBrady.com>
Date: Fri, 1 Apr 2016 18:35:23 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <41580611-09E0-4A36-B456-D9AC4452F2A8@gmail.com>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 82.195.144.49
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 01 Apr 2016 17:35:31 -0000

On 01/04/16 05:00, Assaf Gordon wrote:
>     -sort: failed to set locale; using simple byte comparison
>     +sort: using =91missing=92 sorting rules
>     + fail=3D1

I'd report that to musl.
It's so easy to typo locales and their differences can be subtle,
that early diagnosis is better.

We can work around it in the test of course, with a skip.
It would be useful to have a WARN returns for tests to
indicate issue with the system rather than with coreutils.

 >
 > =3D=3D=3D tests/misc/wc-files0.sh =3D=3D=3D
 >
 > This fails because the "expected" output file is
 > generated using the $'\t' syntax,

Well not exactly as it's within "".
We probably just need to do \$ here.

thanks for testing!
P=E1draig


From MAILER-DAEMON Mon Apr 04 01:18:13 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1amwtx-0007hC-FJ
	for mharc-coreutils@gnu.org; Mon, 04 Apr 2016 01:18:13 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:59097)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1amwtv-0007fH-Dh
	for coreutils@gnu.org; Mon, 04 Apr 2016 01:18:12 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1amwtp-0008GX-Uy
	for coreutils@gnu.org; Mon, 04 Apr 2016 01:18:11 -0400
Received: from mail-qg0-x22c.google.com ([2607:f8b0:400d:c04::22c]:34852)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1amwtp-0008GT-Ou
	for coreutils@gnu.org; Mon, 04 Apr 2016 01:18:05 -0400
Received: by mail-qg0-x22c.google.com with SMTP id y89so140669278qge.2
	for <coreutils@gnu.org>; Sun, 03 Apr 2016 22:18:05 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:subject:message-id:date:to:mime-version;
	bh=itQQw8u7SzL7FD0aRxOw0eSyFVJ+cIYyARAgbZWepW8=;
	b=j4gyyVQwbdRPcLd+xHYYOD0GujQpwg+afGCdWySqocMPxTb/XwTXYoXcLwbpi/M0FH
	igrn67yl2V+Snq3bYTKodmYcKNH7glnJtkwPN2a1c84W6XuWmeWEhrhHcza1OvQcB2PQ
	gDtY4hZ5WNxmj/nnhCCHnnG20KZzmlr6FaUhKX6lfTz5CBvLj5bQ0EIA/ghGfwTGTSpk
	Aud1F7QyEBvrYzy05GtAivoLzWH+ncWJHUMVPe+0FJv91ob4csLLngPMXkFw28lKFpVt
	m7fey0pikvK4NyBnibfjtP8F6tzXWlAGeExVqfTVvW/w5OBQsVDUKw/E6A2I9G3UwfeO
	pP6g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:subject:message-id:date:to:mime-version;
	bh=itQQw8u7SzL7FD0aRxOw0eSyFVJ+cIYyARAgbZWepW8=;
	b=XMxya/xbPD7jWFDgtU4ouZfdjD4PV+gee57Y6SdA4trIK6dNwvVLCsdLpGE3OilH37
	NGL0fdtouI6sFe9hFT8osjNKtJzRc4zM++pTSMIe6KoorORRTx0gd89fWZ/Zwg0jDAQx
	NVJc5imdqIaWAFTCnbR2lY13jK0jvwPk/IMqwPMI4Nv/jCgj7Y0lJbrAbMBJsmjg54V0
	AkoLyEL8digT/lqxZ68FByjBIKh73NRKi3L4whHBt2d1WqLgrwTaZ8X1yRqeNyrExv/p
	38jESq6Kjuoo4cAObVtzxxhF8IESqupOLwqPtFiX5SRpsES9FXJuDUfSnXXSPlkc6tdC
	wGHg==
X-Gm-Message-State: AD7BkJJ6eE3/iBCSR/vN7sFgWiM8G/bHnvNlPugIFe71KmqjbxAXoAcmAGgVALf6qH/qZg==
X-Received: by 10.140.201.130 with SMTP id w124mr21612162qha.57.1459747084876; 
	Sun, 03 Apr 2016 22:18:04 -0700 (PDT)
Received: from ix.home (pool-100-38-105-55.nycmny.fios.verizon.net.
	[100.38.105.55]) by smtp.gmail.com with ESMTPSA id
	m22sm3787005qki.30.2016.04.03.22.18.03 for <coreutils@gnu.org>
	(version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
	Sun, 03 Apr 2016 22:18:03 -0700 (PDT)
From: Assaf Gordon <assafgordon@gmail.com>
Content-Type: multipart/mixed;
	boundary="Apple-Mail=_7FCAC2F0-F5CA-4188-A4BA-5DBE85F2B048"
Subject: prevent seq from inflow on I/O errors
Message-Id: <788E7E16-EFE1-47D0-96CD-A35FB080BBA6@gmail.com>
Date: Mon, 4 Apr 2016 01:18:02 -0400
To: Coreutils <coreutils@gnu.org>
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\))
X-Mailer: Apple Mail (2.2102)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2607:f8b0:400d:c04::22c
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 04 Apr 2016 05:18:12 -0000


--Apple-Mail=_7FCAC2F0-F5CA-4188-A4BA-5DBE85F2B048
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

Hello,

The attached patch add I/O error checking to seq, preventing infloop on =
certain write-error conditions.

The typical case is
      seq 1 inf > /dev/full

but also a more rare case is of systems with SIGPIPE set to ignore by =
default
(same weird system in recent grep thread: =
http://lists.gnu.org/archive/html/bug-grep/2016-03/msg00025.html ).

On that weird system, commands like 'seq 999999 inf | head -n2' would =
run forever because SIGPIPE is ignored, and seq did not check for =
errors. (This exact command is found in ./tests/misc/seq-precision.sh).

Comments and feedback welcomed,
regards,
 - assaf



--Apple-Mail=_7FCAC2F0-F5CA-4188-A4BA-5DBE85F2B048
Content-Disposition: attachment;
	filename=0001-seq-detect-and-report-I-O-errors.patch
Content-Type: application/octet-stream;
	name="0001-seq-detect-and-report-I-O-errors.patch"
Content-Transfer-Encoding: quoted-printable

=46rom=206deeba06e4406b618d820ad9eb3ac49273775b4a=20Mon=20Sep=2017=20=
00:00:00=202001=0AFrom:=20Assaf=20Gordon=20<assafgordon@gmail.com>=0A=
Date:=20Mon,=204=20Apr=202016=2000:37:38=20-0400=0ASubject:=20[PATCH]=20=
seq:=20detect=20and=20report=20I/O=20errors=0A=0AEnsure=20I/O=20errors=20=
are=20detected=20(and=20terminate=20seq),=20preventing=20seq=0Afrom=20=
infloop=20(or=20running=20for=20long=20time=20with=20a=20large=0Arange)=20=
upon=20write=20errors=20or=20ignored=20SIGPIPE.=20Examples:=0A=0A=20=20=20=
=20=20seq=201=20inf=20>=20/dev/full=20=20=20=20=20=20=20=20=20=20=20=20=20=
(seq_fast)=0A=20=20=20=20=20seq=201.1=200.1=20inf=20>/dev/full=20=20=20=20=
=20=20=20=20(print_numbers)=0A=0A*=20src/seq.c:=20=
(seq_fast,print_numbers):=20explicitly=20check=20for=20write=20errors=0A=20=
=20=20and=20break=20out=20of=20the=20output=20writing=20loop.=0A*=20=
tests/misc/seq-io-errors.sh:=20test=20new=20error=20detection.=0A*=20=
tests/local.mk:=20add=20new=20test.=0A*=20NEWS:=20mention=20change.=0A=
---=0A=20NEWS=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20|=20=202=20++=0A=20src/seq.c=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20|=20=207=20+++++-=0A=20tests/local.mk=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20|=20=201=20+=0A=20=
tests/misc/seq-io-errors.sh=20|=2057=20=
+++++++++++++++++++++++++++++++++++++++++++++=0A=204=20files=20changed,=20=
66=20insertions(+),=201=20deletion(-)=0A=20create=20mode=20100755=20=
tests/misc/seq-io-errors.sh=0A=0Adiff=20--git=20a/NEWS=20b/NEWS=0Aindex=20=
d3597d0..8055396=20100644=0A---=20a/NEWS=0A+++=20b/NEWS=0A@@=20-15,6=20=
+15,8=20@@=20GNU=20coreutils=20NEWS=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20-*-=20=
outline=20-*-=0A=20=20=20=20stty=20--help=20no=20longer=20outputs=20=
extraneous=20gettext=20header=20lines=0A=20=20=20=20for=20translated=20=
languages.=20[bug=20introduced=20in=20coreutils-8.24]=0A=20=0A+=20=20=20=
seq=20no=20longer=20infloops=20under=20certain=20write-error=20=
conditions.=0A+=0A=20**=20Changes=20in=20behavior=0A=20=0A=20=20=20=20=
stat=20now=20outputs=20nanosecond=20information=20for=20time=20stamps=20=
even=20if=0Adiff=20--git=20a/src/seq.c=20b/src/seq.c=0Aindex=20=
fbb94a0..5fe2229=20100644=0A---=20a/src/seq.c=0A+++=20b/src/seq.c=0A@@=20=
-326,6=20+326,8=20@@=20print_numbers=20(char=20const=20*fmt,=20struct=20=
layout=20layout,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20}=0A=20=0A=20=20=
=20=20=20=20=20=20=20=20=20fputs=20(separator,=20stdout);=0A+=20=20=20=20=
=20=20=20=20=20=20if=20(ferror=20(stdout))=0A+=20=20=20=20=20=20=20=20=20=
=20=20=20break;=0A=20=20=20=20=20=20=20=20=20}=0A=20=0A=20=20=20=20=20=20=
=20fputs=20(terminator,=20stdout);=0A@@=20-495,7=20+497,10=20@@=20=
seq_fast=20(char=20const=20*a,=20char=20const=20*b)=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20output=20buffer=20so=20far,=20and=20reset=20to=20=
start=20of=20buffer.=20=20*/=0A=20=20=20=20=20=20=20=20=20=20=20if=20=
(buf_end=20-=20(p_len=20+=201)=20<=20bufp)=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20{=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20fwrite=20(buf,=20=
bufp=20-=20buf,=201,=20stdout);=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20if=20(fwrite=20(buf,=20bufp=20-=20buf,=201,=20stdout)=20!=3D=201)=20{=0A=
+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20ok=20=3D=200;=0A+=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20break;=0A+=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20}=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20bufp=20=
=3D=20buf;=0A=20=20=20=20=20=20=20=20=20=20=20=20=20}=0A=20=20=20=20=20=20=
=20=20=20}=0Adiff=20--git=20a/tests/local.mk=20b/tests/local.mk=0Aindex=20=
a83c3d0..8b2a19a=20100644=0A---=20a/tests/local.mk=0A+++=20=
b/tests/local.mk=0A@@=20-235,6=20+235,7=20@@=20all_tests=20=3D=09=09=09=09=
=09\=0A=20=20=20tests/misc/ptx.pl=09=09=09=09\=0A=20=20=20=
tests/misc/test.pl=09=09=09=09\=0A=20=20=20tests/misc/seq.pl=09=09=09=09=
\=0A+=20=20tests/misc/seq-io-errors.sh=09=09=09\=0A=20=20=20=
tests/misc/seq-long-double.sh=09=09=09\=0A=20=20=20=
tests/misc/seq-precision.sh=09=09=09\=0A=20=20=20tests/misc/head.pl=09=09=
=09=09\=0Adiff=20--git=20a/tests/misc/seq-io-errors.sh=20=
b/tests/misc/seq-io-errors.sh=0Anew=20file=20mode=20100755=0Aindex=20=
0000000..7e06cdd=0A---=20/dev/null=0A+++=20b/tests/misc/seq-io-errors.sh=0A=
@@=20-0,0=20+1,57=20@@=0A+#!/bin/sh=0A+#=20Test=20for=20proper=20=
detection=20of=20I/O=20errors=20in=20seq=0A+=0A+#=20Copyright=20(C)=20=
2016=20Free=20Software=20Foundation,=20Inc.=0A+=0A+#=20This=20program=20=
is=20free=20software:=20you=20can=20redistribute=20it=20and/or=20modify=0A=
+#=20it=20under=20the=20terms=20of=20the=20GNU=20General=20Public=20=
License=20as=20published=20by=0A+#=20the=20Free=20Software=20Foundation,=20=
either=20version=203=20of=20the=20License,=20or=0A+#=20(at=20your=20=
option)=20any=20later=20version.=0A+=0A+#=20This=20program=20is=20=
distributed=20in=20the=20hope=20that=20it=20will=20be=20useful,=0A+#=20=
but=20WITHOUT=20ANY=20WARRANTY;=20without=20even=20the=20implied=20=
warranty=20of=0A+#=20MERCHANTABILITY=20or=20FITNESS=20FOR=20A=20=
PARTICULAR=20PURPOSE.=20=20See=20the=0A+#=20GNU=20General=20Public=20=
License=20for=20more=20details.=0A+=0A+#=20You=20should=20have=20=
received=20a=20copy=20of=20the=20GNU=20General=20Public=20License=0A+#=20=
along=20with=20this=20program.=20=20If=20not,=20see=20=
<http://www.gnu.org/licenses/>.=0A+=0A+.=20"${srcdir=3D.}/tests/init.sh";=20=
path_prepend_=20./src=0A+print_ver_=20seq=0A+=0A+if=20!=20test=20-w=20=
/dev/full=20||=20!=20test=20-c=20/dev/full;=20then=0A+=20=20skip_=20=
'/dev/full=20is=20required'=0A+fi=0A+=0A+#=20Run=20'seq'=20with=20a=20=
timeout,=20preventing=20infinite-loop=20run.=0A+#=20if=20seq=20fails=20=
(returns=201)=20-=20the=20test=20passed.=0A+#=20if=20seq=20times-out=20=
(timeout=20forces=20exitcode=20of=20124)=20-=20the=20test=20failed.=0A+#=20=
any=20other=20code=20-=20framework=20failure.=0A+timed_seq_fail()=0A+{=0A=
+=20=20timeout=205=20seq=20"$@"=20>=20/dev/full=202>/dev/null=0A+=20=20=
rc=3D$?=0A+=20=20if=20test=20$rc=20-eq=201=20;=20then=0A+=20=20=20=20:=0A=
+=20=20elif=20test=20$rc=20-eq=20124=20;=20then=0A+=20=20=20=20fail=3D1=0A=
+=20=20else=0A+=20=20=20=20framework_failure_=0A+=20=20fi=0A+}=0A+=0A+=0A=
+#=20Test=20infinite=20sequence,=20using=20fast-path=20method=20=
(seq_fast).=0A+timed_seq_fail=201=20inf=0A+=0A+#=20Test=20infinite=20=
sequence,=20using=20slow-path=20method=20(print_numbers).=0A=
+timed_seq_fail=201.1=20.1=20inf=0A+=0A+#=20Test=20non-infinite=20=
sequence,=20using=20slow-path=20method=20(print_numbers).=0A+#=20=
(despite=20being=20non-infinite,=20the=20entire=20sequence=20should=20=
take=20long=20time=20to=0A+#=20=20print.=20Thus,=20either=20an=20I/O=20=
error=20is=20detected=20immedaitely,=20or=20seq=20will=0A+#=20=20=
timeout).=0A+timed_seq_fail=201=200.0001=2099999999=0A+=0A+=0A+Exit=20=
$fail=0A--=20=0A1.9.1=0A=0A=

--Apple-Mail=_7FCAC2F0-F5CA-4188-A4BA-5DBE85F2B048--


From MAILER-DAEMON Mon Apr 04 07:57:58 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1an38o-0008Ni-Pw
	for mharc-coreutils@gnu.org; Mon, 04 Apr 2016 07:57:58 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:36529)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1an38m-0008Na-1P
	for coreutils@gnu.org; Mon, 04 Apr 2016 07:57:57 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1an38i-0002JZ-Lr
	for coreutils@gnu.org; Mon, 04 Apr 2016 07:57:55 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:56860)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1an38i-0002JE-8y
	for coreutils@gnu.org; Mon, 04 Apr 2016 07:57:52 -0400
Received: from localhost.localdomain (unknown [109.79.169.191])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id E2D374B13;
	Mon,  4 Apr 2016 12:57:49 +0100 (IST)
Subject: Re: prevent seq from inflow on I/O errors
To: Assaf Gordon <assafgordon@gmail.com>, Coreutils <coreutils@gnu.org>
References: <788E7E16-EFE1-47D0-96CD-A35FB080BBA6@gmail.com>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <570256BD.7010302@draigBrady.com>
Date: Mon, 4 Apr 2016 12:57:49 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <788E7E16-EFE1-47D0-96CD-A35FB080BBA6@gmail.com>
Content-Type: multipart/mixed; boundary="------------020206080804040403010601"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 82.195.144.49
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 04 Apr 2016 11:57:57 -0000

This is a multi-part message in MIME format.
--------------020206080804040403010601
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: quoted-printable

On 04/04/16 06:18, Assaf Gordon wrote:
> Hello,
>
> The attached patch add I/O error checking to seq, preventing infloop on=
 certain write-error conditions.
>
> The typical case is
>        seq 1 inf > /dev/full

Nice one.
Note we'd only inf loop if seq was going to run forever anyway.
I've adjusted the NEWS accordingly.

>
> but also a more rare case is of systems with SIGPIPE set to ignore by d=
efault
> (same weird system in recent grep thread:http://lists.gnu.org/archive/h=
tml/bug-grep/2016-03/msg00025.html  ).

Trotting out my standard SIGPIPE response...
http://www.pixelbeat.org/programming/sigpipe_handling.html

> On that weird system, commands like 'seq 999999 inf | head -n2' would r=
un forever because SIGPIPE is ignored,

Note if running stuff from python you may have SIGPIPE ignored.
See link above for details.

> and seq did not check for errors. (This exact command is found in ./tes=
ts/misc/seq-precision.sh).

seq_fast() should exit() on EIO as it should only return
if nothing was output. Returning will only generate
duplicate outputs or free invalid pointers etc.
Now we could just exit() and rely on close_stdout to diagnose,
but here we should diagnose the actual error, rather than
relying on a generic "write error" because there are relatively
few output locations in this program.


> +++ b/tests/misc/seq-io-errors.sh

> +timed_seq_fail()
> +{
> +  timeout 5 seq "$@" > /dev/full 2>/dev/null
> +  rc=3D$?
> +  if test $rc -eq 1 ; then
> +    :
> +  elif test $rc -eq 124 ; then
> +    fail=3D1
> +  else
> +    framework_failure_
> +  fi
> +}

The above could be simplified/standardized to:

   returns_ 1 timeout 10 seq "$@" >/dev/full 2>/dev/null

Also it's worth checking for the SIGPIPE case.

updated patch is attached.

cheers,
P=E1draig.

--------------020206080804040403010601
Content-Type: text/x-patch;
 name="seq-eio.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="seq-eio.patch"

>From 65741749a324ff640e15a9b2959c8d6ee85131f9 Mon Sep 17 00:00:00 2001
From: Assaf Gordon <assafgordon@gmail.com>
Date: Mon, 4 Apr 2016 12:31:43 +0100
Subject: [PATCH] seq: detect and report I/O errors immediately

Ensure I/O errors are detected (and terminate seq), preventing seq
from infloop (or running for long time with a large
range) upon write errors or ignored SIGPIPE. Examples:

     seq 1 inf > /dev/full             (seq_fast)
     seq 1.1 0.1 inf >/dev/full        (print_numbers)

* src/seq.c (io_error): A new function to diagnose appropriate
stdio errors and exit the program with failure status.
(seq_fast, print_numbers): Explicitly check for write errors
and terminate the program with diagnostic.
* tests/misc/seq-io-errors.sh: Eest new error detection.
* tests/local.mk: Add new test.
* NEWS: Mention the fix.
---
 NEWS                        |  3 +++
 src/seq.c                   | 27 ++++++++++++++++++++-----
 tests/local.mk              |  1 +
 tests/misc/seq-io-errors.sh | 48 +++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 74 insertions(+), 5 deletions(-)
 create mode 100644 tests/misc/seq-io-errors.sh

diff --git a/NEWS b/NEWS
index dd3ee9c..ffb8641 100644
--- a/NEWS
+++ b/NEWS
@@ -15,6 +15,9 @@ GNU coreutils NEWS                                    -*- outline -*-
    stty --help no longer outputs extraneous gettext header lines
    for translated languages. [bug introduced in coreutils-8.24]
 
+   seq now immediately exits upon write errors.
+   [This bug was present in "the beginning".]
+
 ** Changes in behavior
 
    stat now outputs nanosecond information for time stamps even if
diff --git a/src/seq.c b/src/seq.c
index fbb94a0..3095715 100644
--- a/src/seq.c
+++ b/src/seq.c
@@ -267,6 +267,18 @@ long_double_format (char const *fmt, struct layout *layout)
       }
 }
 
+static void ATTRIBUTE_NORETURN
+io_error (void)
+{
+  int status = EXIT_FAILURE;
+  if (errno != EPIPE)
+    error (0, errno, _("standard output"));
+  else
+    status = EXIT_SUCCESS;
+  clearerr (stdout);
+  exit (status);
+}
+
 /* Actually print the sequence of numbers in the specified range, with the
    given or default stepping and format.  */
 
@@ -284,7 +296,8 @@ print_numbers (char const *fmt, struct layout layout,
       for (i = 1; ; i++)
         {
           long double x0 = x;
-          printf (fmt, x);
+          if (printf (fmt, x) < 0)
+            io_error ();
           if (out_of_range)
             break;
           x = first + i * step;
@@ -325,10 +338,12 @@ print_numbers (char const *fmt, struct layout layout,
                 break;
             }
 
-          fputs (separator, stdout);
+          if (fputs (separator, stdout) == EOF)
+            io_error ();
         }
 
-      fputs (terminator, stdout);
+      if (fputs (terminator, stdout) == EOF)
+        io_error ();
     }
 }
 
@@ -495,14 +510,16 @@ seq_fast (char const *a, char const *b)
              output buffer so far, and reset to start of buffer.  */
           if (buf_end - (p_len + 1) < bufp)
             {
-              fwrite (buf, bufp - buf, 1, stdout);
+              if (fwrite (buf, bufp - buf, 1, stdout) != 1)
+                io_error ();
               bufp = buf;
             }
         }
 
       /* Write any remaining buffered output, and the terminator.  */
       *bufp++ = *terminator;
-      fwrite (buf, bufp - buf, 1, stdout);
+      if (fwrite (buf, bufp - buf, 1, stdout) != 1)
+        io_error ();
 
       IF_LINT (free (buf));
     }
diff --git a/tests/local.mk b/tests/local.mk
index a83c3d0..8b2a19a 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -235,6 +235,7 @@ all_tests =					\
   tests/misc/ptx.pl				\
   tests/misc/test.pl				\
   tests/misc/seq.pl				\
+  tests/misc/seq-io-errors.sh			\
   tests/misc/seq-long-double.sh			\
   tests/misc/seq-precision.sh			\
   tests/misc/head.pl				\
diff --git a/tests/misc/seq-io-errors.sh b/tests/misc/seq-io-errors.sh
new file mode 100644
index 0000000..ac44ca2
--- /dev/null
+++ b/tests/misc/seq-io-errors.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+# Test for proper detection of I/O errors in seq
+
+# Copyright (C) 2016 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
+print_ver_ seq
+
+if ! test -w /dev/full || ! test -c /dev/full; then
+  skip_ '/dev/full is required'
+fi
+
+# Run 'seq' with a timeout, preventing infinite-loop run.
+# if seq fails (returns 1) - the test passed.
+# if seq times-out (timeout forces exitcode of 124) - the test failed.
+# any other code - framework failure.
+timed_seq_fail() { returns_ 1 timeout 10 seq "$@" >/dev/full 2>/dev/null; }
+
+
+# Test infinite sequence, using fast-path method (seq_fast).
+timed_seq_fail 1 inf
+
+# Test infinite sequence, using slow-path method (print_numbers).
+timed_seq_fail 1.1 .1 inf
+
+# Test non-infinite sequence, using slow-path method (print_numbers).
+# (despite being non-infinite, the entire sequence should take long time to
+#  print. Thus, either an I/O error is detected immedaitely, or seq will
+#  timeout).
+timed_seq_fail 1 0.0001 99999999
+
+(trap '' PIPE; timeout 10 sh -c 'seq inf 2>err | head -n1') || fail=1
+compare /dev/null err || fail=1
+
+Exit $fail
-- 
2.5.5


--------------020206080804040403010601--


From MAILER-DAEMON Mon Apr 04 08:20:42 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1an3Uo-0007ns-Jo
	for mharc-coreutils@gnu.org; Mon, 04 Apr 2016 08:20:42 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:40995)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigbrady.com>) id 1an3Ui-0007la-S2
	for coreutils@gnu.org; Mon, 04 Apr 2016 08:20:41 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigbrady.com>) id 1an3Ue-0007D8-Bh
	for coreutils@gnu.org; Mon, 04 Apr 2016 08:20:36 -0400
Received: from mail2.vodafone.ie ([213.233.128.44]:63432)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigbrady.com>) id 1an3Ue-0007C1-5E
	for coreutils@gnu.org; Mon, 04 Apr 2016 08:20:32 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AjoMAG1bAldtT6m//2dsb2JhbABdgzceBDF9gnG2J4QPFwKFdIEzTAEBAQEBAWYnhEQWZyiBS4gJoQqbdYUoik2BfAtAgkMFmAGFc4gXiU+FPAKPGmKBNgEBCAKCJjswiCYBAQE
Received: from unknown (HELO localhost.localdomain.localdomain)
	([109.79.169.191])
	by mail2.vodafone.ie with ESMTP; 04 Apr 2016 13:20:30 +0100
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
To: coreutils@gnu.org
Subject: [PATCH] yes: avoid redundant diagnostics on write error
Date: Mon,  4 Apr 2016 13:20:20 +0100
Message-Id: <1459772420-13676-1-git-send-email-P@draigBrady.com>
X-Mailer: git-send-email 2.5.5
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 213.233.128.44
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 04 Apr 2016 12:20:41 -0000

* src/yes.c (main): For large inputs only write a single
diagnostic for write errors.
* tests/misc/yes.sh: Test when /dev/full is available.
---
 src/yes.c         |  2 ++
 tests/misc/yes.sh | 13 +++++++++++++
 2 files changed, 15 insertions(+)

diff --git a/src/yes.c b/src/yes.c
index 31424cf..1d2c612 100644
--- a/src/yes.c
+++ b/src/yes.c
@@ -121,6 +121,7 @@ main (int argc, char **argv)
       if ((pbuf - buf) && fwrite (buf, pbuf - buf, 1, stdout) != 1)
         {
           error (0, errno, _("standard output"));
+          clearerr (stdout);
           return EXIT_FAILURE;
         }
       for (j = i; j < argc; j++)
@@ -128,6 +129,7 @@ main (int argc, char **argv)
             || putchar (j == argc - 1 ? '\n' : ' ') == EOF)
           {
             error (0, errno, _("standard output"));
+            clearerr (stdout);
             return EXIT_FAILURE;
           }
     }
diff --git a/tests/misc/yes.sh b/tests/misc/yes.sh
index 1371593..4b0d320 100755
--- a/tests/misc/yes.sh
+++ b/tests/misc/yes.sh
@@ -40,4 +40,17 @@ if external true $(seq 4000); then
   done
 fi
 
+# Check a single appropriate diagnostic is output on write error
+if test -w /dev/full && test -c /dev/full; then
+  # The single output diagnostic expected,
+  # (without the possibly varying :strerror(ENOSPC) suffix).
+  printf '%s\n' "yes: standard output" > exp
+
+  for size in 1 16384; do
+    returns_ 1 yes "$(printf %${size}s '')" >/dev/full 2>errt
+    sed 's/\(yes:.*\):.*/\1/' errt > err
+    compare exp err || fail=1
+  done
+fi
+
 Exit $fail
-- 
2.5.5



From MAILER-DAEMON Mon Apr 04 22:44:05 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1anGyL-0001Pa-Gd
	for mharc-coreutils@gnu.org; Mon, 04 Apr 2016 22:44:05 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:50188)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <vapier@gentoo.org>) id 1anGyJ-0001PP-Cf
	for coreutils@gnu.org; Mon, 04 Apr 2016 22:44:04 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <vapier@gentoo.org>) id 1anGyG-0000uN-52
	for coreutils@gnu.org; Mon, 04 Apr 2016 22:44:03 -0400
Received: from smtp.gentoo.org ([140.211.166.183]:59286)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <vapier@gentoo.org>) id 1anGyF-0000uH-Vi
	for coreutils@gnu.org; Mon, 04 Apr 2016 22:44:00 -0400
Received: from vapier.lan (localhost [127.0.0.1])
	by smtp.gentoo.org (Postfix) with SMTP id 6C33F340BBD;
	Tue,  5 Apr 2016 02:43:57 +0000 (UTC)
Date: Mon, 4 Apr 2016 22:43:56 -0400
From: Mike Frysinger <vapier@gentoo.org>
To: Ingo Krabbe <ikrabbe.ask@gmail.com>
Subject: Re: Whats the reason to suppress short unicode characters in printf?
Message-ID: <20160405024356.GC6588@vapier.lan>
Mail-Followup-To: Ingo Krabbe <ikrabbe.ask@gmail.com>, coreutils@gnu.org
References: <383774da0bc1985fb0263d469529e52f@yourdomain.dom>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature"; boundary="7vaJbdtArmJjZ6NW"
Content-Disposition: inline
In-Reply-To: <383774da0bc1985fb0263d469529e52f@yourdomain.dom>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 140.211.166.183
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 05 Apr 2016 02:44:04 -0000


--7vaJbdtArmJjZ6NW
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline

the code as written has existed since it was first committed in Mar 2000:
http://git.savannah.gnu.org/cgit/coreutils.git/commit/?h=29d3ba4a7b42ed1b40b963b6047f2412ea4843b1
although the Author says Jim, the ChangeLog file says Bruno Haible.

that predates the merge of file/text/shell utils into coreutils (2003),
and printf was part of the shellutils project.  unfortunately the history
is pretty spotty that far back ... here's its mailing list archive:
	https://lists.gnu.org/archive/html/bug-sh-utils/

so i guess really you'd have to ask Bruno and/or Jim.  my guess is that
it comes from the C standard:
	http://c0x.coding-guidelines.com/6.4.3.html
and you might find this interesting:
	http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html
	http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3881.pdf
-mike

--7vaJbdtArmJjZ6NW
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJXAyZsAAoJEEFjO5/oN/WBq6cP/2oqXFZVIT2pk5vXsiznycb5
wyVUHGhAjlYmxFA+plFl/6VpbXPyuu7Bv53bni5v6IXap3Vo7cOWgH7uXJezCwv1
zkPZl7CVJwj1Sd4LYyV1wBbN+p/0ziIqigm3vBG/nEPk30c4EESkn972V7duL26C
ZRJVc0bqDs3uk5vO/oGqb9uNcRyha5PVAb6tPuQxiYz/2vC947RO/jSVYEIqP6Lz
tjuSB+h0YraXXZOdhYEdD00E8A3AyUjzJ+uMgbwk9jCVcnLOTBQF128/b0GNRPI9
g7D8RClUb+9236kKftc8sT0N/4E20lpn7vz2aVTHFUJGb99rOQoCPqNTle3EYvvZ
g3KNHWc0DdSS5vKFzKMp0fCVAN3h4M1Uc5+qSB9taJs/RqRxSeIhnSfTkvaxok+y
uq7Pmh1P9l1mlJ5GLE7jKTG3m4BzZY4JKmeCODLY1rCCPVXQl2+z5gjeSccq0idQ
dcFtDRbMWbR9Melf1/Gh7Tx2Zs/tk9fDklOo9AhfNfeW2BV6Cs2lAbNMo7teqzub
S5xrPOGv9E8eurFAARJrTloUFB/9xGlKkfE6FmdNsX2gtvLvvpnUvN5JqWz6zuwr
0cdeYDOrheeDblhX530qSrjxZnjTT86Rqov2MuyCOMfsBcFEs86FHk0PERP2/a3N
4pCY17oABEnGUNmHgTKL
=0j3g
-----END PGP SIGNATURE-----

--7vaJbdtArmJjZ6NW--


From MAILER-DAEMON Tue Apr 05 00:02:20 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1anIC4-0005ON-3d
	for mharc-coreutils@gnu.org; Tue, 05 Apr 2016 00:02:20 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:36424)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1anIC1-0005Nt-UY
	for coreutils@gnu.org; Tue, 05 Apr 2016 00:02:18 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1anIC0-00036g-Jw
	for coreutils@gnu.org; Tue, 05 Apr 2016 00:02:17 -0400
Received: from mail-ob0-x232.google.com ([2607:f8b0:4003:c01::232]:34412)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1anIC0-00036C-EY
	for coreutils@gnu.org; Tue, 05 Apr 2016 00:02:16 -0400
Received: by mail-ob0-x232.google.com with SMTP id bg3so1338044obb.1
	for <coreutils@gnu.org>; Mon, 04 Apr 2016 21:02:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:from:date:message-id
	:subject:to; bh=ilU4Nm4yNgw3j4YThCX74kq7CZ5UjdFfcqNM94NrqPQ=;
	b=ehzVjfBzCi1Lv0/FuyBUBKDAA10p7fLZBpjLn8laScXd+J1ODhvHBY+BsUa6Rz1hke
	nAQe85dOIpxpuFciNZ+WEk8XH96IyA1eXyKyImDKPuzRV8TQOQoICYe9SaZG/nMZEdpE
	Ylx340XJ9cw6pLFwDho0LraBQvG0ehmdWLIiBMvCwFFAfbgq3IyBzS25ifH2ELxRYGTs
	a3cDSF0dngIVTLHE4BtOnfSVOYs2MHs434sLIll726nPrexk4+a7VymtN46pCmzqG6kV
	uXg5BMLiDHVw6saO5GT3aCpVQgsKo4fuizZlgMHhMge4v9ocD7FxWGee73usgXyrFOl5
	EH3Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
	:date:message-id:subject:to;
	bh=ilU4Nm4yNgw3j4YThCX74kq7CZ5UjdFfcqNM94NrqPQ=;
	b=kOxq3Nhkj/TYjLlq9rKuNnHF4D8b1ZLeITkhEFSDXZGeWENAgjPfWXU3JPq2YnX+bO
	iY/UoAMjt/Xdd6A2331J3EkLDtqktOMh44lkJ/lcUOE8+FQz+qFo7cfO/tNgsVPrQzaF
	UGP/Sy3XzrbivwwmCB9FHcpMDAx+u8z+aks28WRa8uyhCYEvhGFBQM8CkzYhoRXP5+Bc
	9isNaU/UYLZc8PB+zHncNaj64G4ql2mrGtKblbMIMj/jOIoeQB6zX3OZmaxQyBVnrOOh
	ZhSQ38bFhtXpfKqofy0iI3coHzuux5xlYyVT7J1LcFnq+M89TNBRWCcBjxNZw+0hi8NR
	cMig==
X-Gm-Message-State: AD7BkJIonSYdnB3S2yCVetp5VwFTDVbXBLH0Fsnq7N1Oye28hbqfg0YI4jAmnTF/LvOen5hfidxUFNDM4hbZQQ==
X-Received: by 10.182.58.36 with SMTP id n4mr7671777obq.2.1459828935343; Mon,
	04 Apr 2016 21:02:15 -0700 (PDT)
MIME-Version: 1.0
Sender: meyering@gmail.com
Received: by 10.202.213.141 with HTTP; Mon, 4 Apr 2016 21:01:55 -0700 (PDT)
In-Reply-To: <20160405024356.GC6588@vapier.lan>
References: <383774da0bc1985fb0263d469529e52f@yourdomain.dom>
	<20160405024356.GC6588@vapier.lan>
From: Jim Meyering <jim@meyering.net>
Date: Mon, 4 Apr 2016 21:01:55 -0700
X-Google-Sender-Auth: fSqNOmlu8eu23wR7W9n6iOsrJMg
Message-ID: <CA+8g5KGmdXvcUsSiceJ=LZp49yoUE9yW+BM6D=VpZetvZMLmfg@mail.gmail.com>
Subject: Re: Whats the reason to suppress short unicode characters in printf?
To: Ingo Krabbe <ikrabbe.ask@gmail.com>, Coreutils <coreutils@gnu.org>
Content-Type: text/plain; charset=UTF-8
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2607:f8b0:4003:c01::232
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 05 Apr 2016 04:02:19 -0000

On Mon, Apr 4, 2016 at 7:43 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> the code as written has existed since it was first committed in Mar 2000:
> http://git.savannah.gnu.org/cgit/coreutils.git/commit/?h=29d3ba4a7b42ed1b40b963b6047f2412ea4843b1
> although the Author says Jim, the ChangeLog file says Bruno Haible.
>
> that predates the merge of file/text/shell utils into coreutils (2003),
> and printf was part of the shellutils project.  unfortunately the history
> is pretty spotty that far back ... here's its mailing list archive:
>         https://lists.gnu.org/archive/html/bug-sh-utils/
>
> so i guess really you'd have to ask Bruno and/or Jim.  my guess is that
> it comes from the C standard:
>         http://c0x.coding-guidelines.com/6.4.3.html
> and you might find this interesting:
>         http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html
>         http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3881.pdf

I confirm it was a patch by Bruno Haible.
I have a copy of a message from him with the following changes
that appears to have been sent only to Markus Kuhn and me.
As he explained, these changes were motivated by the then-recent
approval of ISO C99. Here are the ChangeLog entries:

m4/ChangeLog:

2000-02-02  Bruno Haible  <haible@clisp.cons.org>

        * codeset.m4: New file.
        * iconv.m4: New file.
        * jm-macros.m4 (jm_MACROS): Call jm_LANGINFO_CODESET and jm_ICONV.

lib/ChangeLog:

2000-02-02  Bruno Haible  <haible@clisp.cons.org>

        * config.charset: New file.
        * localcharset.c: New file.
        * unicodeio.h, unicodeio.c: New files.
        * Makefile.am (DEFS): Add -DLIBDIR=...
          (libfetish_a_SOURCES): Add localcharset.c and unicodeio.c.
          (noinst_HEADERS): Add unicodeio.h.
          (all-local, install-exec-local, charset.alias): New targets.

src/ChangeLog:

2000-02-02  Bruno Haible  <haible@clisp.cons.org>

        * printf.c: Include "unicodeio.h".
          (usage): Mention \u and \U directives. \x outputs a byte, not a
          character.
          (print_esc): Implement \u and \U.
        * Makefile.am (printf_LDADD): Add @LIBICONV@.

*** sh-utils-2.0e/lib/config.charset.bak        Sun Jan 30 23:00:44 2000
--- sh-utils-2.0e/lib/config.charset    Tue Feb  1 11:28:09 2000
...


From MAILER-DAEMON Tue Apr 05 05:01:35 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1anMre-0007GQ-WF
	for mharc-coreutils@gnu.org; Tue, 05 Apr 2016 05:01:35 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43149)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1anMrW-0007A3-0a
	for coreutils@gnu.org; Tue, 05 Apr 2016 05:01:32 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1anMrS-0005bY-7H
	for coreutils@gnu.org; Tue, 05 Apr 2016 05:01:25 -0400
Received: from mout.kundenserver.de ([212.227.126.130]:57236)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1anMrR-0005bT-R2
	for coreutils@gnu.org; Tue, 05 Apr 2016 05:01:22 -0400
Received: from [192.168.101.10] ([217.86.64.216]) by mrelayeu.kundenserver.de
	(mreue004) with ESMTPSA (Nemesis) id 0McAfD-1b5AQU3tEV-00JbwK;
	Tue, 05 Apr 2016 11:01:18 +0200
Subject: Re: prevent seq from inflow on I/O errors
To: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>,
	Assaf Gordon <assafgordon@gmail.com>, Coreutils <coreutils@gnu.org>
References: <788E7E16-EFE1-47D0-96CD-A35FB080BBA6@gmail.com>
	<570256BD.7010302@draigBrady.com>
From: Bernhard Voelker <mail@bernhard-voelker.de>
Message-ID: <57037EDD.2020604@bernhard-voelker.de>
Date: Tue, 5 Apr 2016 11:01:17 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.6.0
MIME-Version: 1.0
In-Reply-To: <570256BD.7010302@draigBrady.com>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 8bit
X-Provags-ID: V03:K0:j6O47cmo3qCSMbVUwfSxzcxowfPCFlJMqUWdCJkTk0Y/tVzLeIw
	y2+Zm2dQFJNkcbqeMj+H/nru2wreeASnhYZLygNTyk0IgFWuSBZjUIpSIHpOvPC/w8kLByG
	ZmTXdtPurpQvxCD0+JxHA+8xjDkTWZ2OPuOZObaHYQJLSD+OV3drWYWVWpPqd9X2FuZRixH
	26L0N8rJl2Went0dUNQVw==
X-UI-Out-Filterresults: notjunk:1;V01:K0:QtnpJ262JDk=:wcuQFqh/aNWnYNjcojnz29
	Sa1P6Kr05UKPGsKXGpf8Fgou/2Enss6tZzv07u/pP43ROUEciAcdoaVlWxFKvnYR4qkyNU9hC
	DhqsEUM4kCDX8hSHL6kEYWQbgLXrB7M5V98KiXUe9N+qzlN/CCd9Lqe3KlWcIPfppaEFUmne7
	YdCMtds4IaL0a4WPlqsHis66KTAcKXQsMQ2AVMb7eapT4ocBIoXRFKtwQUD3hY6BKC4+L0hXL
	bwHIzh3oFr3D/P1jgA2xzFSvQWYBNwLhvW2Kl6zSiqprrqLtWBhJxBkHyDppaNxVAKBPhooVg
	hLL2bMbcTwcIV2cBckY1Hg+wJN7CzutO1SUpXdVslpCui8vInutpdu2K27Bv05vz2XUmj3txi
	5Ekfi/zK2i+0MDS/v+h1UbufHX8ubCEXaHMYYIpzKDmonCrao3DUrUv/LPFgkwiFT38S/hMEB
	e5e7DJnKPmM/Omx+V7fBvA/JLW2LziyKLHTsnNL/h2quUZYc0NLmfSQXlCfB2n/VY5UHIMhl2
	Qzy/WgRt/vvT0Z5MAzvJmBkqNPjcNsXMK026fqfSh58OV24m6ffcKxFvdxNla6vEMuEm5QseJ
	fA5AjgcTWFqPTQ/O9F05X2V+F86RBsmUXZNPt9A5QgsTLheoiII1+6VFRaXYisrWFqyxF6wA1
	UxEVUbcQlwhfAPuaBgQb6lc2Hldv2rsfi8uQ30oxNNmAqKhzSafPjDbTgSFcXQ++RX5H7nmgC
	mZcOiGUCpvlWttB6
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 212.227.126.130
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 05 Apr 2016 09:01:33 -0000

Some findings below:

On 04/04/2016 01:57 PM, Pádraig Brady wrote:
> From 65741749a324ff640e15a9b2959c8d6ee85131f9 Mon Sep 17 00:00:00 2001
> From: Assaf Gordon <assafgordon@gmail.com>
> Date: Mon, 4 Apr 2016 12:31:43 +0100
> Subject: [PATCH] seq: detect and report I/O errors immediately
> 
> Ensure I/O errors are detected (and terminate seq), preventing seq
> from infloop (or running for long time with a large
> range) upon write errors or ignored SIGPIPE. Examples:
> 
>      seq 1 inf > /dev/full             (seq_fast)
>      seq 1.1 0.1 inf >/dev/full        (print_numbers)
> 
> * src/seq.c (io_error): A new function to diagnose appropriate
> stdio errors and exit the program with failure status.
> (seq_fast, print_numbers): Explicitly check for write errors
> and terminate the program with diagnostic.
> * tests/misc/seq-io-errors.sh: Eest new error detection.

s/Eest/Test/

> * tests/local.mk: Add new test.
> * NEWS: Mention the fix.
> ---
>  NEWS                        |  3 +++
>  src/seq.c                   | 27 ++++++++++++++++++++-----
>  tests/local.mk              |  1 +
>  tests/misc/seq-io-errors.sh | 48 +++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 74 insertions(+), 5 deletions(-)
>  create mode 100644 tests/misc/seq-io-errors.sh
> 
> diff --git a/NEWS b/NEWS
> index dd3ee9c..ffb8641 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -15,6 +15,9 @@ GNU coreutils NEWS                                    -*- outline -*-
>     stty --help no longer outputs extraneous gettext header lines
>     for translated languages. [bug introduced in coreutils-8.24]
>  
> +   seq now immediately exits upon write errors.
> +   [This bug was present in "the beginning".]
> +
>  ** Changes in behavior
>  
>     stat now outputs nanosecond information for time stamps even if
> diff --git a/src/seq.c b/src/seq.c
> index fbb94a0..3095715 100644
> --- a/src/seq.c
> +++ b/src/seq.c
> @@ -267,6 +267,18 @@ long_double_format (char const *fmt, struct layout *layout)
>        }
>  }
>  
> +static void ATTRIBUTE_NORETURN
> +io_error (void)
> +{
> +  int status = EXIT_FAILURE;
> +  if (errno != EPIPE)
> +    error (0, errno, _("standard output"));
> +  else
> +    status = EXIT_SUCCESS;
> +  clearerr (stdout);
> +  exit (status);
> +}
> +
>  /* Actually print the sequence of numbers in the specified range, with the
>     given or default stepping and format.  */
>  
> @@ -284,7 +296,8 @@ print_numbers (char const *fmt, struct layout layout,
>        for (i = 1; ; i++)
>          {
>            long double x0 = x;
> -          printf (fmt, x);
> +          if (printf (fmt, x) < 0)
> +            io_error ();
>            if (out_of_range)
>              break;
>            x = first + i * step;
> @@ -325,10 +338,12 @@ print_numbers (char const *fmt, struct layout layout,
>                  break;
>              }
>  
> -          fputs (separator, stdout);
> +          if (fputs (separator, stdout) == EOF)
> +            io_error ();
>          }
>  
> -      fputs (terminator, stdout);
> +      if (fputs (terminator, stdout) == EOF)
> +        io_error ();
>      }
>  }
>  
> @@ -495,14 +510,16 @@ seq_fast (char const *a, char const *b)
>               output buffer so far, and reset to start of buffer.  */
>            if (buf_end - (p_len + 1) < bufp)
>              {
> -              fwrite (buf, bufp - buf, 1, stdout);
> +              if (fwrite (buf, bufp - buf, 1, stdout) != 1)
> +                io_error ();
>                bufp = buf;
>              }
>          }
>  
>        /* Write any remaining buffered output, and the terminator.  */
>        *bufp++ = *terminator;
> -      fwrite (buf, bufp - buf, 1, stdout);
> +      if (fwrite (buf, bufp - buf, 1, stdout) != 1)
> +        io_error ();
>  
>        IF_LINT (free (buf));
>      }
> diff --git a/tests/local.mk b/tests/local.mk
> index a83c3d0..8b2a19a 100644
> --- a/tests/local.mk
> +++ b/tests/local.mk
> @@ -235,6 +235,7 @@ all_tests =					\
>    tests/misc/ptx.pl				\
>    tests/misc/test.pl				\
>    tests/misc/seq.pl				\
> +  tests/misc/seq-io-errors.sh			\
>    tests/misc/seq-long-double.sh			\
>    tests/misc/seq-precision.sh			\
>    tests/misc/head.pl				\
> diff --git a/tests/misc/seq-io-errors.sh b/tests/misc/seq-io-errors.sh
> new file mode 100644
___________________^^^

maint.mk: Please make test executable: tests/misc/seq-io-errors.sh
cfg.mk:120: recipe for target 'sc_tests_executable' failed
make: *** [sc_tests_executable] Error 1


> index 0000000..ac44ca2
> --- /dev/null
> +++ b/tests/misc/seq-io-errors.sh
> @@ -0,0 +1,48 @@
> +#!/bin/sh
> +# Test for proper detection of I/O errors in seq
> +
> +# Copyright (C) 2016 Free Software Foundation, Inc.
> +
> +# This program is free software: you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation, either version 3 of the License, or
> +# (at your option) any later version.
> +
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +
> +# You should have received a copy of the GNU General Public License
> +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
> +
> +. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
> +print_ver_ seq
> +
> +if ! test -w /dev/full || ! test -c /dev/full; then
> +  skip_ '/dev/full is required'
> +fi
> +
> +# Run 'seq' with a timeout, preventing infinite-loop run.
> +# if seq fails (returns 1) - the test passed.
> +# if seq times-out (timeout forces exitcode of 124) - the test failed.
> +# any other code - framework failure.
> +timed_seq_fail() { returns_ 1 timeout 10 seq "$@" >/dev/full 2>/dev/null; }

The comment somehow doesn't seem to match anymore.

> +# Test infinite sequence, using fast-path method (seq_fast).
> +timed_seq_fail 1 inf

s/$/ || fail=1/

returns_ only ensures that $? = 1, but doesn't set fail=1
Therefore, this would pass with the previous seq.c!

Maybe we'd add a syntax-check for this one day, so I'd suggest

  timed_seq_fail() { timeout 10 seq "$@" >/dev/full 2>/dev/null; }

  returns_ 1 timed_seq_fail 1 inf || fail=1


> +# Test infinite sequence, using slow-path method (print_numbers).
> +timed_seq_fail 1.1 .1 inf

Likewise.

> +# Test non-infinite sequence, using slow-path method (print_numbers).
> +# (despite being non-infinite, the entire sequence should take long time to
> +#  print. Thus, either an I/O error is detected immedaitely, or seq will
> +#  timeout).
> +timed_seq_fail 1 0.0001 99999999

Likewise.

> +(trap '' PIPE; timeout 10 sh -c 'seq inf 2>err | head -n1') || fail=1
> +compare /dev/null err || fail=1
> +
> +Exit $fail

seq.c looks good to me.

Have a nice day,
Berny


From MAILER-DAEMON Tue Apr 05 05:12:31 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1anN2F-0003Fh-K2
	for mharc-coreutils@gnu.org; Tue, 05 Apr 2016 05:12:31 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:45738)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1anN29-0003Ds-7y
	for coreutils@gnu.org; Tue, 05 Apr 2016 05:12:29 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1anN24-0000c4-4R
	for coreutils@gnu.org; Tue, 05 Apr 2016 05:12:25 -0400
Received: from mout.kundenserver.de ([217.72.192.75]:61179)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1anN23-0000bh-QX
	for coreutils@gnu.org; Tue, 05 Apr 2016 05:12:20 -0400
Received: from [192.168.101.10] ([217.86.64.216]) by mrelayeu.kundenserver.de
	(mreue103) with ESMTPSA (Nemesis) id 0M0KWj-1bh8Rw0kXN-00uZqq;
	Tue, 05 Apr 2016 11:12:17 +0200
Subject: Re: [PATCH] yes: avoid redundant diagnostics on write error
To: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>, coreutils@gnu.org
References: <1459772420-13676-1-git-send-email-P@draigBrady.com>
From: Bernhard Voelker <mail@bernhard-voelker.de>
Message-ID: <5703816F.2080402@bernhard-voelker.de>
Date: Tue, 5 Apr 2016 11:12:15 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.6.0
MIME-Version: 1.0
In-Reply-To: <1459772420-13676-1-git-send-email-P@draigBrady.com>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 8bit
X-Provags-ID: V03:K0:e5rIRm4VH183i91Uq16hEjkhEtfm8D8VDfCuiijA+kR0FgamVaL
	9PY0fIzZ0iPSRnPxqXe2j0rFJkboBi867xIzUbDdCw9qVkU24ctl9ztSKMN4sf7iypJxXRl
	z+1yPpTq3s3KYS99m8KO6zgV7bH90tY/xB6O8IA2TiVuZrbuFxDX2w0VSVUgSw7jHTz56t/
	y8HN12OfUsYTK/T9Tw/Xw==
X-UI-Out-Filterresults: notjunk:1;V01:K0:cP8ePv2FEcw=:nOzLupn9xYAL+OBTmijv9u
	QmIVhwtPTZwZGbzjLanDI90QfIvs/uRQl3DTvbZmYLDxr0Zd4bIZvlllHzaGE35qCmciyWT1f
	LSi53TjpKY5Dd4b3+tx0TKtR9pMCJxJeW9CI7k7jDnUlPOlXh9vgqWv9iuIEaBGUOL8ZZHJO7
	H9KRE4Mw/DGLhcFLQb4GvUKetz0njCaZ+UR+wzP4enhYRbuPNRGr8hJYrlCbEv33ojBo6W5EZ
	5mWiNW9mp1qTFh1qGMYUXuxiuq9yLviG82b+OVA5beC1TyCeT8kU0ij881E+Rd5rI6D8sETaY
	X2CH4JBQ9fYSuvIjzFmqeTX+Mre4i4hYiFQyEmJAaEwgg1ujoY49GWB12K3kHZjgXlXEi+oOZ
	KFAjgHBM22YtSvdQmuDRitGLr9paQfKJ7Sz/X/xIG0cO/bvAmKEs5tvAp78tmjbavkgus/4xp
	vJljwuf+1RH6+iWLIzIw6q6UUHIS9KZHj6n4zX1GaGE9TTfnCSSL9ceqjBnRzV2t64uDX7pv/
	KlkGokeBmi2qhTXb8IZP1Ga1+gJ34Sped1ydvEgAbY6OuYcMAQNEB27ZiDtWug9FW2929lWlB
	noeIyF/OKvDwisfS9g8wn+FgzZAAuY4zG+blun6xbMJgvnkUaC1VGoRWiQ9LpdCMDFTjWu1Gn
	YOA1ZSqraOewqN+KKxTA+ta32RVCUOPS3Wyxjs+2JL1oqCnQQ0WHYtPjWGGkEjVS6w2DaXTpt
	P8Qv5ULJoflXlTjv
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 217.72.192.75
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 05 Apr 2016 09:12:29 -0000

On 04/04/2016 02:20 PM, Pádraig Brady wrote:
> * src/yes.c (main): For large inputs only write a single
> diagnostic for write errors.
> * tests/misc/yes.sh: Test when /dev/full is available.

Nice catch!

The patch per se LGTM ... but while at it, you may want to fix this
in tests/misc/yes.sh (right before your addition):


+ external true 1 2 3 4 5 6[...] 3998 3999 4000
./tests/misc/yes.sh: line 35: external: command not found

Introduced in v8.24-82-gf720844.

Thanks & have a nice day,
Berny


From MAILER-DAEMON Tue Apr 05 10:20:22 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1anRqA-0007H4-Cy
	for mharc-coreutils@gnu.org; Tue, 05 Apr 2016 10:20:22 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:55798)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1anRq5-0007Fh-37
	for coreutils@gnu.org; Tue, 05 Apr 2016 10:20:20 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1anRpz-0000iu-0A
	for coreutils@gnu.org; Tue, 05 Apr 2016 10:20:17 -0400
Received: from mx1.redhat.com ([209.132.183.28]:35219)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1anRpy-0000ik-OS
	for coreutils@gnu.org; Tue, 05 Apr 2016 10:20:10 -0400
Received: from int-mx09.intmail.prod.int.phx2.redhat.com
	(int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by mx1.redhat.com (Postfix) with ESMTPS id 5054291FCD;
	Tue,  5 Apr 2016 14:20:10 +0000 (UTC)
Received: from [10.3.113.124] (ovpn-113-124.phx2.redhat.com [10.3.113.124])
	by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id u35E2E22006354; Tue, 5 Apr 2016 10:02:18 -0400
Subject: Re: Whats the reason to suppress short unicode characters in printf?
To: Jim Meyering <jim@meyering.net>, Ingo Krabbe <ikrabbe.ask@gmail.com>,
	Coreutils <coreutils@gnu.org>
References: <383774da0bc1985fb0263d469529e52f@yourdomain.dom>
	<20160405024356.GC6588@vapier.lan>
	<CA+8g5KGmdXvcUsSiceJ=LZp49yoUE9yW+BM6D=VpZetvZMLmfg@mail.gmail.com>
From: Eric Blake <eblake@redhat.com>
Openpgp: url=http://people.redhat.com/eblake/eblake.gpg
Organization: Red Hat, Inc.
Message-ID: <5703C566.2090804@redhat.com>
Date: Tue, 5 Apr 2016 08:02:14 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.7.1
MIME-Version: 1.0
In-Reply-To: <CA+8g5KGmdXvcUsSiceJ=LZp49yoUE9yW+BM6D=VpZetvZMLmfg@mail.gmail.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="N0Q9VswCeEbjXp5BVtu0Elh0xAPshIPkE"
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 209.132.183.28
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 05 Apr 2016 14:20:20 -0000

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--N0Q9VswCeEbjXp5BVtu0Elh0xAPshIPkE
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 04/04/2016 10:01 PM, Jim Meyering wrote:
> On Mon, Apr 4, 2016 at 7:43 PM, Mike Frysinger <vapier@gentoo.org> wrot=
e:
>> the code as written has existed since it was first committed in Mar 20=
00:
>> http://git.savannah.gnu.org/cgit/coreutils.git/commit/?h=3D29d3ba4a7b4=
2ed1b40b963b6047f2412ea4843b1
>> although the Author says Jim, the ChangeLog file says Bruno Haible.
>>
>> that predates the merge of file/text/shell utils into coreutils (2003)=
,
>> and printf was part of the shellutils project.  unfortunately the hist=
ory
>> is pretty spotty that far back ... here's its mailing list archive:
>>         https://lists.gnu.org/archive/html/bug-sh-utils/
>>
>> so i guess really you'd have to ask Bruno and/or Jim.  my guess is tha=
t
>> it comes from the C standard:
>>         http://c0x.coding-guidelines.com/6.4.3.html
>> and you might find this interesting:
>>         http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.=
html
>>         http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3881.=
pdf
>=20
> I confirm it was a patch by Bruno Haible.
> I have a copy of a message from him with the following changes
> that appears to have been sent only to Markus Kuhn and me.
> As he explained, these changes were motivated by the then-recent
> approval of ISO C99. Here are the ChangeLog entries:

That said, it may be time to consider teaching coreutils to accept ALL
\uXXXX escapes, rather than just the ones required by C99, as an
extension for ease of use.

--=20
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


--N0Q9VswCeEbjXp5BVtu0Elh0xAPshIPkE
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJXA8VmAAoJEKeha0olJ0NqxPwH/iNsgMHYLm6LYFGckaRfFtM9
932B20uKtmDu9ZuslPOElkniUj6zOtUtUbrlacCZu8QwzD4si356h81rxpZD6JBM
5OEPaJgyV8J371wJnfNrsfTqh01wi8EnlLb5y6FuX2zJwyZkhuTKEdcIAERzPJS0
boq5O2Vhnhm0WbjqDZYyKIsZ5lshc3lsp5QEpqmkDdmGGlIU4kmlhqcl98kkUqb+
rqcerA+mqCQj6MccYLtXlMGLwuniD5tUIUalTuxQfUY7BsMgilafyHr7KW4ofOQU
hsoJhqrcOfTm7hiXsgf99BClmHJ6ZYVUp1J86Y5HHsN1eK4mBGOYLUXM/GgyAI0=
=cQ9e
-----END PGP SIGNATURE-----

--N0Q9VswCeEbjXp5BVtu0Elh0xAPshIPkE--


From MAILER-DAEMON Tue Apr 05 15:20:54 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1anWX0-0005GI-2d
	for mharc-coreutils@gnu.org; Tue, 05 Apr 2016 15:20:54 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:55413)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1anWWx-0005Fh-Nr
	for coreutils@gnu.org; Tue, 05 Apr 2016 15:20:52 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1anWWw-0007TE-Q1
	for coreutils@gnu.org; Tue, 05 Apr 2016 15:20:51 -0400
Received: from mail-oi0-x22e.google.com ([2607:f8b0:4003:c06::22e]:33140)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1anWWw-0007T9-LJ
	for coreutils@gnu.org; Tue, 05 Apr 2016 15:20:50 -0400
Received: by mail-oi0-x22e.google.com with SMTP id w85so30092081oiw.0
	for <coreutils@gnu.org>; Tue, 05 Apr 2016 12:20:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:sender:in-reply-to:references:from:date:message-id
	:subject:to:cc:content-transfer-encoding;
	bh=B6/CP9oZZZ8kt6dyUzri5Ha9kWlt4CbRKEqPl2oWWhE=;
	b=T9goMhU2WE3/h8onwMkFHxKGp5zXMQ6EyM2RwTUrP7dd7W3rocZyNRnxpFC/LKrzsJ
	cBFGt0f+Lw09XbelCEhYnpm6z3SwKIxNbCFgs9Qm5zW5zUu7Ax6wXL78y54T/dFSf8zQ
	QHpfxuJrpXKVM9XjwSRkTKylVO6KxIYBSiUmro0gl6WVTMHLpC+XUQlSpYFnm5L7Ul9t
	mGRZonkLCe/DJikwavsLX5KR/olodoh+pc6KICm+lLjRxOpbLeuzSnr5ZGzYOW531/EP
	gieyxNSP2xtG5mhviOkFnkUZo/tsH0+XSX7SJG365N6UXDL0t+Gr1KaklOMyDtnkZckd
	XBkQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
	:date:message-id:subject:to:cc:content-transfer-encoding;
	bh=B6/CP9oZZZ8kt6dyUzri5Ha9kWlt4CbRKEqPl2oWWhE=;
	b=Qz0cHgs1BnUFLwCQuhz8pGW/A0a+aehLDgmkgMA+2/Y8h/OI99ttH+DXcrgx9gjzBW
	9TwOlFkzbYd8akQ+PyCgT/YBa8awGheADymXgy8R/opZ19TH0xUx8Akr7vF/2FLRPDgB
	QPTAdfzy14ebk0kNh/W1UUDdBlyLDLcvxTUK6bGvGBwjvh3pAd5iJ9ji7gglxt0AOBgH
	wzvB8q53Fr0MchywozOCk0UnOMEEGfSNQ1D9npCBipMxpbNN51UtrLKzjsfD2Ms5gDLF
	PAE2/Ui43Sf6/Nhd8Y3FAE89UzGvjEsGoCt090S+t29sgdQ3ZMx/f+G3CidUkRBOGbeY
	Nn7A==
X-Gm-Message-State: AD7BkJJZFK9afZzge4HlwiX+vcn1QWcuK1tCT6Yacl3L/8dV1+15z52MwbrQM21IS+4Y4h0RxpI6pdOK0ud13Q==
X-Received: by 10.202.218.133 with SMTP id r127mr14360368oig.36.1459884050107; 
	Tue, 05 Apr 2016 12:20:50 -0700 (PDT)
MIME-Version: 1.0
Sender: meyering@gmail.com
Received: by 10.202.213.141 with HTTP; Tue, 5 Apr 2016 12:20:30 -0700 (PDT)
In-Reply-To: <5703816F.2080402@bernhard-voelker.de>
References: <1459772420-13676-1-git-send-email-P@draigBrady.com>
	<5703816F.2080402@bernhard-voelker.de>
From: Jim Meyering <jim@meyering.net>
Date: Tue, 5 Apr 2016 12:20:30 -0700
X-Google-Sender-Auth: D7rvbyqepmWYQn-Zw_PQ1WAN57U
Message-ID: <CA+8g5KHABg__5t_O-91WLtXnXV9rzyOQLAHfxS61LiryZ77+kQ@mail.gmail.com>
Subject: Re: [PATCH] yes: avoid redundant diagnostics on write error
To: Bernhard Voelker <mail@bernhard-voelker.de>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2607:f8b0:4003:c06::22e
Cc: Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 05 Apr 2016 19:20:53 -0000

On Tue, Apr 5, 2016 at 2:12 AM, Bernhard Voelker
<mail@bernhard-voelker.de> wrote:
> On 04/04/2016 02:20 PM, P=C3=A1draig Brady wrote:
>> * src/yes.c (main): For large inputs only write a single
>> diagnostic for write errors.
>> * tests/misc/yes.sh: Test when /dev/full is available.
>
> Nice catch!
>
> The patch per se LGTM ... but while at it, you may want to fix this
> in tests/misc/yes.sh (right before your addition):
>
>
> + external true 1 2 3 4 5 6[...] 3998 3999 4000
> ./tests/misc/yes.sh: line 35: external: command not found
>
> Introduced in v8.24-82-gf720844.

IMHO, it's better to put back the "env" and simply eliminate
the "external=3Denv" and "$external" uses, since "external" is
almost a misnomer, when used in this context. What it
intends to say is "non-built-in", whereas "external" could
be interpreted as "not from coreutils", which is not the intent at all.

Just think of using the "env " prefix as an idiom that is finally
becoming more well known.


From MAILER-DAEMON Tue Apr 05 23:47:46 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1aneRW-0002jq-BG
	for mharc-coreutils@gnu.org; Tue, 05 Apr 2016 23:47:46 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:46519)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <alad@archlinux.info>) id 1ane18-0005Ng-4l
	for coreutils@gnu.org; Tue, 05 Apr 2016 23:20:30 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <alad@archlinux.info>) id 1ane14-0006sh-Pt
	for coreutils@gnu.org; Tue, 05 Apr 2016 23:20:30 -0400
Received: from mail.archlinux.info ([78.129.137.222]:44930)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <alad@archlinux.info>) id 1ane14-0006sb-Io
	for coreutils@gnu.org; Tue, 05 Apr 2016 23:20:26 -0400
Received: from [192.168.1.3] (ip-213-49-101-251.dsl.scarlet.be
	[213.49.101.251])
	by mail.archlinux.info (Postfix) with ESMTPSA id 65FA9A60009
	for <coreutils@gnu.org>; Wed,  6 Apr 2016 04:06:16 +0100 (BST)
To: coreutils@gnu.org
From: Alad Wenter <alad@archlinux.info>
Subject: tsort: "odd input of tokens" with paired input
Message-ID: <57047FAD.10304@archlinux.info>
Date: Wed, 6 Apr 2016 05:17:01 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.7.1
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 78.129.137.222
X-Mailman-Approved-At: Tue, 05 Apr 2016 23:47:45 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Apr 2016 03:20:31 -0000

Hello,

When trying to run tsort on a moderately large paired list, I get:

tsort: -: input contains an odd number of tokens

However, both columns have the same amount of entries:

awk '{print $1}' pre_tsort.txt | wc -l
637

awk '{print $2}' pre_tsort.txt | wc -l
637

The data in question (first column is a package, the second a 
dependency) is available here:

https://ptpb.pw/c1Vu

What am I missing?

Cheers,

Alad


From MAILER-DAEMON Wed Apr 06 03:55:55 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1aniJf-0002Pq-Gz
	for mharc-coreutils@gnu.org; Wed, 06 Apr 2016 03:55:55 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:53698)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <piotr.r.public@gmail.com>) id 1anhph-0005fR-3p
	for coreutils@gnu.org; Wed, 06 Apr 2016 03:24:57 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <piotr.r.public@gmail.com>) id 1anhpg-000545-6p
	for coreutils@gnu.org; Wed, 06 Apr 2016 03:24:57 -0400
Received: from mail-ob0-x22e.google.com ([2607:f8b0:4003:c01::22e]:35544)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <piotr.r.public@gmail.com>) id 1anhpg-00053Y-2J
	for coreutils@gnu.org; Wed, 06 Apr 2016 03:24:56 -0400
Received: by mail-ob0-x22e.google.com with SMTP id fp4so25593729obb.2
	for <coreutils@gnu.org>; Wed, 06 Apr 2016 00:24:55 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc; bh=4qX41O0DVUOBXEG/LGYLwndiJaJCPL0r0Ytpckv3Z0Q=;
	b=kw3UNbdVvM4poTQ4GXCGQHwaDIaAB7ssw0AY7lVD6bhBvz8BEl6AEHCYJGjbrpLs6e
	RNJFMshRklJQbOYi3xUZzqzKSa16rW3/AgK0jhmD4Z5wPqBTOOJYIPp6vIJexIAvG3mu
	Rt49uN9HghleVhjchPzDq5D7HzPWWlgkEnodpQoPXOcKmy6B9KPssKmCHRKqJM7RmFSi
	WsjStkj8l5yRnWqBzEBRKftVm6DAzvmxsaNubVyqkzK2tdflnM7UCwNmRvFvbPpmt3Ri
	Rq34epwTYrDsMemY08C0zAiBhQwEAE83FpRU/gPsRHt23GmlMYMo9hkYMqfu6ZHNjIT7
	WQgg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:cc;
	bh=4qX41O0DVUOBXEG/LGYLwndiJaJCPL0r0Ytpckv3Z0Q=;
	b=ivMqwqz1/XX0QmU0xmACbniNpUuPziz3Sv2aI9EubEhSvE2GpZWhFpGTZpAqeMU2jU
	ztoptL4DO4HAXRcKTsDuqhfBgGKyoyEo4o0KX4U5UeflhH0jgd6BwISIbEpTPRsnHCU9
	lo4Lt1lOdrBgZAgdWXhBrBklYihLJltrDN0D+sZPLt8iJueEVrDkq6nbHgIoy77K+RIl
	hD2wbCD4H2/veE0Ao+199CJ15N/bseW3nAoS+lsFzecY2SX5xUxDD19i9G8lfhY/R5Fv
	WqTW2sEGk9aTwDbG6bfAAm6BzkhYJ1bDdR29LCzmdjp3bloMDhxEggoMlmBnMIqKxUFF
	5iiw==
X-Gm-Message-State: AD7BkJLPp8lS+Pfk7X9f+sg6ywo4Rxpx6lfveZYthV8whAJ3Jb7IwNRSV9TyqLPP+H8fV09Tb8rP+pbLNH0+8A==
X-Received: by 10.60.47.6 with SMTP id z6mr1667397oem.62.1459927495343; Wed,
	06 Apr 2016 00:24:55 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.202.74.22 with HTTP; Wed, 6 Apr 2016 00:24:35 -0700 (PDT)
In-Reply-To: <57047FAD.10304@archlinux.info>
References: <57047FAD.10304@archlinux.info>
From: Piotr Piecia <piotr.r.public@gmail.com>
Date: Wed, 6 Apr 2016 09:24:35 +0200
Message-ID: <CA+2znwNFgAD13nf+i9wxgMKso7T4wwWBJWBYU_zr2cF1AcKztQ@mail.gmail.com>
Subject: Re: tsort: "odd input of tokens" with paired input
To: Alad Wenter <alad@archlinux.info>
Content-Type: text/plain; charset=UTF-8
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2607:f8b0:4003:c01::22e
X-Mailman-Approved-At: Wed, 06 Apr 2016 03:55:53 -0400
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Apr 2016 07:24:58 -0000

2016-04-06 5:17 GMT+02:00 Alad Wenter <alad@archlinux.info>:
> What am I missing?
Because you have the third column:

awk '{if ($3 != "") print $3;}' pre_tsort.txt | wc -l
5

-- 
Best regards Piotr


From MAILER-DAEMON Wed Apr 06 09:31:20 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1annYG-00066R-38
	for mharc-coreutils@gnu.org; Wed, 06 Apr 2016 09:31:20 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:55767)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <michael.antosha@gmail.com>) id 1ankxr-0005NZ-0G
	for coreutils@gnu.org; Wed, 06 Apr 2016 06:45:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <michael.antosha@gmail.com>) id 1ankxp-0002Nw-Cu
	for coreutils@gnu.org; Wed, 06 Apr 2016 06:45:34 -0400
Received: from mail-vk0-x235.google.com ([2607:f8b0:400c:c05::235]:35047)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <michael.antosha@gmail.com>) id 1ankxo-0002Nd-Vr
	for coreutils@gnu.org; Wed, 06 Apr 2016 06:45:33 -0400
Received: by mail-vk0-x235.google.com with SMTP id e6so52818391vkh.2
	for <coreutils@gnu.org>; Wed, 06 Apr 2016 03:45:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to; 
	bh=yJ+AzB23pm0bQVRM8ovZI8c2fbi6OMp+47MHfLi6YQg=;
	b=gLRYRg4UtPQogKxpOOhbV/LbVDKrt4HSfNWol7+PMuZ+/KWHOCdQYuSr3mbQm7W7Je
	jK0rPLwEfUmGBbXAeYt5OwBOlZRM2wx6bLM2h1WZNK/nP+yMd0GeYEhbo6GvwZlEWkh3
	C/i1h9qAAxkuriiAYaIndAkAgAe/N2wBcrCTijV34gXcivAUAW6yQfCFoioPx4jKMM9y
	9+svWuLOnQWJH7EGP+JupIwWTiBZ66csCijp1wJtHPwubUClbj0DjqbwXK5MvjNbW2Dj
	o1fxotiOIhkc7OO/lvmT0kLdU+UW8R6+QE1xSj158yzTb4MFvAmuuuKg7YmI2ychvPG5
	pt8Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:mime-version:in-reply-to:references:date
	:message-id:subject:from:to;
	bh=yJ+AzB23pm0bQVRM8ovZI8c2fbi6OMp+47MHfLi6YQg=;
	b=fCQHLv4jb7DpRyaOw1Wgqn+3lGtLK8d3YIGNrJHYdlI01OCxl8ic0yqnyZFNQFcBfZ
	JaDV0RgMUwjIVV6pNja1QGZZZnzWxDpSU9gH8+Dx/CSiUwHrOLDFbXUESi3JW4bue2U0
	vq9si18eboAYzUt5JSXdGiw+n1G31Xs59Ora5XLlWnRpgPH0/XK4lwKOiVTHkQQ9SQu6
	E3MewrXcIMklNQB1SsIIL4qsAw5jLBqsYqZCoG1N/3uxSWwtaWu08SvxwbpybIoiQ9ij
	lXACpWLt9wS/T6pqr5El8RQdLP84HJ8UuB5HJnrykktH7zgF3NPB7fyWEOkrLAvfH213
	S4iA==
X-Gm-Message-State: AD7BkJJiYFWbHBjLG1Rxi39Lky3wBjKd+Yhdc4mIxV8ZXivxRRRJM+8twnB7QLzszEUJBICl7qMSpSACfTB+5Q==
MIME-Version: 1.0
X-Received: by 10.31.131.76 with SMTP id f73mr7417124vkd.148.1459939531825;
	Wed, 06 Apr 2016 03:45:31 -0700 (PDT)
Received: by 10.176.69.231 with HTTP; Wed, 6 Apr 2016 03:45:31 -0700 (PDT)
In-Reply-To: <57047FAD.10304@archlinux.info>
References: <57047FAD.10304@archlinux.info>
Date: Wed, 6 Apr 2016 13:45:31 +0300
Message-ID: <CABUXKX7WFRKer0CkqYGQ9mEpsFewNoqjb4RDokdNo4AyeoNy+Q@mail.gmail.com>
Subject: Re: tsort: "odd input of tokens" with paired input
From: "Michael V. Antosha" <michael.antosha@gmail.com>
To: Alad Wenter <alad@archlinux.info>, coreutils@gnu.org
Content-Type: text/plain; charset=UTF-8
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2607:f8b0:400c:c05::235
X-Mailman-Approved-At: Wed, 06 Apr 2016 09:31:18 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Apr 2016 10:45:36 -0000

Hello Alad,


On 4/6/16, Alad Wenter <alad@archlinux.info> wrote:
> Hello,
>
> When trying to run tsort on a moderately large
> paired list, I get:
>
> tsort: -: input contains an odd number of
> tokens

I think, 'tsort' needs improvement to make its
diagnostics more convenient for practical use
cases (input line number could help in this
case).


> However, both columns have the same amount of
> entries:
>
> awk '{print $1}' pre_tsort.txt | wc -l
> 637
>
> awk '{print $2}' pre_tsort.txt | wc -l
> 637

Your commands does not seem to support your
statement.


1) The commands will output 637 for any field
number of your file.  Try, this, for exmaple:

    awk '{print $9}' pre_tsort.txt | wc -l

Remove empty lines before passing data to 'wc' if
you want to count lines containing a non-empty
value in a field you test.


2) What if your file contains lines with more
than two fields?...  Particularly, you did not
checked this:

    awk '{print $3}' pre_tsort.txt | egrep -v '^$' | wc -l


3) You could also try idea of binary search to
find out exactly (in less than 15 simple steps
for the case of 637 lines) which line of your
file introduces the problem:

head -1 pre_tsort.txt | tsort  # success
head -637 pre_tsort.txt | tsort  # error
head -319 pre_tsort.txt | tsort  # error
head -160 pre_tsort.txt | tsort  # error
head -80 pre_tsort.txt | tsort  # success
head -120 pre_tsort.txt | tsort  # error
head -100 pre_tsort.txt | tsort  # error
head -90 pre_tsort.txt | tsort  # error
head -85 pre_tsort.txt | tsort  # success
head -87 pre_tsort.txt | tsort  # success
head -88 pre_tsort.txt | tsort  # success
head -89 pre_tsort.txt | tsort  # success
# First 89 lines are okay.  Line 90 is bad.


Best regards,
Michael.


-- 
Michael V. Antosha
http://mivael.in.ua
xmpp:m@mivael.in.ua   (Jabber ID)


From MAILER-DAEMON Wed Apr 06 09:51:42 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1annry-0001FJ-6H
	for mharc-coreutils@gnu.org; Wed, 06 Apr 2016 09:51:42 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:42475)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1annrv-0001AC-Br
	for coreutils@gnu.org; Wed, 06 Apr 2016 09:51:40 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1annrs-0006yQ-36
	for coreutils@gnu.org; Wed, 06 Apr 2016 09:51:39 -0400
Received: from mail-qg0-x232.google.com ([2607:f8b0:400d:c04::232]:33832)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1annrr-0006yF-Uw
	for coreutils@gnu.org; Wed, 06 Apr 2016 09:51:36 -0400
Received: by mail-qg0-x232.google.com with SMTP id c6so36212855qga.1
	for <coreutils@gnu.org>; Wed, 06 Apr 2016 06:51:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to;
	bh=+cZ4rRV7RY3WCMTmyWN8LHAPioo0e8d+4ZFOEp0lpKw=;
	b=iY+1ZY7YzTh1FJ5/Q4TPcuOBS+sI3O6hpwqc2CQW9fryLqqrw6wMgipPgJeAK7u77W
	atSKxbpyVq8MEzlG+NcvYPCkIMEne+9hoG+rfKNZTGzp5LcCCAuoo25oYa+sTZzYHgDm
	1dH78n6LFTYg4ZTLcamh+3ENkBx86dSKV+vBIn3HPgm7skyfi/RVYv6QVFoUiEVAFjLG
	LfGHgzOFDluvlrtNsqlVOoAhZg+vm3pmCs2MpQukVPKOn/pjAz40Ug/4oQteFuExFhVq
	7yhl/JZYGrIi+edKvTOOvmbe58bpERmS3tAyibm7pKfkZZl7UdxkK4RV/yU3l3J7d2bw
	WDxA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to;
	bh=+cZ4rRV7RY3WCMTmyWN8LHAPioo0e8d+4ZFOEp0lpKw=;
	b=HHChHQ0Z2Y2QlCQQgG6I0htrFdu9OmAafejltZqHXA7HJtLoVBbe5qeorQ/jh4y1kP
	dRAOvthCcHfN2xsa++Dh7ufyxCxmomNoe/xsIVMFdbb+wZuZVu0qVrtlgrkTgdBocVHg
	jwMiYkVJMpbfR3ECKrEQ5tPTVB8nHlpOzpfexd8+9smOYZqxhX18Ydo6A39CEnc+iwqP
	DKJn6pQq4QJhL95o5mw6+5r9SgWUgjQqlZ10H/XbmzyTNfeO39Iwc+5T/Om3W0nGfwIh
	dG5V+hLOeVgNBJIVExN3NELR6M2zVWpmGxpsYOKt8hi4Nzhk5ZfgGVAbJ/mgODn658Wx
	DF7A==
X-Gm-Message-State: AD7BkJLGlJ1QPUfBxVCrq7XdDmpo0yxENpT32AmQZ2njCsqvQh2ZCjm3L8YQYFUS90aXxA==
X-Received: by 10.140.177.87 with SMTP id x84mr25388401qhx.39.1459950695186;
	Wed, 06 Apr 2016 06:51:35 -0700 (PDT)
Received: from [10.0.215.16] (ool-addc4864.static.optonline.net.
	[173.220.72.100]) by smtp.gmail.com with ESMTPSA id
	a66sm1316851qkb.20.2016.04.06.06.51.34
	(version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
	Wed, 06 Apr 2016 06:51:34 -0700 (PDT)
Content-Type: text/plain; charset=us-ascii
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\))
Subject: Re: tsort: "odd input of tokens" with paired input
From: Assaf Gordon <assafgordon@gmail.com>
In-Reply-To: <CABUXKX7WFRKer0CkqYGQ9mEpsFewNoqjb4RDokdNo4AyeoNy+Q@mail.gmail.com>
Date: Wed, 6 Apr 2016 09:51:33 -0400
Content-Transfer-Encoding: quoted-printable
Message-Id: <0DFE6507-E445-4A50-B7A0-1DE5AF1A6C07@gmail.com>
References: <57047FAD.10304@archlinux.info>
	<CABUXKX7WFRKer0CkqYGQ9mEpsFewNoqjb4RDokdNo4AyeoNy+Q@mail.gmail.com>
To: "Michael V. Antosha" <michael.antosha@gmail.com>
X-Mailer: Apple Mail (2.2102)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2607:f8b0:400d:c04::232
Cc: Coreutils <coreutils@gnu.org>, Alad Wenter <alad@archlinux.info>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Apr 2016 13:51:40 -0000

Hello,

> On Apr 6, 2016, at 06:45, Michael V. Antosha =
<michael.antosha@gmail.com> wrote:
> On 4/6/16, Alad Wenter <alad@archlinux.info> wrote:
>> Hello,
>>=20
>> When trying to run tsort on a moderately large
>> paired list, I get:
>>=20
>> tsort: -: input contains an odd number of
>> tokens
> head -89 pre_tsort.txt | tsort  # success
> # First 89 lines are okay.  Line 90 is bad.

<shameless plug>

The recent version of GNU Datamash ( http://gnu.org/s/datamash ) has a =
new operation 'check' to quickly diagnose cases like this (non-tabular =
file structure) and provide verbose report of the problem.

Example:

    $ curl -s https://ptpb.pw/c1Vu > test.txt
    $ datamash -W check < test.txt
    line 89 (2 fields):
     cower cower
    line 90 (3 fields):
     deluge-labelplus deluge gtk2
    datamash: check failed: line 90 has 3 fields (previous line had 2)


The '-W' parameter tells datamash to use whitespace as field-separator =
(default is tab).
</shameless plug>


regards,
 - assaf



From MAILER-DAEMON Wed Apr 06 13:47:14 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1anrXu-0002Tg-UZ
	for mharc-coreutils@gnu.org; Wed, 06 Apr 2016 13:47:14 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:36072)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@kth.se>) id 1anqxr-0002Oq-8Y
	for coreutils@gnu.org; Wed, 06 Apr 2016 13:10:00 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <maandree@kth.se>) id 1anqxn-0007xG-4o
	for coreutils@gnu.org; Wed, 06 Apr 2016 13:09:59 -0400
Received: from smtp-4.sys.kth.se ([130.237.48.193]:43542)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@kth.se>) id 1anqxm-0007wo-Pj
	for coreutils@gnu.org; Wed, 06 Apr 2016 13:09:55 -0400
Received: from smtp-4.sys.kth.se (localhost.localdomain [127.0.0.1])
	by smtp-4.sys.kth.se (Postfix) with ESMTP id A7ABC4D3;
	Wed,  6 Apr 2016 19:09:51 +0200 (CEST)
X-Virus-Scanned: by amavisd-new at kth.se
Received: from smtp-4.sys.kth.se ([127.0.0.1])
	by smtp-4.sys.kth.se (smtp-4.sys.kth.se [127.0.0.1]) (amavisd-new,
	port 10024)
	with LMTP id xIZx9wM-wgfO; Wed,  6 Apr 2016 19:09:50 +0200 (CEST)
X-KTH-Auth: maandree [81.228.219.220]
X-KTH-mail-from: maandree@kth.se
Received: from localhost.localdomain (h220n13-jak-a12.ias.bredband.telia.com
	[81.228.219.220])
	by smtp-4.sys.kth.se (Postfix) with ESMTPSA id 0941820C;
	Wed,  6 Apr 2016 19:09:49 +0200 (CEST)
From: maandree@member.fsf.org
To: coreutils@gnu.org
Subject: [PATCH] test: Add unary operator -E: test that a file is an empty
	directory
Date: Wed,  6 Apr 2016 19:09:32 +0200
Message-Id: <1459962572-31799-1-git-send-email-maandree@member.fsf.org>
X-Mailer: git-send-email 2.8.0
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 130.237.48.193
X-Mailman-Approved-At: Wed, 06 Apr 2016 13:47:13 -0400
Cc: =?UTF-8?q?Mattias=20Andr=C3=A9e?= <maandree@member.fsf.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Apr 2016 17:10:00 -0000

From: Mattias Andr=C3=A9e <maandree@member.fsf.org>

---
 doc/coreutils.texi |  7 ++++++-
 src/test.c         | 44 +++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 49 insertions(+), 2 deletions(-)

diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 45706bd..e399986 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -12420,7 +12420,7 @@ Exit status:
 @end display
=20
 @menu
-* File type tests::             -[bcdfhLpSt]
+* File type tests::             -[bcEdfhLpSt]
 * Access permission tests::     -[gkruwxOG]
 * File characteristic tests::   -e -s -nt -ot -ef
 * String tests::                -z -n =3D =3D=3D !=3D
@@ -12449,6 +12449,11 @@ True if @var{file} exists and is a block special=
 device.
 @cindex character special check
 True if @var{file} exists and is a character special device.
=20
+@item -E @var{file}
+@opindex -E
+@cindex empty directory check
+True if @var{file} exists, is a directory, and is empty.
+
 @item -d @var{file}
 @opindex -d
 @cindex directory check
diff --git a/src/test.c b/src/test.c
index 8ac7467..eb9c43a 100644
--- a/src/test.c
+++ b/src/test.c
@@ -27,6 +27,7 @@
 #endif
=20
 #include <config.h>
+#include <dirent.h>
 #include <stdio.h>
 #include <sys/types.h>
=20
@@ -179,6 +180,39 @@ get_mtime (char const *filename, struct timespec *mt=
ime)
   return ok;
 }
=20
+/* Return true iff DIR is empty. DIR must be a directory.  */
+static bool
+empty_p (char const *dirname)
+{
+  DIR *dir;
+  struct dirent *de;
+
+  dir =3D opendir (dirname);
+  if (!dir)
+    {
+      error (0, errno, "%s", dirname);
+      test_exit (TEST_FAILURE);
+    }
+
+  while (errno =3D 0, (de =3D readdir (dir)))
+    {
+      if (de->d_name[0] =3D=3D '.')
+        if (de->d_name[1 + (de->d_name[1] =3D=3D '.')] =3D=3D '\0')
+          continue;
+      closedir (dir);
+      return 0;
+    }
+
+  if (errno)
+    {
+      error (0, errno, "%s", dirname);
+      closedir (dir);
+      test_exit (TEST_FAILURE);
+    }
+  closedir (dir);
+  return 1;
+}
+
 /* Return true if S is one of the test command's binary operators.  */
 static bool
 binop (char const *s)
@@ -457,6 +491,12 @@ unary_operator (void)
       return (stat (argv[pos - 1], &stat_buf) =3D=3D 0
               && S_ISDIR (stat_buf.st_mode));
=20
+    case 'E':			/* File is an empty directory? */
+      unary_advance ();
+      return (stat (argv[pos - 1], &stat_buf) =3D=3D 0
+              && S_ISDIR (stat_buf.st_mode)
+              && empty_p (argv[pos - 1]));
+
     case 's':			/* File has something in it? */
       unary_advance ();
       return (stat (argv[pos - 1], &stat_buf) =3D=3D 0
@@ -590,7 +630,8 @@ test_unop (char const *op)
     case 'f': case 'g': case 'h': case 'k': case 'n':
     case 'o': case 'p': case 'r': case 's': case 't':
     case 'u': case 'w': case 'x': case 'z':
-    case 'G': case 'L': case 'O': case 'S': case 'N':
+    case 'E': case 'G': case 'L': case 'O': case 'S':
+    case 'N':
       return true;
     default:
       return false;
@@ -760,6 +801,7 @@ EXPRESSION is true or false and sets exit status.  It=
 is one of:\n\
   -c FILE     FILE exists and is character special\n\
   -d FILE     FILE exists and is a directory\n\
   -e FILE     FILE exists\n\
+  -E FILE     FILE exists and is an empty directory\n\
 "), stdout);
       fputs (_("\
   -f FILE     FILE exists and is a regular file\n\
--=20
2.8.0



From MAILER-DAEMON Wed Apr 06 13:47:16 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1anrXw-0002WD-Mg
	for mharc-coreutils@gnu.org; Wed, 06 Apr 2016 13:47:16 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:37793)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1anr2X-0005Qm-Ak
	for coreutils@gnu.org; Wed, 06 Apr 2016 13:14:50 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1anr2S-0000sk-BA
	for coreutils@gnu.org; Wed, 06 Apr 2016 13:14:49 -0400
Received: from smtp-3.sys.kth.se ([130.237.48.192]:57916)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1anr2S-0000sQ-3f
	for coreutils@gnu.org; Wed, 06 Apr 2016 13:14:44 -0400
Received: from smtp-3.sys.kth.se (localhost.localdomain [127.0.0.1])
	by smtp-3.sys.kth.se (Postfix) with ESMTP id CEE5E26B4
	for <coreutils@gnu.org>; Wed,  6 Apr 2016 19:14:41 +0200 (CEST)
X-Virus-Scanned: by amavisd-new at kth.se
Received: from smtp-3.sys.kth.se ([127.0.0.1])
	by smtp-3.sys.kth.se (smtp-3.sys.kth.se [127.0.0.1]) (amavisd-new,
	port 10024) with LMTP id 2XCuLLdN3HqK for <coreutils@gnu.org>;
	Wed,  6 Apr 2016 19:14:41 +0200 (CEST)
X-KTH-Auth: maandree [81.228.219.220]
X-KTH-mail-from: maandree@member.fsf.org
X-KTH-rcpt-to: coreutils@gnu.org
Received: from localhost.localdomain (h220n13-jak-a12.ias.bredband.telia.com
	[81.228.219.220])
	by smtp-3.sys.kth.se (Postfix) with ESMTPSA id 32C392618
	for <coreutils@gnu.org>; Wed,  6 Apr 2016 19:14:39 +0200 (CEST)
Date: Wed, 6 Apr 2016 19:14:33 +0200
From: Mattias =?UTF-8?B?QW5kcsOpZQ==?= <maandree@member.fsf.org>
To: <coreutils@gnu.org>
Subject: Re: [PATCH] test: Add unary operator -E: test that a file is an
	empty directory
Message-ID: <20160406191433.1b3569a3.maandree@kth.se>
In-Reply-To: <1459962572-31799-1-git-send-email-maandree@member.fsf.org>
References: <1459962572-31799-1-git-send-email-maandree@member.fsf.org>
X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-unknown-linux-gnu)
X-Awesomeness: 120 %
User-Agent: Claws Mail
X-Operating-System: GNU/Linux
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	boundary="Sig_/RC0ze/zIhFoU87LrMuoyElV";
	protocol="application/pgp-signature"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 130.237.48.192
X-Mailman-Approved-At: Wed, 06 Apr 2016 13:47:13 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Apr 2016 17:14:50 -0000

--Sig_/RC0ze/zIhFoU87LrMuoyElV
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Wed, 6 Apr 2016 19:09:32 +0200
<maandree@member.fsf.org> wrote:

> From: Mattias Andr=C3=A9e <maandree@member.fsf.org>

If anyone knows why git send-email inserted
this line it would be helpful. That line
shouldn't be there.

--Sig_/RC0ze/zIhFoU87LrMuoyElV
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJXBUP5AAoJEM4wYJDpiwjH+SoP/08yfoGyTDMTXkr3w6tX8Q5X
aDbP7gbmRx7367jRpkH3rfWx/r8h2drnoEvTZ8zHX2ZiG5SS7kzPUUZtirnvtxu/
YZYNJJPbA5GhWLTBaVOMGvEX9wTdKq2kXHB40uzUyFa//UDkTf/NOi09ocnDI6ul
07qxL4Qn0jOaP7PZW9V98Cvo+bsZVIKMmKvF3EKPUQuzrykqlPyJqFmoHunqsCCD
zJBpVX0rLYyetS0cFzQYwb1wiNaefOs8BE8ItvN4MkVB5P8WnqbiqRXS3P8GZK4s
8roeGkedlt6MJ8sQAQKRTWuOT3fh5Mz6hoRmMClJEyvHqXyxNQSeq1lSFHPVEEi0
mUUF6l8QRz/M3SyoOnNzPtG5GpZ1ZbjEeaNr11JPHrQ4+QYCW4hXzydg3O+QadiR
Amz+CApgoREGkGI2t1+Eh0qrWvH5JftiGPdBzqAEDtqBreSzwC6aCfZL+l8vKBPJ
mqR1BPYj0q+Jxn2aCY7eQq15c6Kf6tzMnr9TZpHZ49eiyRX1/dREpAt8L3npTXRk
QYj9THnVTRzQUPJnoZ7cRPoc+dS4/qKVZNQ9k/J0KcXALoB2aSQ4yKT9Qrmf1fls
MlVWhGbLeqrEil8I66G5mZ42isq5Pi973S5+rdtOJ9nCT9FDFetumIiduMEWsoMw
BIWIOQZKh0beznIGVcdy
=AJBj
-----END PGP SIGNATURE-----

--Sig_/RC0ze/zIhFoU87LrMuoyElV--


From MAILER-DAEMON Wed Apr 06 13:53:35 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1anre3-0006rU-6u
	for mharc-coreutils@gnu.org; Wed, 06 Apr 2016 13:53:35 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:52601)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1anre1-0006rM-3F
	for coreutils@gnu.org; Wed, 06 Apr 2016 13:53:33 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1anrdx-0004zx-SD
	for coreutils@gnu.org; Wed, 06 Apr 2016 13:53:33 -0400
Received: from mx1.redhat.com ([209.132.183.28]:42120)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1anrdx-0004zr-M5
	for coreutils@gnu.org; Wed, 06 Apr 2016 13:53:29 -0400
Received: from int-mx13.intmail.prod.int.phx2.redhat.com
	(int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by mx1.redhat.com (Postfix) with ESMTPS id F2FAF85547;
	Wed,  6 Apr 2016 17:53:28 +0000 (UTC)
Received: from [10.3.113.199] (ovpn-113-199.phx2.redhat.com [10.3.113.199])
	by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id u36HrSSi012812; Wed, 6 Apr 2016 13:53:28 -0400
Subject: Re: [PATCH] test: Add unary operator -E: test that a file is an empty
	directory
To: =?UTF-8?Q?Mattias_Andr=c3=a9e?= <maandree@member.fsf.org>,
	coreutils@gnu.org
References: <1459962572-31799-1-git-send-email-maandree@member.fsf.org>
	<20160406191433.1b3569a3.maandree@kth.se>
From: Eric Blake <eblake@redhat.com>
Openpgp: url=http://people.redhat.com/eblake/eblake.gpg
Organization: Red Hat, Inc.
Message-ID: <57054D17.5090909@redhat.com>
Date: Wed, 6 Apr 2016 11:53:27 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.7.1
MIME-Version: 1.0
In-Reply-To: <20160406191433.1b3569a3.maandree@kth.se>
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="RxT8WhLGhHlQP0KLqXqaIIrGOCnKwaBx2"
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 209.132.183.28
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Apr 2016 17:53:34 -0000

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--RxT8WhLGhHlQP0KLqXqaIIrGOCnKwaBx2
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 04/06/2016 11:14 AM, Mattias Andr=C3=A9e wrote:
> On Wed, 6 Apr 2016 19:09:32 +0200
> <maandree@member.fsf.org> wrote:
>=20
>> From: Mattias Andr=C3=A9e <maandree@member.fsf.org>
>=20
> If anyone knows why git send-email inserted
> this line it would be helpful. That line
> shouldn't be there.

Git does that if your outgoing mail "From:" is different from the git
authorship "From:".  In your case, the difference is that your git
settings did not specify a "Full Name <mail@example.org>" mail line, but
merely an email address "<mail@example.org>"; whereas your authorship
included full name.  You may want to check that your top-level
~/.gitconfig has these settings:

[user]
    name =3D "Full Name"
    email =3D mail@example.com
[sendemail]
    from =3D Full Name <mail@example.com>

so that 'git send-email' won't be forced to assume authorship is
different than mail sender.

--=20
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


--RxT8WhLGhHlQP0KLqXqaIIrGOCnKwaBx2
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJXBU0XAAoJEKeha0olJ0NqwLAH/1O0xvLo66jguqVQcjNv9mqw
uRmi3m+MY+yp2EDaC6EY3PDHitnRXMFbfEZzniKQ1U7TEK1G4VkN5ylCSph/IXaN
122Ka3qDgUQS0SOBFw8vy3YXY7pUhwN9+GLqNERuVdmZnpnll9fBgIV0FGcEHwF1
NpcCrDiVluYLyWrCuX002d0PvQ2oiinY/FiLwxkUCrckZhed5Hl/WStCgxuYZOC2
NiFEn7oyJelfTWCI7QShYV3unpGde7NvAwyq8Jxz8/D0syR+UcZcx44eTbVGUVq5
ttgznQuyzJufKTG1R23tEtNDWw5wfzNxvwJoAKbNyXq3KheRXc86aJCf3KJdV8U=
=0HXK
-----END PGP SIGNATURE-----

--RxT8WhLGhHlQP0KLqXqaIIrGOCnKwaBx2--


From MAILER-DAEMON Wed Apr 06 13:58:20 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1anrid-0002IR-Ok
	for mharc-coreutils@gnu.org; Wed, 06 Apr 2016 13:58:19 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:54662)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1anrib-0002Dp-Gf
	for coreutils@gnu.org; Wed, 06 Apr 2016 13:58:18 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1anriX-0006ir-2P
	for coreutils@gnu.org; Wed, 06 Apr 2016 13:58:17 -0400
Received: from mx1.redhat.com ([209.132.183.28]:45510)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1anriW-0006in-SS
	for coreutils@gnu.org; Wed, 06 Apr 2016 13:58:12 -0400
Received: from int-mx11.intmail.prod.int.phx2.redhat.com
	(int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by mx1.redhat.com (Postfix) with ESMTPS id 706D9C049E1E;
	Wed,  6 Apr 2016 17:58:12 +0000 (UTC)
Received: from [10.3.113.199] (ovpn-113-199.phx2.redhat.com [10.3.113.199])
	by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id u36HwBVA014359; Wed, 6 Apr 2016 13:58:12 -0400
Subject: Re: [PATCH] test: Add unary operator -E: test that a file is an empty
	directory
To: maandree@member.fsf.org, coreutils@gnu.org
References: <1459962572-31799-1-git-send-email-maandree@member.fsf.org>
From: Eric Blake <eblake@redhat.com>
Openpgp: url=http://people.redhat.com/eblake/eblake.gpg
Organization: Red Hat, Inc.
Message-ID: <57054E33.6090300@redhat.com>
Date: Wed, 6 Apr 2016 11:58:11 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.7.1
MIME-Version: 1.0
In-Reply-To: <1459962572-31799-1-git-send-email-maandree@member.fsf.org>
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="GOPV3QhDuwmNoMd2kGckj0E5bmqmT6GrP"
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 209.132.183.28
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Apr 2016 17:58:18 -0000

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--GOPV3QhDuwmNoMd2kGckj0E5bmqmT6GrP
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 04/06/2016 11:09 AM, maandree@member.fsf.org wrote:
> From: Mattias Andr=C3=A9e <maandree@member.fsf.org>
>=20
> ---
>  doc/coreutils.texi |  7 ++++++-
>  src/test.c         | 44 +++++++++++++++++++++++++++++++++++++++++++-
>  2 files changed, 49 insertions(+), 2 deletions(-)


Thanks for the patch, and remembering to document it.  However, it also
needs a NEWS entry and testsuite coverage; by the time you do that, the
patch may be non-trivial enough to need copyright assignment.

Also, the bar for adding new options to 'test' is very high - is there
any other existing practice (say in bash, ksh, zsh, BSD, or elsewhere)
that is already using -E, and if so, are they using it for the same
purpose?  If so, mention it and this patch is worthwhile; if not, I'm a
bit reluctant to be the first inventor, especially if something else
more portable can be used.

On the other hand, I readily concur that "test -s directory" does NOT
accurately report whether the directory has contents, so maybe adding
the new operator has justification on that grounds; it would also be
nice if you could simultaneously propose it on the bash mailing list, so
that multiple GNU programs implement the same semantics at once.

--=20
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


--GOPV3QhDuwmNoMd2kGckj0E5bmqmT6GrP
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJXBU4zAAoJEKeha0olJ0NqmDIH/i9SVTgncGu9grV149ZgMThg
AgTnwcPqK0oDfGP5kwb3ggSMd5oWzJcNTxDBk/TzlTz6m6una2aQnPnOBmcr1hFz
zjxNRT4jufGvaUN5SIQ2VcfQcEnIDiexSqv58JWapKMsp/+l+JAf/ON9+b3seqpn
k65GyjDnjWGkG/W9CHy+asRZQtHDbb1Hp+RSiQuCu/RT9lVKBukUUOJlG7+RhaAQ
YdvTJJCmmBN7jInb9jLvanbO+EGm7scnIcOtHt4/Vyrvm+7r7Bm4MQf6n71+KbjL
blShQfrSJ/3TTk0YIhdLfBChUPiceCQEUCJmCqcO32y2DP5pFmkrm4dxQPQWevU=
=kKJ3
-----END PGP SIGNATURE-----

--GOPV3QhDuwmNoMd2kGckj0E5bmqmT6GrP--


From MAILER-DAEMON Wed Apr 06 14:05:41 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1anrpl-0002UO-1F
	for mharc-coreutils@gnu.org; Wed, 06 Apr 2016 14:05:41 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:57386)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1anrpe-0002SR-25
	for coreutils@gnu.org; Wed, 06 Apr 2016 14:05:39 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1anrpZ-00007D-BT
	for coreutils@gnu.org; Wed, 06 Apr 2016 14:05:33 -0400
Received: from mx1.redhat.com ([209.132.183.28]:44469)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1anrpZ-000077-63
	for coreutils@gnu.org; Wed, 06 Apr 2016 14:05:29 -0400
Received: from int-mx09.intmail.prod.int.phx2.redhat.com
	(int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by mx1.redhat.com (Postfix) with ESMTPS id A776572676;
	Wed,  6 Apr 2016 18:05:28 +0000 (UTC)
Received: from [10.3.113.199] (ovpn-113-199.phx2.redhat.com [10.3.113.199])
	by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id u36I5Swk011634; Wed, 6 Apr 2016 14:05:28 -0400
Subject: Re: [PATCH] test: Add unary operator -E: test that a file is an empty
	directory
To: =?UTF-8?Q?Mattias_Andr=c3=a9e?= <maandree@kth.se>, coreutils@gnu.org
References: <1459962572-31799-1-git-send-email-maandree@member.fsf.org>
	<20160406191433.1b3569a3.maandree@kth.se> <57054D17.5090909@redhat.com>
	<20160406200003.2c3df872.maandree@kth.se>
From: Eric Blake <eblake@redhat.com>
Openpgp: url=http://people.redhat.com/eblake/eblake.gpg
Organization: Red Hat, Inc.
Message-ID: <57054FE7.6090003@redhat.com>
Date: Wed, 6 Apr 2016 12:05:27 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.7.1
MIME-Version: 1.0
In-Reply-To: <20160406200003.2c3df872.maandree@kth.se>
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="AqtXNHrfiadKL0w7VVcsBxDw54A7GP9rg"
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22
X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16
	(mx1.redhat.com [10.5.110.39]);
	Wed, 06 Apr 2016 18:05:28 +0000 (UTC)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 209.132.183.28
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Apr 2016 18:05:39 -0000

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--AqtXNHrfiadKL0w7VVcsBxDw54A7GP9rg
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 04/06/2016 12:00 PM, Mattias Andr=C3=A9e wrote:
>> You may want to check
>> that your top-level ~/.gitconfig has these settings:
>>
>> [user]
>>     name =3D "Full Name"
>>     email =3D mail@example.com
>> [sendemail]
>>     from =3D Full Name <mail@example.com>
>>
>> so that 'git send-email' won't be forced to assume
>> authorship is different than mail sender.
>>
>=20
> That fixed the problem. Thanks.
>=20
> Feels a bit pedantic that you have too specify
> the from value completely. One would think that
> it could figure it out.

The user.name and user.email are mandatory; they determine git authorship=
=2E

I think the sendemail.from is optional, but if omitted, it then uses
your outgoing mailer's defaults (and not all outgoing mailers have sane
defaults).  So I've always provided it myself, rather than worrying
about how to (re-)configure my SMTP connection to provide a default
From: that matches my wishes.  The other reason sendemail.from is
important is that sometimes you send someone else's patch, where the
mail is from you but the authorship From: line must be listed; so git
_can't_ always use the authorship information in generating the email
envelope.

--=20
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


--AqtXNHrfiadKL0w7VVcsBxDw54A7GP9rg
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJXBU/oAAoJEKeha0olJ0NqjM4H/0Xup33MSx9LCX56Nia5dqKP
44tndEJmTOU7QaCnjNr3t6HXfi7TJVpj8sbCXE7keXTbBXvWPojGkPsvPreahVdo
lE43SGSyBVeH8kXefIyhe0GHmUZzUTszaAhs4PIwgBakcWIWj6Xz6NdYNt9SUtMB
YadMRagdypsyIRdVW1+tNgCUvKJFGs9wc++6sXbZCO39/QEGt+TUGrpo6Rb1xeI8
Mx7/yN3dRufn3eD3TsDIeDfhgytMhZ9A3THhizJP/tCMIPU3HArpJIspzk8IGpFW
X1/NmjvbXj9DkjOOBBCpWjVeNsI1Om9OwQkHLKrQwi9ve8sFkZZYzf4uqUW0exY=
=1mKC
-----END PGP SIGNATURE-----

--AqtXNHrfiadKL0w7VVcsBxDw54A7GP9rg--


From MAILER-DAEMON Wed Apr 06 14:09:01 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1anrsz-0003p9-My
	for mharc-coreutils@gnu.org; Wed, 06 Apr 2016 14:09:01 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:55376)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@kth.se>) id 1anrkf-0006EC-0U
	for coreutils@gnu.org; Wed, 06 Apr 2016 14:00:25 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <maandree@kth.se>) id 1anrka-0007AV-CT
	for coreutils@gnu.org; Wed, 06 Apr 2016 14:00:24 -0400
Received: from smtp-4.sys.kth.se ([2001:6b0:1:1300:250:56ff:fea6:2de3]:42358)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@kth.se>) id 1anrkZ-0007AP-UQ
	for coreutils@gnu.org; Wed, 06 Apr 2016 14:00:20 -0400
Received: from smtp-4.sys.kth.se (localhost.localdomain [127.0.0.1])
	by smtp-4.sys.kth.se (Postfix) with ESMTP id 9B5E7E0E;
	Wed,  6 Apr 2016 20:00:18 +0200 (CEST)
X-Virus-Scanned: by amavisd-new at kth.se
Received: from smtp-4.sys.kth.se ([127.0.0.1])
	by smtp-4.sys.kth.se (smtp-4.sys.kth.se [127.0.0.1]) (amavisd-new,
	port 10024)
	with LMTP id JRUacyY9-xxH; Wed,  6 Apr 2016 20:00:17 +0200 (CEST)
X-KTH-Auth: maandree [81.228.219.220]
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kth.se; s=default;
	t=1459965617; bh=OHO/NHcjU6JNRckAtvSM5ZIRmXDb2Nh4zLd6bvef+Tc=;
	h=Date:From:To:Cc:Subject:In-Reply-To:References;
	b=oS7JngFjoW++VjGopQMkGD9as/St5pJ7zYMrJgsKA9iKzDO5VFnP51ok+vCn4crSb
	uhZqgGrQNaOTAeMRYvnN9KMcHfaqZr9VdHEYvwqQVw1TCzFG2OwxuldqJKyznFV8mc
	UvyWaGWQLedvt3OfSn2yWRt1Agi8d+v0ui857jpo=
X-KTH-mail-from: maandree@kth.se
Received: from localhost.localdomain (h220n13-jak-a12.ias.bredband.telia.com
	[81.228.219.220])
	by smtp-4.sys.kth.se (Postfix) with ESMTPSA id C5F13A59;
	Wed,  6 Apr 2016 20:00:16 +0200 (CEST)
Date: Wed, 6 Apr 2016 20:00:03 +0200
From: Mattias =?UTF-8?B?QW5kcsOpZQ==?= <maandree@kth.se>
To: coreutils@gnu.org
Subject: Re: [PATCH] test: Add unary operator -E: test that a file is an
	empty directory
Message-ID: <20160406200003.2c3df872.maandree@kth.se>
In-Reply-To: <57054D17.5090909@redhat.com>
References: <1459962572-31799-1-git-send-email-maandree@member.fsf.org>
	<20160406191433.1b3569a3.maandree@kth.se>
	<57054D17.5090909@redhat.com>
X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-unknown-linux-gnu)
X-Awesomeness: 120 %
User-Agent: Claws Mail
X-Operating-System: GNU/Linux
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	boundary="Sig_/pMNU0meo7ee0jQEf/iS5zC2";
	protocol="application/pgp-signature"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 2001:6b0:1:1300:250:56ff:fea6:2de3
X-Mailman-Approved-At: Wed, 06 Apr 2016 14:09:00 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Apr 2016 18:00:26 -0000

--Sig_/pMNU0meo7ee0jQEf/iS5zC2
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Wed, 6 Apr 2016 11:53:27 -0600
Eric Blake <eblake@redhat.com> wrote:

> On 04/06/2016 11:14 AM, Mattias Andr=C3=A9e wrote:
> > On Wed, 6 Apr 2016 19:09:32 +0200
> > <maandree@member.fsf.org> wrote:
> >  =20
> >> From: Mattias Andr=C3=A9e <maandree@member.fsf.org> =20
> >=20
> > If anyone knows why git send-email inserted
> > this line it would be helpful. That line
> > shouldn't be there. =20
>=20
> Git does that if your outgoing mail "From:" is different
> from the git authorship "From:".  In your case, the
> difference is that your git settings did not specify a
> "Full Name <mail@example.org>" mail line, but merely an
> email address "<mail@example.org>"; whereas your
> authorship included full name.  You may want to check
> that your top-level ~/.gitconfig has these settings:
>=20
> [user]
>     name =3D "Full Name"
>     email =3D mail@example.com
> [sendemail]
>     from =3D Full Name <mail@example.com>
>=20
> so that 'git send-email' won't be forced to assume
> authorship is different than mail sender.
>=20

That fixed the problem. Thanks.

Feels a bit pedantic that you have too specify
the from value completely. One would think that
it could figure it out.

--Sig_/pMNU0meo7ee0jQEf/iS5zC2
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJXBU6jAAoJEM4wYJDpiwjHEUQP/3AKzDjEP4d1Fvjr82eGqTUg
LAlVjQrZqEC+AeBSDFRwZix3h/B/EVXnfhbOpAqpLfzUkrBNMmPPUF7Fl4Kfq49W
eNc4W1Qnk9R0eUXliXAW9rHZ8ygFPfZBa4Nb7xv1caSMxthZeeQv316KBzR88kQY
QSz9MvG7txh011WD9BhG5hp6TV/tI1dfHokN7dvS9j7ULDzLQzKcV49kDeFc8tRj
qsr7bRaudKgA91puVSbCrC/Y6P6GHGIi/PktRtNengF5D1FwammvdAU94zMsVnTd
6fMwv/W53C1VZFe7qTxKoGpquDkQG2zFgi0GhToOTXhGKAKjqr3xIYb4UUzTmBqP
QZAroCNaZEyNmTw5WdCfhRQSNaLz+njgOhU1pm3B9R2/aJrUOw5Bue/FFO7fAAom
f89Ud1RDBPbWXvQNKJUqK4xv882JiMivYHBJN4QdV7kudrRg16TTQFVKfINf2bsa
lbJI29MZhehSO2V3IIAMBl8ske7ZE+CO2ifVoqCelhBL0J1EyhLCF6gG6H8D7XDd
ONx7ZG70DhCxXIriAGz5/RJGzVkFGJAvRz4ys7+Vx1AuaKokEdjWwhlT9O/4B0AN
8M1atX2o13BTRSMsW+hOUi6Otdz4n9xJCMWqacbWG5ZvVmKWfH+otSQbjkqLb3Hb
ujknd34MfiZm9axmjF8U
=rW6u
-----END PGP SIGNATURE-----

--Sig_/pMNU0meo7ee0jQEf/iS5zC2--


From MAILER-DAEMON Wed Apr 06 14:23:26 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ans6w-0001Oq-Qi
	for mharc-coreutils@gnu.org; Wed, 06 Apr 2016 14:23:26 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:34495)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1ans6t-0001OX-SV
	for coreutils@gnu.org; Wed, 06 Apr 2016 14:23:24 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1ans6p-0005Io-Ou
	for coreutils@gnu.org; Wed, 06 Apr 2016 14:23:23 -0400
Received: from smtp-4.sys.kth.se ([130.237.48.193]:56087)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1ans6p-0005Ig-8V
	for coreutils@gnu.org; Wed, 06 Apr 2016 14:23:19 -0400
Received: from smtp-4.sys.kth.se (localhost.localdomain [127.0.0.1])
	by smtp-4.sys.kth.se (Postfix) with ESMTP id E4157EEA
	for <coreutils@gnu.org>; Wed,  6 Apr 2016 20:23:16 +0200 (CEST)
X-Virus-Scanned: by amavisd-new at kth.se
Received: from smtp-4.sys.kth.se ([127.0.0.1])
	by smtp-4.sys.kth.se (smtp-4.sys.kth.se [127.0.0.1]) (amavisd-new,
	port 10024) with LMTP id Dpmf12t1i35V for <coreutils@gnu.org>;
	Wed,  6 Apr 2016 20:23:14 +0200 (CEST)
X-KTH-Auth: maandree [81.228.219.220]
X-KTH-mail-from: maandree@member.fsf.org
X-KTH-rcpt-to: coreutils@gnu.org
Received: from localhost.localdomain (h220n13-jak-a12.ias.bredband.telia.com
	[81.228.219.220])
	by smtp-4.sys.kth.se (Postfix) with ESMTPSA id BA118125
	for <coreutils@gnu.org>; Wed,  6 Apr 2016 20:23:13 +0200 (CEST)
Date: Wed, 6 Apr 2016 20:23:07 +0200
From: Mattias =?UTF-8?B?QW5kcsOpZQ==?= <maandree@member.fsf.org>
To: <coreutils@gnu.org>
Subject: Re: [PATCH] test: Add unary operator -E: test that a file is an
	empty directory
Message-ID: <20160406202307.50a3442c.maandree@kth.se>
In-Reply-To: <57054E33.6090300@redhat.com>
References: <1459962572-31799-1-git-send-email-maandree@member.fsf.org>
	<57054E33.6090300@redhat.com>
X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-unknown-linux-gnu)
X-Awesomeness: 120 %
User-Agent: Claws Mail
X-Operating-System: GNU/Linux
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	boundary="Sig_/lM2+muNN6.jYLdBMcu6yVf+";
	protocol="application/pgp-signature"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 130.237.48.193
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Apr 2016 18:23:25 -0000

--Sig_/lM2+muNN6.jYLdBMcu6yVf+
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Wed, 6 Apr 2016 11:58:11 -0600
Eric Blake <eblake@redhat.com> wrote:

> On 04/06/2016 11:09 AM, maandree@member.fsf.org wrote:
> > From: Mattias Andr=C3=A9e <maandree@member.fsf.org>
> >=20
> > ---
> >  doc/coreutils.texi |  7 ++++++-
> >  src/test.c         | 44
> > +++++++++++++++++++++++++++++++++++++++++++- 2 files
> > changed, 49 insertions(+), 2 deletions(-) =20
>=20
>=20
> Thanks for the patch, and remembering to document it.
> However, it also needs a NEWS entry and testsuite
> coverage; by the time you do that, the patch may be
> non-trivial enough to need copyright assignment.

Will do. Copyright assignment request has already been send.

>=20
> Also, the bar for adding new options to 'test' is very
> high - is there any other existing practice (say in bash,
> ksh, zsh, BSD, or elsewhere) that is already using -E,
> and if so, are they using it for the same purpose?  If
> so, mention it and this patch is worthwhile; if not, I'm
> a bit reluctant to be the first inventor, especially if
> something else more portable can be used.

I have not looked at all shells, but for non-builtin
implementations it seems like -E is free on all
implementations and that there is no equivalent.
I have submitted this addition too to sbase, but it is
pending. The rationale for this flag that it is better
to implement it in test than as a separate command.
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D385069

>=20
> On the other hand, I readily concur that "test -s
> directory" does NOT accurately report whether the
> directory has contents, so maybe adding the new operator
> has justification on that grounds; it would also be nice
> if you could simultaneously propose it on the bash
> mailing list, so that multiple GNU programs implement the
> same semantics at once.
>=20

I was think about proposing Bash add it, or simply
remove the builtin test command completely.
Bash's test and coreutils's test are not fully compatible
(Bash does not support big integers, and have a bug
[have not reported it yet] where it fails follow POSIX's
rules of how to parse the expression,) and I don't
see the use of having test built in, but perhaps they
do. And if there really is a need for a builtin, just
embed coreutil's implementation.

--Sig_/lM2+muNN6.jYLdBMcu6yVf+
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJXBVQLAAoJEM4wYJDpiwjHc/8P/jotLlL9UBCI6zRVaHSsIwoD
jG4BLVke5H1psURg/G8nEa499sfTck3EPlSzMNmMIRNBFFMK7MY5DmbPWEMVL1fL
w+6X+m++9dYQpe6L+Pws2MT7mA8G5OENZJO9aENc+9me2kkjWiF02pFPnPAYRN4U
v2XJezaRa3aetwlX0qorz0LJr2ac1LelcPrfkcpUx3BNoXiqG3BgiJvGHzA+JfCK
QVEAQXYmuXMfxCu2D7my6L3gW5u9wDRV7KEgsCnQ1iOqTtno3LnneOAqTuRC5SQ3
fEKnhzxJv/9CEBkJhLDRfMW0rz5ugZ+2nj61Hul09VKU9wziBeXHgarsiXkyXd6Z
dA5Fx2Nha0biBkW4c+XEAGRycy6YhsnLSjee/wkvVTaCpvssycqr/R1wZ3tnJ0Ve
qu+N3RwLPAbPT5jMBpk5IKNJlLD7Gl017UApT5Uh8D7MCKUtFJowwsR3pNNzFoZ9
8WRu4A5XcF7xixMsppP1lsOkVXc4Fns02lcSSziTelQf1GllS3A3zU5H8VB4mzo/
vmuGIMrCB1MZ0vFfLnxlPQgMYQaWZEQkqfzt7ADB5sgnt8RfoMs+SRY+dXhmCOXe
y94pubZ3Rj8nw0PSlP3lyTv7GA47NqQfnZheXz4bZqGj8oIUZLIUmn8jDWUjWbd4
+y+x1aDcvKpY7nHN9OHT
=KKDL
-----END PGP SIGNATURE-----

--Sig_/lM2+muNN6.jYLdBMcu6yVf+--


From MAILER-DAEMON Wed Apr 06 15:15:26 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ansvG-0006K8-BW
	for mharc-coreutils@gnu.org; Wed, 06 Apr 2016 15:15:26 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:46327)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <alad@archlinux.info>) id 1ansvE-0006Jm-5c
	for coreutils@gnu.org; Wed, 06 Apr 2016 15:15:25 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <alad@archlinux.info>) id 1ansvA-00015L-T1
	for coreutils@gnu.org; Wed, 06 Apr 2016 15:15:24 -0400
Received: from mail.archlinux.info ([2001:470:1f08:3ac::2]:39172)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <alad@archlinux.info>) id 1ansvA-00015H-N6
	for coreutils@gnu.org; Wed, 06 Apr 2016 15:15:20 -0400
Received: from [192.168.1.3] (ip-213-49-101-251.dsl.scarlet.be
	[213.49.101.251])
	by mail.archlinux.info (Postfix) with ESMTPSA id 90278A60094
	for <coreutils@gnu.org>; Wed,  6 Apr 2016 20:01:09 +0100 (BST)
Subject: Re: tsort: "odd input of tokens" with paired input
To: coreutils@gnu.org
References: <57047FAD.10304@archlinux.info>
	<CABUXKX7WFRKer0CkqYGQ9mEpsFewNoqjb4RDokdNo4AyeoNy+Q@mail.gmail.com>
From: Alad Wenter <alad@archlinux.info>
Message-ID: <57055F7A.8060206@archlinux.info>
Date: Wed, 6 Apr 2016 21:11:54 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.7.1
MIME-Version: 1.0
In-Reply-To: <CABUXKX7WFRKer0CkqYGQ9mEpsFewNoqjb4RDokdNo4AyeoNy+Q@mail.gmail.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2001:470:1f08:3ac::2
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Apr 2016 19:15:25 -0000

On 06.04.2016 15:51, Assaf Gordon wrote:
> Hello,
>
>> On Apr 6, 2016, at 06:45, Michael V. Antosha <michael.antosha@gmail.com> wrote:
>> On 4/6/16, Alad Wenter <alad@archlinux.info> wrote:
>>> Hello,
>>>
>>> When trying to run tsort on a moderately large
>>> paired list, I get:
>>>
>>> tsort: -: input contains an odd number of
>>> tokens
>> head -89 pre_tsort.txt | tsort  # success
>> # First 89 lines are okay.  Line 90 is bad.
> <shameless plug>
>
> The recent version of GNU Datamash ( http://gnu.org/s/datamash ) has a new operation 'check' to quickly diagnose cases like this (non-tabular file structure) and provide verbose report of the problem.
>
> Example:
>
>      $ curl -s https://ptpb.pw/c1Vu > test.txt
>      $ datamash -W check < test.txt
>      line 89 (2 fields):
>       cower cower
>      line 90 (3 fields):
>       deluge-labelplus deluge gtk2
>      datamash: check failed: line 90 has 3 fields (previous line had 2)
>
>
> The '-W' parameter tells datamash to use whitespace as field-separator (default is tab).
> </shameless plug>
>
>
> regards,
>   - assaf
>
Thanks for the ideas. There were indeed some lines with a third field (I 
didn't expect a dependency which had a whitespace in its name...).

Using grep also works:

  % grep '.* .* .*' pre_tsort.txt
deluge-labelplus deluge gtk2
deluge-movetools deluge gtk2
deluge-smartmove deluge gtk2
deluge-stats deluge gtk2
deluge-webapi deluge gtk2

"datamash -W check" is nice to automate this, though I agree on having 
line-numbered errors for tsort. :)

Cheers,

Alad



From MAILER-DAEMON Wed Apr 06 15:36:39 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1antFn-0008QX-0h
	for mharc-coreutils@gnu.org; Wed, 06 Apr 2016 15:36:39 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:50873)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1antFk-0008Ps-UG
	for coreutils@gnu.org; Wed, 06 Apr 2016 15:36:37 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1antFf-00066N-PW
	for coreutils@gnu.org; Wed, 06 Apr 2016 15:36:36 -0400
Received: from mail-qg0-x229.google.com ([2607:f8b0:400d:c04::229]:32891)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1antFf-00066J-Jo
	for coreutils@gnu.org; Wed, 06 Apr 2016 15:36:31 -0400
Received: by mail-qg0-x229.google.com with SMTP id j35so45023066qge.0
	for <coreutils@gnu.org>; Wed, 06 Apr 2016 12:36:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to;
	bh=17EcO19puY+6f1HHvsS48n2zz1YVdSbhmvZ7f+ro9y4=;
	b=RVvSA8E2+mwihNRKtvZhU3i4UpYBIbHpv0emrWMJKPFEhsoIycaAk44mRURHdlQg7k
	mTq/ZFAvbZerp+vkEce5iWndyxLFCWn9FPJQtIsuc8BnCcOt/PfMHHEVNs+gwvufq68r
	ql69B9WxWycPxi5m8+C2fuGlLqPw1JUQ+Bhf3rY93M+Ijt/iumESu9lbKDNb0AH+p/u6
	5fBjnYoDl9ONhJJNqkz4vKR4ZHH8Jhuann9ZPx1mlCiocdVGz2CkwKvgN2eWUlV+nyOK
	rFR+67wWiqDCy7xlLFi4k6D0m3EgDXdjajbDAEbpEHZDS0He3bJl0KKUi0D4su10PrnG
	JHBQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to;
	bh=17EcO19puY+6f1HHvsS48n2zz1YVdSbhmvZ7f+ro9y4=;
	b=f2fApba8DKO3WsxpcoHko/T1pSpgYT4krbcqaI6ZzGBGjU228pU1/qH+mlmKF5/WR2
	sUTinazAODvPxX7MCt2oDsW13F1RUzzRv0ayup9HK6zgIjiQlsYCardZbQUGf8JDq9Vg
	D+skdeZPCMehFMKpJf5oyYLweEsxNoh0k9gUBNqZc5XWh8iJ4vORAAszDei+EBOdkUGl
	YFjGEBBcXTNYPgULkBvxdXtZZpA31YWvYfuNvNCgNSMNXxqVZ2uIhoj8vDOhXwWBMDB1
	svnx/li6slffcf58WaLrBowfQqj/MFhc7su1ZXHYsAZPjT3g6RJrWCT3wX15Ml4rkpzK
	EcPA==
X-Gm-Message-State: AD7BkJLrmeZSV75VipbQqy79hnZPgtIb/BPVDaZmSvX0a2/S0vIaP0Anu87kYIc4GB9IaQ==
X-Received: by 10.141.0.8 with SMTP id b8mr28923163qhd.104.1459971391107;
	Wed, 06 Apr 2016 12:36:31 -0700 (PDT)
Received: from [10.0.215.16] (ool-addc4864.static.optonline.net.
	[173.220.72.100])
	by smtp.gmail.com with ESMTPSA id 63sm1915782qky.32.2016.04.06.12.36.30
	(version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
	Wed, 06 Apr 2016 12:36:30 -0700 (PDT)
Content-Type: text/plain; charset=utf-8
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\))
Subject: Re: [PATCH] test: Add unary operator -E: test that a file is an empty
	directory
From: Assaf Gordon <assafgordon@gmail.com>
In-Reply-To: <20160406202307.50a3442c.maandree@kth.se>
Date: Wed, 6 Apr 2016 15:36:29 -0400
Content-Transfer-Encoding: quoted-printable
Message-Id: <E0F1E107-919A-41E5-BEB5-5F2533035564@gmail.com>
References: <1459962572-31799-1-git-send-email-maandree@member.fsf.org>
	<57054E33.6090300@redhat.com>
	<20160406202307.50a3442c.maandree@kth.se>
To: =?utf-8?Q?Mattias_Andr=C3=A9e?= <maandree@member.fsf.org>
X-Mailer: Apple Mail (2.2102)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2607:f8b0:400d:c04::229
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Apr 2016 19:36:38 -0000

Hello,

> On Apr 6, 2016, at 14:23, Mattias Andr=C3=A9e =
<maandree@member.fsf.org> wrote:
> [...] The rationale for this flag that it is better
> to implement it in test than as a separate command.
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D385069
>=20
>> On the other hand, I readily concur that "test -s
>> directory" does NOT accurately report whether the
>> directory has contents

As a temporary work-around, the following seems portable across some =
OSes (gnu/linux,*BSD) and can be used as a shell function (but =
'-mindepth' is not in POSIX standard):

dirempty() {
  test -d "$1" \
     && test -z "$( { find "$1" -mindepth 1 2>/dev/null || echo failed ; =
} | head -n1)"
}

usage is:

dirempty DIRNAME && echo empty || echo not-empty-or-error


HTH,
 - assaf



From MAILER-DAEMON Wed Apr 06 15:57:29 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1antZx-0006sK-B1
	for mharc-coreutils@gnu.org; Wed, 06 Apr 2016 15:57:29 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:54116)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1antZu-0006qs-Cr
	for coreutils@gnu.org; Wed, 06 Apr 2016 15:57:27 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1antZq-0002GW-9g
	for coreutils@gnu.org; Wed, 06 Apr 2016 15:57:26 -0400
Received: from smtp-4.sys.kth.se ([2001:6b0:1:1300:250:56ff:fea6:2de3]:32810)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1antZq-0002GL-2G
	for coreutils@gnu.org; Wed, 06 Apr 2016 15:57:22 -0400
Received: from smtp-4.sys.kth.se (localhost.localdomain [127.0.0.1])
	by smtp-4.sys.kth.se (Postfix) with ESMTP id D0787581
	for <coreutils@gnu.org>; Wed,  6 Apr 2016 21:57:20 +0200 (CEST)
X-Virus-Scanned: by amavisd-new at kth.se
Received: from smtp-4.sys.kth.se ([127.0.0.1])
	by smtp-4.sys.kth.se (smtp-4.sys.kth.se [127.0.0.1]) (amavisd-new,
	port 10024) with LMTP id tLEGWMFbeBN6 for <coreutils@gnu.org>;
	Wed,  6 Apr 2016 21:57:19 +0200 (CEST)
X-KTH-Auth: maandree [81.228.219.220]
X-KTH-mail-from: maandree@member.fsf.org
X-KTH-rcpt-to: coreutils@gnu.org
Received: from localhost.localdomain (h220n13-jak-a12.ias.bredband.telia.com
	[81.228.219.220])
	by smtp-4.sys.kth.se (Postfix) with ESMTPSA id 845B02C1
	for <coreutils@gnu.org>; Wed,  6 Apr 2016 21:57:19 +0200 (CEST)
Date: Wed, 6 Apr 2016 21:57:11 +0200
From: Mattias =?UTF-8?B?QW5kcsOpZQ==?= <maandree@member.fsf.org>
To: coreutils@gnu.org
Subject: Re: [PATCH] test: Add unary operator -E: test that a file is an
	empty directory
Message-ID: <20160406215711.444784ff.maandree@kth.se>
In-Reply-To: <E0F1E107-919A-41E5-BEB5-5F2533035564@gmail.com>
References: <1459962572-31799-1-git-send-email-maandree@member.fsf.org>
	<57054E33.6090300@redhat.com>
	<20160406202307.50a3442c.maandree@kth.se>
	<E0F1E107-919A-41E5-BEB5-5F2533035564@gmail.com>
X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-unknown-linux-gnu)
X-Awesomeness: 120 %
User-Agent: Claws Mail
X-Operating-System: GNU/Linux
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	boundary="Sig_/aTqv6YykVh2mP9pr7SJJYCy";
	protocol="application/pgp-signature"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 2001:6b0:1:1300:250:56ff:fea6:2de3
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Apr 2016 19:57:27 -0000

--Sig_/aTqv6YykVh2mP9pr7SJJYCy
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Wed, 6 Apr 2016 15:36:29 -0400
Assaf Gordon <assafgordon@gmail.com> wrote:

> Hello,
>=20
> > On Apr 6, 2016, at 14:23, Mattias Andr=C3=A9e
> > <maandree@member.fsf.org> wrote: [...] The rationale
> > for this flag that it is better to implement it in test
> > than as a separate command.
> > https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=3D385069=20
> >> On the other hand, I readily concur that "test -s
> >> directory" does NOT accurately report whether the
> >> directory has contents =20
>=20
> As a temporary work-around, the following seems portable
> across some OSes (gnu/linux,*BSD) and can be used as a
> shell function (but '-mindepth' is not in POSIX standard):
>=20
> dirempty() {
>   test -d "$1" \
>      && test -z "$( { find "$1" -mindepth 1 2>/dev/null
> || echo failed ; } | head -n1)" }
>=20
> usage is:
>=20
> dirempty DIRNAME && echo empty || echo not-empty-or-error

It is too complicated and you need to use find "$1/",
not find "$1". But you can use:

test -d "$1" && python - "$1" <<EOF
import os, sys
sys.exit(1 if len(os.listdir(sys.argv[1])) else 0)
EOF

or

test -d "$1" && test -z "$(ls -A -- "$1/")"

>=20
>=20
> HTH,
>  - assaf
>=20


--Sig_/aTqv6YykVh2mP9pr7SJJYCy
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJXBWoXAAoJEM4wYJDpiwjHosYQAMBVxvOd7V8SnzeyO+hXmTDf
t++FY5G2dhzd8RjF1q5yiNEXFs+0LlprsixdRFF+LAJG2p8zS2D4mp189DR2+rx/
Q9xrZg2HnnHs7XJ291BPta6gBTXbiKQb71LWSyN318qkAUHDfohFYkH2nYHMiypT
S6P0t2TUO3Aq1a/+kCMafbVy0/6mmVwub3owzxf3FjhrUBJ66a9Dvd1iQJPNU+Vi
vHpN9LAEemen5zdX47uey4G8RS8RL7+vS5JSZJDvCcb3s1UWYbQhnzKfL5i8vOaR
AXfDYoX3ONzlJZYBk1w1i59wqTl0tAtHTMK+aEV5PcVU8tnnf5YgONzO6Gb7Ek+G
alklTr6tWt4G50rCPjfeNU7E9l8tOaT17h6Cxg/sYRVMdSMhFRnuZhVBvhkp5714
Eog9ZKtHLYNZsIuben+mjxoJnbXEOsX4d37So7SicbvKxKR6YEZwBdL47nxorhvK
Yp07Hozjbk+SYhNG3AYZxwXwaFxu03ZLIBJZ7cA2kIJoH0CXNCDe9R6a2oVZfKST
2SLnXLx63quGhUSh7iiQNhuwn/rH87h47Qzt/Aj4X9bs+vixkZkUOQxI0V8GX+uH
t4iM9EJNJ9ui+lwE2UMhCMx77bHQKlNAYCk5vr3lIbeGrSm5dLrbNmvSN13GfHUE
7lELbP40qfaMMlO1yWnk
=wjkc
-----END PGP SIGNATURE-----

--Sig_/aTqv6YykVh2mP9pr7SJJYCy--


From MAILER-DAEMON Wed Apr 06 16:10:46 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1antmo-0004l1-KG
	for mharc-coreutils@gnu.org; Wed, 06 Apr 2016 16:10:46 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:56614)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1antmn-0004ke-4d
	for coreutils@gnu.org; Wed, 06 Apr 2016 16:10:45 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1antmj-00052Z-R3
	for coreutils@gnu.org; Wed, 06 Apr 2016 16:10:45 -0400
Received: from smtp-3.sys.kth.se ([2001:6b0:1:1300:250:56ff:fea6:2de2]:55922)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1antmj-00052V-Jg
	for coreutils@gnu.org; Wed, 06 Apr 2016 16:10:41 -0400
Received: from smtp-3.sys.kth.se (localhost.localdomain [127.0.0.1])
	by smtp-3.sys.kth.se (Postfix) with ESMTP id 9AAB269E
	for <coreutils@gnu.org>; Wed,  6 Apr 2016 22:10:40 +0200 (CEST)
X-Virus-Scanned: by amavisd-new at kth.se
Received: from smtp-3.sys.kth.se ([127.0.0.1])
	by smtp-3.sys.kth.se (smtp-3.sys.kth.se [127.0.0.1]) (amavisd-new,
	port 10024) with LMTP id HiGeHhahuyrx for <coreutils@gnu.org>;
	Wed,  6 Apr 2016 22:10:40 +0200 (CEST)
X-KTH-Auth: maandree [81.228.219.220]
X-KTH-mail-from: maandree@member.fsf.org
X-KTH-rcpt-to: coreutils@gnu.org
Received: from localhost.localdomain (h220n13-jak-a12.ias.bredband.telia.com
	[81.228.219.220])
	by smtp-3.sys.kth.se (Postfix) with ESMTPSA id EC52559B
	for <coreutils@gnu.org>; Wed,  6 Apr 2016 22:10:38 +0200 (CEST)
Date: Wed, 6 Apr 2016 22:10:26 +0200
From: Mattias =?UTF-8?B?QW5kcsOpZQ==?= <maandree@member.fsf.org>
To: <coreutils@gnu.org>
Subject: Re: [PATCH] test: Add unary operator -E: test that a file is an
	empty directory
Message-ID: <20160406221026.2e4dedd1.maandree@kth.se>
In-Reply-To: <20160406215711.444784ff.maandree@kth.se>
References: <1459962572-31799-1-git-send-email-maandree@member.fsf.org>
	<57054E33.6090300@redhat.com>
	<20160406202307.50a3442c.maandree@kth.se>
	<E0F1E107-919A-41E5-BEB5-5F2533035564@gmail.com>
	<20160406215711.444784ff.maandree@kth.se>
X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-unknown-linux-gnu)
X-Awesomeness: 120 %
User-Agent: Claws Mail
X-Operating-System: GNU/Linux
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	boundary="Sig_/bS2Xl13OAJSJ6DA02pjgL92";
	protocol="application/pgp-signature"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 2001:6b0:1:1300:250:56ff:fea6:2de2
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Apr 2016 20:10:46 -0000

--Sig_/bS2Xl13OAJSJ6DA02pjgL92
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Wed, 6 Apr 2016 21:57:11 +0200
Mattias Andr=C3=A9e <maandree@member.fsf.org> wrote:

> On Wed, 6 Apr 2016 15:36:29 -0400
> Assaf Gordon <assafgordon@gmail.com> wrote:
>=20
> >=20
> > As a temporary work-around, the following seems portable
> > across some OSes (gnu/linux,*BSD) and can be used as a
> > shell function (but '-mindepth' is not in POSIX
> > standard):
> >=20
> > dirempty() {
> >   test -d "$1" \
> >      && test -z "$( { find "$1" -mindepth 1 2>/dev/null

Of course, you need -- too.

> > || echo failed ; } | head -n1)" }
> >=20
> > usage is:
> >=20
> > dirempty DIRNAME && echo empty || echo
> > not-empty-or-error =20
>=20
> It is too complicated and you need to use find "$1/",
> not find "$1". But you can use:
>=20
> test -d "$1" && python - "$1" <<EOF
> import os, sys
> sys.exit(1 if len(os.listdir(sys.argv[1])) else 0)
> EOF
>=20
> or
>=20
> test -d "$1" && test -z "$(ls -A -- "$1/")"


We have now demonstrated that attempts to
implement this functionally in shell script
without -E is prone to errors in addition
to being messy.

--Sig_/bS2Xl13OAJSJ6DA02pjgL92
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJXBW0yAAoJEM4wYJDpiwjH74MP/1Vc9aDPxXPot5sNVNIVGjPj
4nwd/3LL4rDkCLLx+gdHqBePciDSfZc21KZe1SftsYJR0pnQM7w7UkVpTzlDvo7Y
TxwHmW+lCfH6Be/1rVTHYndG5g2iEd57+XIgDe6BwZhX5yIt4Rn4vflhY9DpQbBz
qyYs4GX0BfJVSJfBq+SMZ8M3ZpctLu+eje5njorkR2aowTKnj24ldgXMZ2I2NPSd
AtihL7aMDG/xAWAzyygcuaWPSXUw0Jyayj9VkoJnxRtCbRSdrn3pmlVXunl7Sq9P
NrYcAY4IINTcQYgW10bRuLBtpTikksQVKSkjI/z5H4ocpWmWSyE1lZi6iet/plw3
ZkOkWZcLO5RIn6pBJYMWDe50zTP1c7vV+tefWYOxaCTdb24TPqm63SoET3p52Z0Z
/USfJDNSCjR2INF15xyi+VZE8+1Vd5FkleuJTI3ZTYjYMqF0HHbddhxiDbSzxksw
NCn9+mNwsKSYlmion+UW9kYPGwW2OF8YxWVCBgaI4mgb3CVQpW8DObOLm6D7sYub
CRty5UfGfpLfrn4pGdWyqOzkHWHIW4mzGcWynDtsRu09cCJV5PXiY5yxl+Kvudkk
mSSg4HMvXf2ISy8eakUtzcRrxFgAMnfeFXy86wMnz1P4iUgnM5TE0driyy1A11JE
RxDsYyIORMzg9BDwsmJE
=tAZS
-----END PGP SIGNATURE-----

--Sig_/bS2Xl13OAJSJ6DA02pjgL92--


From MAILER-DAEMON Wed Apr 06 16:23:41 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1antzJ-0001Og-CN
	for mharc-coreutils@gnu.org; Wed, 06 Apr 2016 16:23:41 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:59206)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mstone@debian.org>) id 1antzG-0001NT-Qo
	for coreutils@gnu.org; Wed, 06 Apr 2016 16:23:39 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mstone@debian.org>) id 1antzD-0007qp-LF
	for coreutils@gnu.org; Wed, 06 Apr 2016 16:23:38 -0400
Received: from harad.mathom.us ([54.218.24.45]:34640)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mstone@debian.org>) id 1antzD-0007m1-Eq
	for coreutils@gnu.org; Wed, 06 Apr 2016 16:23:35 -0400
Received: from osgiliath.mathom.us (osgiliath.mathom.us
	[IPv6:2001:4830:1614:2341::2])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by harad.mathom.us (Postfix) with ESMTPSA id 833CEC5
	for <coreutils@gnu.org>; Wed,  6 Apr 2016 20:23:25 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by osgiliath.mathom.us (Postfix) with ESMTP id E4F0E6E74A
	for <coreutils@gnu.org>; Wed,  6 Apr 2016 16:23:23 -0400 (EDT)
Received: from osgiliath.mathom.us ([127.0.0.1])
	by localhost (osgiliath.mathom.us [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id eHNJPtEnrAIS for <coreutils@gnu.org>;
	Wed,  6 Apr 2016 16:23:23 -0400 (EDT)
Received: by osgiliath.mathom.us (Postfix, from userid 1000)
	id C1DC46E7FC; Wed,  6 Apr 2016 16:23:23 -0400 (EDT)
Date: Wed, 6 Apr 2016 16:23:23 -0400
From: Michael Stone <mstone@debian.org>
To: coreutils@gnu.org
Subject: Re: [PATCH] test: Add unary operator -E: test that a file is an
	empty directory
Message-ID: <5f14c4d6-fc35-11e5-9b6a-00163eeb5320@msgid.mathom.us>
Mail-Followup-To: coreutils@gnu.org
References: <1459962572-31799-1-git-send-email-maandree@member.fsf.org>
	<57054E33.6090300@redhat.com>
	<20160406202307.50a3442c.maandree@kth.se>
	<E0F1E107-919A-41E5-BEB5-5F2533035564@gmail.com>
	<20160406215711.444784ff.maandree@kth.se>
	<20160406221026.2e4dedd1.maandree@kth.se>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Disposition: inline
In-Reply-To: <20160406221026.2e4dedd1.maandree@kth.se>
X-Pgp-Fingerprint: 02D5 315F F11F 1861 860E  1E02 F61A ACDC FA11 FFDE
User-Agent: Mutt/1.5.23 (2014-03-12)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 54.218.24.45
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Apr 2016 20:23:39 -0000

On Wed, Apr 06, 2016 at 10:10:26PM +0200, Mattias Andr=E9e wrote:
>We have now demonstrated that attempts to
>implement this functionally in shell script
>without -E is prone to errors in addition
>to being messy.

Just wondering, what's the use case?

Mike Stone


From MAILER-DAEMON Wed Apr 06 16:37:15 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1anuCR-0000wm-1G
	for mharc-coreutils@gnu.org; Wed, 06 Apr 2016 16:37:15 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:33528)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1anuCP-0000w3-Fa
	for coreutils@gnu.org; Wed, 06 Apr 2016 16:37:14 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1anuCK-0002ET-HR
	for coreutils@gnu.org; Wed, 06 Apr 2016 16:37:13 -0400
Received: from smtp-3.sys.kth.se ([2001:6b0:1:1300:250:56ff:fea6:2de2]:58737)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1anuCK-0002EO-9q
	for coreutils@gnu.org; Wed, 06 Apr 2016 16:37:08 -0400
Received: from smtp-3.sys.kth.se (localhost.localdomain [127.0.0.1])
	by smtp-3.sys.kth.se (Postfix) with ESMTP id 1BDB3228C
	for <coreutils@gnu.org>; Wed,  6 Apr 2016 22:37:07 +0200 (CEST)
X-Virus-Scanned: by amavisd-new at kth.se
Received: from smtp-3.sys.kth.se ([127.0.0.1])
	by smtp-3.sys.kth.se (smtp-3.sys.kth.se [127.0.0.1]) (amavisd-new,
	port 10024) with LMTP id vugAniiW2ji0 for <coreutils@gnu.org>;
	Wed,  6 Apr 2016 22:37:06 +0200 (CEST)
X-KTH-Auth: maandree [81.228.219.220]
X-KTH-mail-from: maandree@member.fsf.org
X-KTH-rcpt-to: coreutils@gnu.org
Received: from localhost.localdomain (h220n13-jak-a12.ias.bredband.telia.com
	[81.228.219.220])
	by smtp-3.sys.kth.se (Postfix) with ESMTPSA id 7C5532628
	for <coreutils@gnu.org>; Wed,  6 Apr 2016 22:37:05 +0200 (CEST)
Date: Wed, 6 Apr 2016 22:36:50 +0200
From: Mattias =?UTF-8?B?QW5kcsOpZQ==?= <maandree@member.fsf.org>
To: <coreutils@gnu.org>
Subject: Re: [PATCH] test: Add unary operator -E: test that a file is an
	empty directory
Message-ID: <20160406223650.42e06888.maandree@kth.se>
In-Reply-To: <5f14c4d6-fc35-11e5-9b6a-00163eeb5320@msgid.mathom.us>
References: <1459962572-31799-1-git-send-email-maandree@member.fsf.org>
	<57054E33.6090300@redhat.com>
	<20160406202307.50a3442c.maandree@kth.se>
	<E0F1E107-919A-41E5-BEB5-5F2533035564@gmail.com>
	<20160406215711.444784ff.maandree@kth.se>
	<20160406221026.2e4dedd1.maandree@kth.se>
	<5f14c4d6-fc35-11e5-9b6a-00163eeb5320@msgid.mathom.us>
X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-unknown-linux-gnu)
X-Awesomeness: 120 %
User-Agent: Claws Mail
X-Operating-System: GNU/Linux
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	boundary="Sig_/VF21p92aMBSd3ErTPqHlWzl";
	protocol="application/pgp-signature"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 2001:6b0:1:1300:250:56ff:fea6:2de2
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Apr 2016 20:37:14 -0000

--Sig_/VF21p92aMBSd3ErTPqHlWzl
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Wed, 6 Apr 2016 16:23:23 -0400
Michael Stone <mstone@debian.org> wrote:

> On Wed, Apr 06, 2016 at 10:10:26PM +0200, Mattias Andr=C3=A9e
> wrote:
> >We have now demonstrated that attempts to
> >implement this functionally in shell script
> >without -E is prone to errors in addition
> >to being messy. =20
>=20
> Just wondering, what's the use case?
>=20
> Mike Stone
>=20

I just don't want a separate tool for it,
and I especially do not want to see something
like the suggested exists command for this =E2=80=94
that is some harmful shit =E2=80=94 but it could be
useful on some more advanced shell scripts =E2=80=94
you know how some people write entire programs
in Bash, you do sometimes have to make this
test in actual programs, such as diff and shred
=E2=80=94 and it is nice for completeness, just like
there is flag for every file type including
FIFO:s, sockets and even terminals.

--Sig_/VF21p92aMBSd3ErTPqHlWzl
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJXBXNiAAoJEM4wYJDpiwjHVVoQAIh99G03OxHxQ5momy+wj7es
Qjvz5kXsHtTaIln1JNdx7oqPPRkyC9djj5ykkYGF/yeHNMFPUiJydIdaqFGDWLrx
JiqWeJeu+OsmjicWQfILmRwYUc2FYeAEcJuCZN1b7tIe2EDXuSx8mfytcd0NRPFz
imS1UlSmizR1GTGaYTWihV7kYHD82DosFs5hf7p+boRWF0K5cmLmWzCYPM3iGJkq
0O8GcmWpl2vcKtITpTrH5ZRot3nkvyQz5tiUlcfjsx5N5FbfzOBRWcjM2AFZHy0w
wu2yhsTtEeGKFpcsFk8vN6eZukAqhyC8FL29icfHn+smONLgtnTy5OTq0sslpYOd
XZCp8Bu6KC+EDv1ug7i1ESe/Y3DQZbVtIBMRKFOMCkgONeS/Wj2LS+yKDO+3aCwW
AXehqlLgT1c+Zn4Hf/No4oK+Biy0uLISfwnKml9N1dA9vShu3ZQYyO9W5rnh69Eg
0HzNabGDbZp2O/j3U1vtKPweoraf51wNN5Uoa8E24OJl/3IoU/GlUYPrcENb6Z1G
4/4eD4SACY2/V5/8KREu5+JHt9Crn2GGQ2dQJQh+jhJYFmm7mk5qWZAkgyq+m7CS
Pza+R+aEopidxm+myPAcR6fxH88T8/cwE3iRoqb2+yFkvf3YBvA6MaOQLd/UAsET
9+nCdnDaNOD9I8GPdwqA
=Omv3
-----END PGP SIGNATURE-----

--Sig_/VF21p92aMBSd3ErTPqHlWzl--


From MAILER-DAEMON Wed Apr 06 16:58:25 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1anuWv-00032Q-Fj
	for mharc-coreutils@gnu.org; Wed, 06 Apr 2016 16:58:25 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:38268)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mstone@debian.org>) id 1anuWt-000322-1H
	for coreutils@gnu.org; Wed, 06 Apr 2016 16:58:23 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mstone@debian.org>) id 1anuWp-0007ez-QS
	for coreutils@gnu.org; Wed, 06 Apr 2016 16:58:22 -0400
Received: from harad.mathom.us ([54.218.24.45]:34653)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mstone@debian.org>) id 1anuWp-0007eu-Kt
	for coreutils@gnu.org; Wed, 06 Apr 2016 16:58:19 -0400
Received: from osgiliath.mathom.us (osgiliath.mathom.us
	[IPv6:2001:4830:1614:2341::2])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by harad.mathom.us (Postfix) with ESMTPSA id 32692C5
	for <coreutils@gnu.org>; Wed,  6 Apr 2016 20:58:14 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
	by osgiliath.mathom.us (Postfix) with ESMTP id 5C3A46E74A
	for <coreutils@gnu.org>; Wed,  6 Apr 2016 16:58:12 -0400 (EDT)
Received: from osgiliath.mathom.us ([127.0.0.1])
	by localhost (osgiliath.mathom.us [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id Z2DudJNdWeni for <coreutils@gnu.org>;
	Wed,  6 Apr 2016 16:58:12 -0400 (EDT)
Received: by osgiliath.mathom.us (Postfix, from userid 1000)
	id 39BCC6E792; Wed,  6 Apr 2016 16:58:12 -0400 (EDT)
Date: Wed, 6 Apr 2016 16:58:12 -0400
From: Michael Stone <mstone@debian.org>
To: coreutils@gnu.org
Subject: Re: [PATCH] test: Add unary operator -E: test that a file is an
	empty directory
Message-ID: <d07df792-fc39-11e5-9b6a-00163eeb5320@msgid.mathom.us>
Mail-Followup-To: coreutils@gnu.org
References: <1459962572-31799-1-git-send-email-maandree@member.fsf.org>
	<57054E33.6090300@redhat.com>
	<20160406202307.50a3442c.maandree@kth.se>
	<E0F1E107-919A-41E5-BEB5-5F2533035564@gmail.com>
	<20160406215711.444784ff.maandree@kth.se>
	<20160406221026.2e4dedd1.maandree@kth.se>
	<5f14c4d6-fc35-11e5-9b6a-00163eeb5320@msgid.mathom.us>
	<20160406223650.42e06888.maandree@kth.se>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Disposition: inline
In-Reply-To: <20160406223650.42e06888.maandree@kth.se>
X-Pgp-Fingerprint: 02D5 315F F11F 1861 860E  1E02 F61A ACDC FA11 FFDE
User-Agent: Mutt/1.5.23 (2014-03-12)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 54.218.24.45
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Apr 2016 20:58:23 -0000

On Wed, Apr 06, 2016 at 10:36:50PM +0200, Mattias Andr=E9e wrote:
>On Wed, 6 Apr 2016 16:23:23 -0400 Michael Stone <mstone@debian.org> wrot=
e:
>> Just wondering, what's the use case?
>
>I just don't want a separate tool for it,

Well, that's not a particularly compelling use case, especially since=20
testing the output of ls -A seems pretty straightforward.

Mike Stone



From MAILER-DAEMON Wed Apr 06 16:59:38 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1anuY6-0003OW-Q3
	for mharc-coreutils@gnu.org; Wed, 06 Apr 2016 16:59:38 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:38687)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1anuY3-0003Ma-SB
	for coreutils@gnu.org; Wed, 06 Apr 2016 16:59:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1anuY0-0007su-Fg
	for coreutils@gnu.org; Wed, 06 Apr 2016 16:59:35 -0400
Received: from smtp-3.sys.kth.se ([2001:6b0:1:1300:250:56ff:fea6:2de2]:60614)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1anuY0-0007s7-4O
	for coreutils@gnu.org; Wed, 06 Apr 2016 16:59:32 -0400
Received: from smtp-3.sys.kth.se (localhost.localdomain [127.0.0.1])
	by smtp-3.sys.kth.se (Postfix) with ESMTP id B05A21FB7
	for <coreutils@gnu.org>; Wed,  6 Apr 2016 22:59:30 +0200 (CEST)
X-Virus-Scanned: by amavisd-new at kth.se
Received: from smtp-3.sys.kth.se ([127.0.0.1])
	by smtp-3.sys.kth.se (smtp-3.sys.kth.se [127.0.0.1]) (amavisd-new,
	port 10024) with LMTP id RsY-oqZafBUZ for <coreutils@gnu.org>;
	Wed,  6 Apr 2016 22:59:30 +0200 (CEST)
X-KTH-Auth: maandree [81.228.219.220]
X-KTH-mail-from: maandree@member.fsf.org
X-KTH-rcpt-to: coreutils@gnu.org
Received: from localhost.localdomain (h220n13-jak-a12.ias.bredband.telia.com
	[81.228.219.220])
	by smtp-3.sys.kth.se (Postfix) with ESMTPSA id F17A2569
	for <coreutils@gnu.org>; Wed,  6 Apr 2016 22:59:29 +0200 (CEST)
Date: Wed, 6 Apr 2016 22:59:16 +0200
From: Mattias =?UTF-8?B?QW5kcsOpZQ==?= <maandree@member.fsf.org>
To: <coreutils@gnu.org>
Subject: Re: [PATCH] test: Add unary operator -E: test that a file is an
	empty directory
Message-ID: <20160406225916.27c1d326.maandree@kth.se>
In-Reply-To: <20160406223650.42e06888.maandree@kth.se>
References: <1459962572-31799-1-git-send-email-maandree@member.fsf.org>
	<57054E33.6090300@redhat.com>
	<20160406202307.50a3442c.maandree@kth.se>
	<E0F1E107-919A-41E5-BEB5-5F2533035564@gmail.com>
	<20160406215711.444784ff.maandree@kth.se>
	<20160406221026.2e4dedd1.maandree@kth.se>
	<5f14c4d6-fc35-11e5-9b6a-00163eeb5320@msgid.mathom.us>
	<20160406223650.42e06888.maandree@kth.se>
X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-unknown-linux-gnu)
X-Awesomeness: 120 %
User-Agent: Claws Mail
X-Operating-System: GNU/Linux
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	boundary="Sig_/IJ.ga5qL3tE2eAjosoDOWpX";
	protocol="application/pgp-signature"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 2001:6b0:1:1300:250:56ff:fea6:2de2
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Apr 2016 20:59:36 -0000

--Sig_/IJ.ga5qL3tE2eAjosoDOWpX
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Wed, 6 Apr 2016 22:36:50 +0200
Mattias Andr=C3=A9e <maandree@member.fsf.org> wrote:

> On Wed, 6 Apr 2016 16:23:23 -0400
> Michael Stone <mstone@debian.org> wrote:
>=20
> > On Wed, Apr 06, 2016 at 10:10:26PM +0200, Mattias Andr=C3=A9e
> > wrote: =20
> > >We have now demonstrated that attempts to
> > >implement this functionally in shell script
> > >without -E is prone to errors in addition
> > >to being messy.   =20
> >=20
> > Just wondering, what's the use case?
> >=20
> > Mike Stone
> >  =20
>=20
> I just don't want a separate tool for it,
> and I especially do not want to see something
> like the suggested exists command for this =E2=80=94
> that is some harmful shit =E2=80=94 but it could be

I thought I would elaborate on why the suggested
exists(1) is harmful.

People will run something like `exists -- "$1/*"`
and not consider that $1 may contain wildcards
and * does not catch hidden files, or if it does
it will not use the same syntax as sh.

> useful on some more advanced shell scripts =E2=80=94
> you know how some people write entire programs
> in Bash, you do sometimes have to make this
> test in actual programs, such as diff and shred
> =E2=80=94 and it is nice for completeness, just like
> there is flag for every file type including
> FIFO:s, sockets and even terminals.


--Sig_/IJ.ga5qL3tE2eAjosoDOWpX
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJXBXikAAoJEM4wYJDpiwjHvdsQAIkMd5Zc5px1FzRWxtDl4SgE
e0VAWZN+qYIunHCRKwT3MlnEvjJ8JFc7luLyqhRAuvP3n+xut8HTzniUUfCGEQnO
qRWWNSd8y41JGC1LYe2wqGlPBMffVyVsf/i71LqHd99gX1tCfN/dysscAKv3xpQn
B9+Pg5ZLPGTFtVsnL/64DZNxinte+Tu8mRjrVjFavrmnl7YliGwHxo/TAZO+V4x7
v9Tc6+acuWgwMbXCLIG+5/n6BiJP3cSs1FblALygTcd4QqGUgYp8mq3BPkIxyKJ8
fN/QhYtw3eK+GTDdwiMJ5EKSfNVr7h0JThepGcNTpH/JiBMxoqcRCevl5Tjo6KKM
ugCeYwfDF4lZK1q/tpe2SzSwX6sIiQI1CWVyazgiAIypJg8qFkkWFOS/JvrCzpnP
jkSpCjHwwri/xKJQP802J3DlOJtmS0Xo88bk1z8TBHYSjuDi/rHVg4KksuwkMKLS
UFXyCuxYP8btX8qxCS2EkOBx7do7Er7S9d2n57W8XgcjI/wI4RnYj2rILW1ocHWm
GH3lwGGSJNWwA6MVL6+XL2/o56HhaO8ITiyr1YGU/BHcp7dnxXDMDUOn1YoL/DFF
sNx5eEAJRZD/JVgId/k6NbrCmMTuqxP53Q7yLyiTbzaedRhu54XqKt1HqLczn4lC
xlU3ZIEnI6BBmg/hxzPW
=/lu1
-----END PGP SIGNATURE-----

--Sig_/IJ.ga5qL3tE2eAjosoDOWpX--


From MAILER-DAEMON Wed Apr 06 17:33:24 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1anv4m-0006aB-Lc
	for mharc-coreutils@gnu.org; Wed, 06 Apr 2016 17:33:24 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:46385)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1anv4k-0006ZO-9R
	for coreutils@gnu.org; Wed, 06 Apr 2016 17:33:23 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1anv4g-0007dO-5y
	for coreutils@gnu.org; Wed, 06 Apr 2016 17:33:22 -0400
Received: from smtp-4.sys.kth.se ([2001:6b0:1:1300:250:56ff:fea6:2de3]:48346)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1anv4f-0007d9-Pg
	for coreutils@gnu.org; Wed, 06 Apr 2016 17:33:18 -0400
Received: from smtp-4.sys.kth.se (localhost.localdomain [127.0.0.1])
	by smtp-4.sys.kth.se (Postfix) with ESMTP id 99EF9EEA
	for <coreutils@gnu.org>; Wed,  6 Apr 2016 23:33:16 +0200 (CEST)
X-Virus-Scanned: by amavisd-new at kth.se
Received: from smtp-4.sys.kth.se ([127.0.0.1])
	by smtp-4.sys.kth.se (smtp-4.sys.kth.se [127.0.0.1]) (amavisd-new,
	port 10024) with LMTP id Kocikolav-jE for <coreutils@gnu.org>;
	Wed,  6 Apr 2016 23:33:15 +0200 (CEST)
X-KTH-Auth: maandree [81.228.219.220]
X-KTH-mail-from: maandree@member.fsf.org
X-KTH-rcpt-to: coreutils@gnu.org
Received: from localhost.localdomain (h220n13-jak-a12.ias.bredband.telia.com
	[81.228.219.220])
	by smtp-4.sys.kth.se (Postfix) with ESMTPSA id 87812E0E
	for <coreutils@gnu.org>; Wed,  6 Apr 2016 23:33:15 +0200 (CEST)
Date: Wed, 6 Apr 2016 23:33:02 +0200
From: Mattias =?UTF-8?B?QW5kcsOpZQ==?= <maandree@member.fsf.org>
To: <coreutils@gnu.org>
Subject: Re: [PATCH] test: Add unary operator -E: test that a file is an
	empty directory
Message-ID: <20160406233302.3a82ea12.maandree@kth.se>
In-Reply-To: <d07df792-fc39-11e5-9b6a-00163eeb5320@msgid.mathom.us>
References: <1459962572-31799-1-git-send-email-maandree@member.fsf.org>
	<57054E33.6090300@redhat.com>
	<20160406202307.50a3442c.maandree@kth.se>
	<E0F1E107-919A-41E5-BEB5-5F2533035564@gmail.com>
	<20160406215711.444784ff.maandree@kth.se>
	<20160406221026.2e4dedd1.maandree@kth.se>
	<5f14c4d6-fc35-11e5-9b6a-00163eeb5320@msgid.mathom.us>
	<20160406223650.42e06888.maandree@kth.se>
	<d07df792-fc39-11e5-9b6a-00163eeb5320@msgid.mathom.us>
X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-unknown-linux-gnu)
X-Awesomeness: 120 %
User-Agent: Claws Mail
X-Operating-System: GNU/Linux
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	boundary="Sig_/BfY7mDg04LoKOX.Hxd_P0h1";
	protocol="application/pgp-signature"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 2001:6b0:1:1300:250:56ff:fea6:2de3
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Apr 2016 21:33:23 -0000

--Sig_/BfY7mDg04LoKOX.Hxd_P0h1
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Wed, 6 Apr 2016 16:58:12 -0400
Michael Stone <mstone@debian.org> wrote:

> On Wed, Apr 06, 2016 at 10:36:50PM +0200, Mattias Andr=C3=A9e
> wrote:
> >On Wed, 6 Apr 2016 16:23:23 -0400 Michael Stone
> ><mstone@debian.org> wrote: =20
> >> Just wondering, what's the use case? =20
> >
> >I just don't want a separate tool for it, =20
>=20
> Well, that's not a particularly compelling use case,
> especially since testing the output of ls -A seems pretty
> straightforward.

But what is likely is that people write sometime like

  test -d "$1" && test $(ls -1 "$1" | wc -l) =3D 0

Most people are of course going to miss to use --,
but that is always the case and it is just an unimportant
bonus that that does not matter with test.

Then we also have the problem that people will not
consider that file may be a symlink ("$1/" is required.)

People will also forget hidden files.

But yes, you do not need it, just like you do not need
head, echo, cut --complement, basename, dirname, pwd,
seq, printenv that does not fail with exit value 2
(well, you do need that one if you want to be portable,)
suffixes and multiple arguments in sleep, touch, true,
false, yes, link, unlink, rm -d, test -bcdefghLnpSstuz,
test -ne, test -ge, test -le, test -lt, test -ef,
test !=3D, [. They can all be trivially implemented using
other tools, with with a subset of the tool, with only
marginal performance impact. but they are still nice to
have.

>=20
> Mike Stone
>=20
>=20


--Sig_/BfY7mDg04LoKOX.Hxd_P0h1
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJXBYCOAAoJEM4wYJDpiwjHtIkQAJ02goQzXgGcb9R1KRTB3r4W
7ovpU3LN462HdcVMptDuyg28PLsv1r2eqD55m6gRYcNWy5m6c5cxPoFpwja2m2s0
WdT/97UYUUTwx467AexrmSA4zImO5Dm0xQ1x/fFgZTa1oeKu3xMFHxwgSMYw2EFU
gslUPthXjUqTrz+lIcQgB7nyEQK824LnkTmULEkoMEeX9zIXtAGMGOr6rU0ZPb7v
uUCLvTjTYu7RxP/iNGp1qmpf0L1kmjAscqiVo+8G0QQYUpvT90FA+KhMc56c9HD2
Eosb6idKdNrPHtcADnlhjYyfc4O+3vbXt/AoWevOCJfXt4cRDPhVTqW0N1A89cm3
d6tmgcRIPwMKuBRDDuzmIJl4hfx2waNPVliHz6M3qtX3+RliteOZ2ZpyutG0TOsP
kLVogk8i+gfpqPWqQyoqGUSQ/5QBhp/8OjivMuKo0clcAtsB1QJeGd643/lwJtqG
VS7yFTUxSBfuW+PCcFIRBoCXirBjGbFH91UEfl7xgm+iSQeb22KtvEuihn3sZjFN
lRxd+crrznhjdCbZa6bK0nL00jC3QEOa0UQN7FTbmQDOsiw0mQYI3sJRnHjk0F9B
qNCDRBTztKoGS+q7bmyh2H98g1n2rlXnsKinYxmkfYQYZkUk3wS2yLKKpj8eBOTr
pXIB51Gpp/rmaLC6ftOE
=KfRV
-----END PGP SIGNATURE-----

--Sig_/BfY7mDg04LoKOX.Hxd_P0h1--


From MAILER-DAEMON Wed Apr 06 18:05:09 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1anvZV-0001NM-KB
	for mharc-coreutils@gnu.org; Wed, 06 Apr 2016 18:05:09 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:52348)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1anvZT-0001Ki-6q
	for coreutils@gnu.org; Wed, 06 Apr 2016 18:05:08 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1anvZQ-0006Ld-13
	for coreutils@gnu.org; Wed, 06 Apr 2016 18:05:07 -0400
Received: from smtp-4.sys.kth.se ([2001:6b0:1:1300:250:56ff:fea6:2de3]:52836)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1anvZP-0006LQ-MZ
	for coreutils@gnu.org; Wed, 06 Apr 2016 18:05:03 -0400
Received: from smtp-4.sys.kth.se (localhost.localdomain [127.0.0.1])
	by smtp-4.sys.kth.se (Postfix) with ESMTP id 6A1431D25
	for <coreutils@gnu.org>; Thu,  7 Apr 2016 00:05:02 +0200 (CEST)
X-Virus-Scanned: by amavisd-new at kth.se
Received: from smtp-4.sys.kth.se ([127.0.0.1])
	by smtp-4.sys.kth.se (smtp-4.sys.kth.se [127.0.0.1]) (amavisd-new,
	port 10024) with LMTP id YevDzcBe1fpn for <coreutils@gnu.org>;
	Thu,  7 Apr 2016 00:05:01 +0200 (CEST)
X-KTH-Auth: maandree [81.228.219.220]
X-KTH-mail-from: maandree@member.fsf.org
X-KTH-rcpt-to: coreutils@gnu.org
Received: from localhost.localdomain (h220n13-jak-a12.ias.bredband.telia.com
	[81.228.219.220])
	by smtp-4.sys.kth.se (Postfix) with ESMTPSA id 1EB28B89
	for <coreutils@gnu.org>; Thu,  7 Apr 2016 00:04:59 +0200 (CEST)
Date: Thu, 7 Apr 2016 00:04:54 +0200
From: Mattias =?UTF-8?B?QW5kcsOpZQ==?= <maandree@member.fsf.org>
To: <coreutils@gnu.org>
Subject: Re: [PATCH] test: Add unary operator -E: test that a file is an
	empty directory
Message-ID: <20160407000454.0002468d.maandree@kth.se>
In-Reply-To: <20160406233302.3a82ea12.maandree@kth.se>
References: <1459962572-31799-1-git-send-email-maandree@member.fsf.org>
	<57054E33.6090300@redhat.com>
	<20160406202307.50a3442c.maandree@kth.se>
	<E0F1E107-919A-41E5-BEB5-5F2533035564@gmail.com>
	<20160406215711.444784ff.maandree@kth.se>
	<20160406221026.2e4dedd1.maandree@kth.se>
	<5f14c4d6-fc35-11e5-9b6a-00163eeb5320@msgid.mathom.us>
	<20160406223650.42e06888.maandree@kth.se>
	<d07df792-fc39-11e5-9b6a-00163eeb5320@msgid.mathom.us>
	<20160406233302.3a82ea12.maandree@kth.se>
X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-unknown-linux-gnu)
X-Awesomeness: 120 %
User-Agent: Claws Mail
X-Operating-System: GNU/Linux
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	boundary="Sig_/WZg7aJlB.6UH4W/+utRTguz";
	protocol="application/pgp-signature"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 2001:6b0:1:1300:250:56ff:fea6:2de3
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Apr 2016 22:05:08 -0000

--Sig_/WZg7aJlB.6UH4W/+utRTguz
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Wed, 6 Apr 2016 23:33:02 +0200
Mattias Andr=C3=A9e <maandree@member.fsf.org> wrote:

> On Wed, 6 Apr 2016 16:58:12 -0400
> Michael Stone <mstone@debian.org> wrote:
>=20
> > On Wed, Apr 06, 2016 at 10:36:50PM +0200, Mattias Andr=C3=A9e
> > wrote: =20
> > >On Wed, 6 Apr 2016 16:23:23 -0400 Michael Stone
> > ><mstone@debian.org> wrote:   =20
> > >> Just wondering, what's the use case?   =20
> > >
> > >I just don't want a separate tool for it,   =20
> >=20
> > Well, that's not a particularly compelling use case,
> > especially since testing the output of ls -A seems
> > pretty straightforward. =20
>=20
> But what is likely is that people write sometime like
>=20
>   test -d "$1" && test $(ls -1 "$1" | wc -l) =3D 0
>=20
> Most people are of course going to miss to use --,
> but that is always the case and it is just an unimportant
> bonus that that does not matter with test.
>=20
> Then we also have the problem that people will not
> consider that file may be a symlink ("$1/" is required.)
>=20
> People will also forget hidden files.
>=20
> But yes, you do not need it, just like you do not need
> head, echo, cut --complement, basename, dirname, pwd,
> seq, printenv that does not fail with exit value 2
> (well, you do need that one if you want to be portable,)
> suffixes and multiple arguments in sleep, touch, true,
> false, yes, link, unlink, rm -d, test -bcdefghLnpSstuz,

Missed test -k.

Sorry, I had to add this, it was disturbing my sleep.

> test -ne, test -ge, test -le, test -lt, test -ef,
> test !=3D, [. They can all be trivially implemented using
> other tools, with with a subset of the tool, with only
> marginal performance impact. but they are still nice to
> have.
>=20
> >=20
> > Mike Stone
> >=20
> >  =20
>=20


--Sig_/WZg7aJlB.6UH4W/+utRTguz
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJXBYgGAAoJEM4wYJDpiwjHhs0P/ia2vu2cNAI6bztSkcVLfVFV
YHGgdHS+tsDGH5udqWpgrDuuRewuPY8hT2iB1qi+oZK5g5Rb44tWcPPaM2Fq8Qmu
7+BZ6ctgIpraEvrlHI3FsZ5lz7rYVw9A3axpHxUFq61uArgicdlqDeW9pa5gPNoo
0pa/D1IC8RgT2JUPoC5v6BO8Ydv+5dY0rucFnjb2KmXTHMWqLzxsQbTrj7YgYHUB
nqL0lCYH3PL2qoMcyIAMJHfoSuvZGQ8UyZxAuikunMvbDK7vAHXT55jrmPIuWmQo
gqQWgwvFphTJB4vTn0HjyDh/BkLUytRrFBhW7NqRLrOL1KHK0a02XzG8EZsN/og4
k0EfLB/Bf0LAK8wx5pz2RTNvRP7RbMb2Z7/2b2tol1K/baYBUjguKFh2OMZe8tlE
/WWoy/N1e7dSdUJL3eqXI/hd7xTvH5G5Mq25ssMgWGXMJhfLOl/zvmVNbVRvCqsh
Z8nKwzWNFYPXYiDIoFAMqCOY8W1uGB2NmE/ZctO9JqnA81RrFT9MDvHzEgcCLgEc
NvNg/DyKw6buI0Oehhzfgv8fzkkZofeEUDLn7kKhxvz1l7o1ylrBSPW7pAL7d+rI
ZDvrJLI6z2Ae+XYfJemSUEcd/PWijTUs4lkMiEqrwSYvrKgjtBRVBN2sG49XVNeu
KbRX9ezSEoS6LUD79Xtj
=iUlw
-----END PGP SIGNATURE-----

--Sig_/WZg7aJlB.6UH4W/+utRTguz--


From MAILER-DAEMON Thu Apr 07 04:35:20 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ao5PM-0008Ci-4S
	for mharc-coreutils@gnu.org; Thu, 07 Apr 2016 04:35:20 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:36272)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@kth.se>) id 1ao5PJ-000855-En
	for coreutils@gnu.org; Thu, 07 Apr 2016 04:35:18 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <maandree@kth.se>) id 1ao5PE-0006MU-SD
	for coreutils@gnu.org; Thu, 07 Apr 2016 04:35:17 -0400
Received: from smtp-3.sys.kth.se ([130.237.48.192]:36304)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@kth.se>) id 1ao5PE-0006MM-ID
	for coreutils@gnu.org; Thu, 07 Apr 2016 04:35:12 -0400
Received: from smtp-3.sys.kth.se (localhost.localdomain [127.0.0.1])
	by smtp-3.sys.kth.se (Postfix) with ESMTP id 7088E333;
	Thu,  7 Apr 2016 10:35:09 +0200 (CEST)
X-Virus-Scanned: by amavisd-new at kth.se
Received: from smtp-3.sys.kth.se ([127.0.0.1])
	by smtp-3.sys.kth.se (smtp-3.sys.kth.se [127.0.0.1]) (amavisd-new,
	port 10024)
	with LMTP id SSpko89PmVsu; Thu,  7 Apr 2016 10:35:08 +0200 (CEST)
X-KTH-Auth: maandree [81.228.219.220]
X-KTH-mail-from: maandree@kth.se
Received: from localhost.localdomain (h220n13-jak-a12.ias.bredband.telia.com
	[81.228.219.220])
	by smtp-3.sys.kth.se (Postfix) with ESMTPSA id 983362FA;
	Thu,  7 Apr 2016 10:35:08 +0200 (CEST)
From: =?UTF-8?q?Mattias=20Andr=C3=A9e?= <maandree@member.fsf.org>
To: coreutils@gnu.org
Subject: [PATCH v2 1/2] test: Add unary operator -E: test that a file is an
	empty directory
Date: Thu,  7 Apr 2016 10:34:56 +0200
Message-Id: <1460018097-31668-1-git-send-email-maandree@member.fsf.org>
X-Mailer: git-send-email 2.8.0
In-Reply-To: <1459962572-31799-1-git-send-email-maandree@member.fsf.org>
References: <1459962572-31799-1-git-send-email-maandree@member.fsf.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 130.237.48.192
Cc: =?UTF-8?q?Mattias=20Andr=C3=A9e?= <maandree@member.fsf.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 07 Apr 2016 08:35:18 -0000

---
 NEWS               |  5 +++++
 doc/coreutils.texi |  7 ++++++-
 src/test.c         | 44 +++++++++++++++++++++++++++++++++++++++++++-
 3 files changed, 54 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index dd3ee9c..3445b17 100644
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,11 @@ GNU coreutils NEWS                                    -*- outline -*-
    The 2008 edition of POSIX dropped the requirement that arguments
    like '+2' must be treated as file names.
 
+** New features
+
+   test now have the -E flag which tests that a file exists and is
+   an empty directory.
+
 
 * Noteworthy changes in release 8.25 (2016-01-20) [stable]
 
diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 45706bd..e399986 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -12420,7 +12420,7 @@ Exit status:
 @end display
 
 @menu
-* File type tests::             -[bcdfhLpSt]
+* File type tests::             -[bcEdfhLpSt]
 * Access permission tests::     -[gkruwxOG]
 * File characteristic tests::   -e -s -nt -ot -ef
 * String tests::                -z -n = == !=
@@ -12449,6 +12449,11 @@ True if @var{file} exists and is a block special device.
 @cindex character special check
 True if @var{file} exists and is a character special device.
 
+@item -E @var{file}
+@opindex -E
+@cindex empty directory check
+True if @var{file} exists, is a directory, and is empty.
+
 @item -d @var{file}
 @opindex -d
 @cindex directory check
diff --git a/src/test.c b/src/test.c
index 8ac7467..eb9c43a 100644
--- a/src/test.c
+++ b/src/test.c
@@ -27,6 +27,7 @@
 #endif
 
 #include <config.h>
+#include <dirent.h>
 #include <stdio.h>
 #include <sys/types.h>
 
@@ -179,6 +180,39 @@ get_mtime (char const *filename, struct timespec *mtime)
   return ok;
 }
 
+/* Return true iff DIR is empty. DIR must be a directory.  */
+static bool
+empty_p (char const *dirname)
+{
+  DIR *dir;
+  struct dirent *de;
+
+  dir = opendir (dirname);
+  if (!dir)
+    {
+      error (0, errno, "%s", dirname);
+      test_exit (TEST_FAILURE);
+    }
+
+  while (errno = 0, (de = readdir (dir)))
+    {
+      if (de->d_name[0] == '.')
+        if (de->d_name[1 + (de->d_name[1] == '.')] == '\0')
+          continue;
+      closedir (dir);
+      return 0;
+    }
+
+  if (errno)
+    {
+      error (0, errno, "%s", dirname);
+      closedir (dir);
+      test_exit (TEST_FAILURE);
+    }
+  closedir (dir);
+  return 1;
+}
+
 /* Return true if S is one of the test command's binary operators.  */
 static bool
 binop (char const *s)
@@ -457,6 +491,12 @@ unary_operator (void)
       return (stat (argv[pos - 1], &stat_buf) == 0
               && S_ISDIR (stat_buf.st_mode));
 
+    case 'E':			/* File is an empty directory? */
+      unary_advance ();
+      return (stat (argv[pos - 1], &stat_buf) == 0
+              && S_ISDIR (stat_buf.st_mode)
+              && empty_p (argv[pos - 1]));
+
     case 's':			/* File has something in it? */
       unary_advance ();
       return (stat (argv[pos - 1], &stat_buf) == 0
@@ -590,7 +630,8 @@ test_unop (char const *op)
     case 'f': case 'g': case 'h': case 'k': case 'n':
     case 'o': case 'p': case 'r': case 's': case 't':
     case 'u': case 'w': case 'x': case 'z':
-    case 'G': case 'L': case 'O': case 'S': case 'N':
+    case 'E': case 'G': case 'L': case 'O': case 'S':
+    case 'N':
       return true;
     default:
       return false;
@@ -760,6 +801,7 @@ EXPRESSION is true or false and sets exit status.  It is one of:\n\
   -c FILE     FILE exists and is character special\n\
   -d FILE     FILE exists and is a directory\n\
   -e FILE     FILE exists\n\
+  -E FILE     FILE exists and is an empty directory\n\
 "), stdout);
       fputs (_("\
   -f FILE     FILE exists and is a regular file\n\
-- 
2.8.0



From MAILER-DAEMON Thu Apr 07 04:35:22 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ao5PO-0008IH-Ha
	for mharc-coreutils@gnu.org; Thu, 07 Apr 2016 04:35:22 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:36271)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@kth.se>) id 1ao5PJ-000854-Ex
	for coreutils@gnu.org; Thu, 07 Apr 2016 04:35:19 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <maandree@kth.se>) id 1ao5PG-0006Mn-DC
	for coreutils@gnu.org; Thu, 07 Apr 2016 04:35:17 -0400
Received: from smtp-3.sys.kth.se ([130.237.48.192]:36329)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@kth.se>) id 1ao5PG-0006Mf-2W
	for coreutils@gnu.org; Thu, 07 Apr 2016 04:35:14 -0400
Received: from smtp-3.sys.kth.se (localhost.localdomain [127.0.0.1])
	by smtp-3.sys.kth.se (Postfix) with ESMTP id F2F10333;
	Thu,  7 Apr 2016 10:35:12 +0200 (CEST)
X-Virus-Scanned: by amavisd-new at kth.se
Received: from smtp-3.sys.kth.se ([127.0.0.1])
	by smtp-3.sys.kth.se (smtp-3.sys.kth.se [127.0.0.1]) (amavisd-new,
	port 10024)
	with LMTP id r8Ebm7YiLKjS; Thu,  7 Apr 2016 10:35:11 +0200 (CEST)
X-KTH-Auth: maandree [81.228.219.220]
X-KTH-mail-from: maandree@kth.se
Received: from localhost.localdomain (h220n13-jak-a12.ias.bredband.telia.com
	[81.228.219.220])
	by smtp-3.sys.kth.se (Postfix) with ESMTPSA id 653385EF;
	Thu,  7 Apr 2016 10:35:11 +0200 (CEST)
From: =?UTF-8?q?Mattias=20Andr=C3=A9e?= <maandree@member.fsf.org>
To: coreutils@gnu.org
Subject: [PATCH v2 2/2] tests: test: Add tests for file-type tests,
	including the new -E flag
Date: Thu,  7 Apr 2016 10:34:57 +0200
Message-Id: <1460018097-31668-2-git-send-email-maandree@member.fsf.org>
X-Mailer: git-send-email 2.8.0
In-Reply-To: <1460018097-31668-1-git-send-email-maandree@member.fsf.org>
References: <1459962572-31799-1-git-send-email-maandree@member.fsf.org>
	<1460018097-31668-1-git-send-email-maandree@member.fsf.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 130.237.48.192
Cc: =?UTF-8?q?Mattias=20Andr=C3=A9e?= <maandree@member.fsf.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 07 Apr 2016 08:35:20 -0000

---
 tests/local.mk           |   3 +-
 tests/misc/test.pl       | 197 -----------------------------------------------
 tests/test/file-types.sh | 190 +++++++++++++++++++++++++++++++++++++++++++++
 tests/test/misc.pl       | 197 +++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 389 insertions(+), 198 deletions(-)
 delete mode 100755 tests/misc/test.pl
 create mode 100755 tests/test/file-types.sh
 create mode 100755 tests/test/misc.pl

diff --git a/tests/local.mk b/tests/local.mk
index a83c3d0..c648998 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -233,7 +233,8 @@ all_tests =					\
   tests/fmt/goal-option.sh			\
   tests/misc/env.sh				\
   tests/misc/ptx.pl				\
-  tests/misc/test.pl				\
+  tests/test/misc.pl				\
+  tests/test/file-types.sh			\
   tests/misc/seq.pl				\
   tests/misc/seq-long-double.sh			\
   tests/misc/seq-precision.sh			\
diff --git a/tests/misc/test.pl b/tests/misc/test.pl
deleted file mode 100755
index 1091d3a..0000000
--- a/tests/misc/test.pl
+++ /dev/null
@@ -1,197 +0,0 @@
-#!/usr/bin/perl
-
-# Copyright (C) 2008-2016 Free Software Foundation, Inc.
-
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-use strict;
-
-my $limits = getlimits ();
-
-my $prog = 'test';
-
-# Turn off localization of executable's output.
-@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
-
-sub digest_test ($)
-{
-  my ($t) = @_;
-  my @args;
-  my $ret = 0;
-  my @list_of_hashref;
-  foreach my $e (@$t)
-    {
-      !ref $e
-        and push (@args, $e), next;
-      ref $e eq 'HASH'
-        or (warn "$0: $t->[0]: unexpected entry type\n"), next;
-
-      exists $e->{EXIT}
-        and $ret = $e->{EXIT}, next;
-
-      push @list_of_hashref, $e;
-    }
-  shift @args; # discard test name
-  my $flags = join ' ', @args;
-
-  return ($flags, $ret, \@list_of_hashref);
-}
-
-sub add_inverse_op_tests($)
-{
-  my ($tests) = @_;
-  my @new;
-
-  my %inverse_op =
-    (
-     eq => 'ne',
-     lt => 'ge',
-     gt => 'le',
-    );
-
-  foreach my $t (@$tests)
-    {
-      push @new, $t;
-
-      my $test_name = $t->[0];
-      my ($flags, $ret, $LoH) = digest_test $t;
-
-      # Generate corresponding tests of inverse ops.
-      # E.g. generate tests of '-ge' from those of '-lt'.
-      foreach my $op (qw(gt lt eq))
-        {
-          if ($test_name =~ /$op-/ && $flags =~ / -$op /)
-            {
-              my $inv = $inverse_op{$op};
-              $test_name =~ s/$op/$inv/;
-              $flags =~ s/-$op/-$inv/;
-              $ret = 1 - $ret;
-              push (@new, [$test_name, $flags, {EXIT=>$ret}, @$LoH]);
-            }
-        }
-    }
-  return @new;
-}
-
-sub add_pn_tests($)
-{
-  my ($tests) = @_;
-  my @new;
-
-  # Generate parenthesized and negated versions of each test.
-  # There are a few exceptions.
-  my %not_N   = map {$_ => 1} qw (1a);
-  my %not_P   = map {$_ => 1} qw (1a
-                                  streq-6 strne-6
-                                  paren-1 paren-2 paren-3 paren-4 paren-5);
-  foreach my $t (@$tests)
-    {
-      push @new, $t;
-
-      my $test_name = $t->[0];
-      my ($flags, $ret, $LoH) = digest_test $t;
-      next if $ret == 2;
-
-      push (@new, ["N-$test_name", "! $flags", {EXIT=>1-$ret}, @$LoH])
-        unless $not_N{$test_name};
-      push (@new, ["P-$test_name", "'(' $flags ')'", {EXIT=>$ret}, @$LoH])
-        unless $not_P{$test_name};
-      push (@new, ["NP-$test_name", "! '(' $flags ')'", {EXIT=>1-$ret}, @$LoH])
-        unless $not_P{$test_name};
-      push (@new, ["NNP-$test_name", "! ! '(' $flags ')'", {EXIT=>$ret, @$LoH}])
-        unless $not_P{$test_name};
-    }
-
-  return @new;
-}
-
-my @Tests =
-(
-  ['1a', {EXIT=>1}],
-  ['1b', qw(-z '')],
-  ['1c', 'any-string'],
-  ['1d', qw(-n any-string)],
-  ['1e', "''", {EXIT=>1}],
-  ['1f', '-'],
-  ['1g', '--'],
-  ['1h', '-0'],
-  ['1i', '-f'],
-  ['1j', '--help'],
-  ['1k', '--version'],
-
-  ['streq-1', qw(t = t)],
-  ['streq-2', qw(t = f), {EXIT=>1}],
-  ['streqeq-1', qw(t == t)],
-  ['streqeq-2', qw(t == f), {EXIT=>1}],
-  ['streq-3', qw(! = !)],
-  ['streq-4', qw(= = =)],
-  ['streq-5', "'(' = '('"],
-  ['streq-6', "'(' = ')'", {EXIT=>1}],
-  ['strne-1', qw(t != t), {EXIT=>1}],
-  ['strne-2', qw(t != f)],
-  ['strne-3', qw(! != !), {EXIT=>1}],
-  ['strne-4', qw(= != =), {EXIT=>1}],
-  ['strne-5', "'(' != '('", {EXIT=>1}],
-  ['strne-6', "'(' != ')'"],
-
-  ['and-1', qw(t -a t)],
-  ['and-2', qw('' -a t), {EXIT=>1}],
-  ['and-3', qw(t -a ''), {EXIT=>1}],
-  ['and-4', qw('' -a ''), {EXIT=>1}],
-
-  ['or-1', qw(t -o t)],
-  ['or-2', qw('' -o t)],
-  ['or-3', qw(t -o '')],
-  ['or-4', qw('' -o ''), {EXIT=>1}],
-
-  ['eq-1', qw(9 -eq 9)],
-  ['eq-2', qw(0 -eq 0)],
-  ['eq-3', qw(0 -eq 00)],
-  ['eq-4', qw(8 -eq 9), {EXIT=>1}],
-  ['eq-5', qw(1 -eq 0), {EXIT=>1}],
-  ['eq-6', "$limits->{UINTMAX_OFLOW} -eq 0", {EXIT=>1}],
-
-  ['gt-1', qw(5 -gt 5), {EXIT=>1}],
-  ['gt-2', qw(5 -gt 4)],
-  ['gt-3', qw(4 -gt 5), {EXIT=>1}],
-  ['gt-4', qw(-1 -gt -2)],
-  ['gt-5', "$limits->{UINTMAX_OFLOW} -gt $limits->{INTMAX_UFLOW}"],
-
-  ['lt-1', qw(5 -lt 5), {EXIT=>1}],
-  ['lt-2', qw(5 -lt 4), {EXIT=>1}],
-  ['lt-3', qw(4 -lt 5)],
-  ['lt-4', qw(-1 -lt -2), {EXIT=>1}],
-  ['lt-5', "$limits->{INTMAX_UFLOW} -lt $limits->{UINTMAX_OFLOW}"],
-
-  ['inv-1', qw(0x0 -eq 00), {EXIT=>2},
-   {ERR=>"$prog: invalid integer '0x0'\n"}],
-
-  ['t1', "-t"],
-  ['t2', qw(-t 1), {EXIT=>1}],
-
-  ['paren-1', "'(' '' ')'", {EXIT=>1}],
-  ['paren-2', "'(' '(' ')'"],
-  ['paren-3', "'(' ')' ')'"],
-  ['paren-4', "'(' ! ')'"],
-  ['paren-5', "'(' -a ')'"],
-);
-
-@Tests = add_inverse_op_tests \@Tests;
-@Tests = add_pn_tests \@Tests;
-
-my $save_temps = $ENV{DEBUG};
-my $verbose = $ENV{VERBOSE};
-
-my $fail = run_tests ($prog, \$prog, \@Tests, $save_temps, $verbose);
-exit $fail;
diff --git a/tests/test/file-types.sh b/tests/test/file-types.sh
new file mode 100755
index 0000000..a2bbc14
--- /dev/null
+++ b/tests/test/file-types.sh
@@ -0,0 +1,190 @@
+#!/bin/sh
+# Verify test's file-type test flags.
+
+# Copyright (C) 2016 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
+print_ver_ test
+
+test -e /dev/null        || skip_ 'requires /dev/null'
+test -e /dev/sda         || skip_ 'requires /dev/sda'
+test -x /usr/bin/python3 || skip_ 'requires /usr/bin/python3'
+
+mkdir dir.empty                || framework_failure_
+mkdir dir.visible              || framework_failure_
+touch dir.visible/x            || framework_failure_
+mkdir dir.hidden               || framework_failure_
+touch dir.hidden/.x            || framework_failure_
+touch reg                      || framework_failure_
+mkfifo fifo                    || framework_failure_
+ln -s reg lreg                 || framework_failure_
+ln -s dir.empty ldir.empty     || framework_failure_
+ln -s dir.hidden ldir.hidden   || framework_failure_
+ln -s dir.visible ldir.visible || framework_failure_
+ln -s /dev/sda lblock          || framework_failure_
+ln -s /dev/null lchar          || framework_failure_
+ln -s fifo lfifo               || framework_failure_
+ln -s socket lsocket           || framework_failure_
+ln -s nonexisting dangling     || framework_failure_
+ln -s selfref selfref          || framework_failure_
+/usr/bin/python3 <<EOF         || framework_failure_
+import socket
+socket.socket(socket.AF_UNIX, socket.SOCK_STREAM).bind('socket')
+EOF
+
+# Block devices.
+env test -b /dev/sda     || fail=1
+env test -b lblock       || fail=1
+env test -b /dev/null    && fail=1
+env test -b lchar        && fail=1
+env test -b dir.empty    && fail=1
+env test -b dir.hidden   && fail=1
+env test -b dir.visible  && fail=1
+env test -b reg          && fail=1
+env test -b fifo         && fail=1
+env test -b socket       && fail=1
+env test -b ldir.empty   && fail=1
+env test -b ldir.hidden  && fail=1
+env test -b ldir.visible && fail=1
+env test -b lreg         && fail=1
+env test -b lfifo        && fail=1
+env test -b lsocket      && fail=1
+env test -b dangling     && fail=1
+env test -b selfref      && fail=1
+
+# Character devices.
+env test -c /dev/null    || fail=1
+env test -c lchar        || fail=1
+env test -c /dev/sda     && fail=1
+env test -c lblock       && fail=1
+env test -c dir.empty    && fail=1
+env test -c dir.hidden   && fail=1
+env test -c dir.visible  && fail=1
+env test -c reg          && fail=1
+env test -c fifo         && fail=1
+env test -c socket       && fail=1
+env test -c ldir.empty   && fail=1
+env test -c ldir.hidden  && fail=1
+env test -c ldir.visible && fail=1
+env test -c lreg         && fail=1
+env test -c lfifo        && fail=1
+env test -c lsocket      && fail=1
+env test -c dangling     && fail=1
+env test -c selfref      && fail=1
+
+# Directories.
+env test -d dir.empty    || fail=1
+env test -d dir.visible  || fail=1
+env test -d dir.hidden   || fail=1
+env test -d ldir.empty   || fail=1
+env test -d ldir.visible || fail=1
+env test -d ldir.hidden  || fail=1
+env test -d /dev/null    && fail=1
+env test -d lchar        && fail=1
+env test -d /dev/sda     && fail=1
+env test -d lblock       && fail=1
+env test -d reg          && fail=1
+env test -d fifo         && fail=1
+env test -d socket       && fail=1
+env test -d lreg         && fail=1
+env test -d lfifo        && fail=1
+env test -d lsocket      && fail=1
+env test -d dangling     && fail=1
+env test -d selfref      && fail=1
+
+# Empty directories.
+env test -E dir.empty    || fail=1
+env test -E ldir.empty   || fail=1
+env test -E dir.visible  && fail=1
+env test -E dir.hidden   && fail=1
+env test -E ldir.visible && fail=1
+env test -E ldir.hidden  && fail=1
+env test -E /dev/null    && fail=1
+env test -E lchar        && fail=1
+env test -E /dev/sda     && fail=1
+env test -E lblock       && fail=1
+env test -E reg          && fail=1
+env test -E fifo         && fail=1
+env test -E socket       && fail=1
+env test -E lreg         && fail=1
+env test -E lfifo        && fail=1
+env test -E lsocket      && fail=1
+env test -E dangling     && fail=1
+env test -E selfref      && fail=1
+
+# Symbolic links.
+env test -L lreg         || fail=1
+env test -L ldir.empty   || fail=1
+env test -L ldir.visible || fail=1
+env test -L ldir.hidden  || fail=1
+env test -L lblock       || fail=1
+env test -L lchar        || fail=1
+env test -L lfifo        || fail=1
+env test -L lsocket      || fail=1
+env test -L dangling     || fail=1
+env test -L selfref      || fail=1
+env test -L dir.empty    && fail=1
+env test -L dir.visible  && fail=1
+env test -L dir.hidden   && fail=1
+env test -L reg          && fail=1
+env test -L fifo         && fail=1
+env test -L socket       && fail=1
+
+# Named pipes.
+env test -p fifo         || fail=1
+env test -p lfifo        || fail=1
+env test -p dir.empty    && fail=1
+env test -p ldir.empty   && fail=1
+env test -p dir.visible  && fail=1
+env test -p dir.hidden   && fail=1
+env test -p ldir.visible && fail=1
+env test -p ldir.hidden  && fail=1
+env test -p /dev/null    && fail=1
+env test -p lchar        && fail=1
+env test -p /dev/sda     && fail=1
+env test -p lblock       && fail=1
+env test -p reg          && fail=1
+env test -p socket       && fail=1
+env test -p lreg         && fail=1
+env test -p lsocket      && fail=1
+env test -p dangling     && fail=1
+env test -p selfref      && fail=1
+
+# Sockets.
+env test -S socket       || fail=1
+env test -S lsocket      || fail=1
+env test -S /dev/sda     && fail=1
+env test -S lblock       && fail=1
+env test -S /dev/null    && fail=1
+env test -S lchar        && fail=1
+env test -S dir.empty    && fail=1
+env test -S dir.hidden   && fail=1
+env test -S dir.visible  && fail=1
+env test -S reg          && fail=1
+env test -S fifo         && fail=1
+env test -S ldir.empty   && fail=1
+env test -S ldir.hidden  && fail=1
+env test -S ldir.visible && fail=1
+env test -S lreg         && fail=1
+env test -S lfifo        && fail=1
+env test -S dangling     && fail=1
+env test -S selfref      && fail=1
+
+rm dir.visible/x dir.hidden/.x reg fifo socket dangling selfref
+rm lreg ldir.empty ldir.visible lblock lchar lfifo lsocket
+rmdir dir.empty dir.visible dir.hidden
+
+Exit $fail
diff --git a/tests/test/misc.pl b/tests/test/misc.pl
new file mode 100755
index 0000000..1091d3a
--- /dev/null
+++ b/tests/test/misc.pl
@@ -0,0 +1,197 @@
+#!/usr/bin/perl
+
+# Copyright (C) 2008-2016 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+use strict;
+
+my $limits = getlimits ();
+
+my $prog = 'test';
+
+# Turn off localization of executable's output.
+@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
+
+sub digest_test ($)
+{
+  my ($t) = @_;
+  my @args;
+  my $ret = 0;
+  my @list_of_hashref;
+  foreach my $e (@$t)
+    {
+      !ref $e
+        and push (@args, $e), next;
+      ref $e eq 'HASH'
+        or (warn "$0: $t->[0]: unexpected entry type\n"), next;
+
+      exists $e->{EXIT}
+        and $ret = $e->{EXIT}, next;
+
+      push @list_of_hashref, $e;
+    }
+  shift @args; # discard test name
+  my $flags = join ' ', @args;
+
+  return ($flags, $ret, \@list_of_hashref);
+}
+
+sub add_inverse_op_tests($)
+{
+  my ($tests) = @_;
+  my @new;
+
+  my %inverse_op =
+    (
+     eq => 'ne',
+     lt => 'ge',
+     gt => 'le',
+    );
+
+  foreach my $t (@$tests)
+    {
+      push @new, $t;
+
+      my $test_name = $t->[0];
+      my ($flags, $ret, $LoH) = digest_test $t;
+
+      # Generate corresponding tests of inverse ops.
+      # E.g. generate tests of '-ge' from those of '-lt'.
+      foreach my $op (qw(gt lt eq))
+        {
+          if ($test_name =~ /$op-/ && $flags =~ / -$op /)
+            {
+              my $inv = $inverse_op{$op};
+              $test_name =~ s/$op/$inv/;
+              $flags =~ s/-$op/-$inv/;
+              $ret = 1 - $ret;
+              push (@new, [$test_name, $flags, {EXIT=>$ret}, @$LoH]);
+            }
+        }
+    }
+  return @new;
+}
+
+sub add_pn_tests($)
+{
+  my ($tests) = @_;
+  my @new;
+
+  # Generate parenthesized and negated versions of each test.
+  # There are a few exceptions.
+  my %not_N   = map {$_ => 1} qw (1a);
+  my %not_P   = map {$_ => 1} qw (1a
+                                  streq-6 strne-6
+                                  paren-1 paren-2 paren-3 paren-4 paren-5);
+  foreach my $t (@$tests)
+    {
+      push @new, $t;
+
+      my $test_name = $t->[0];
+      my ($flags, $ret, $LoH) = digest_test $t;
+      next if $ret == 2;
+
+      push (@new, ["N-$test_name", "! $flags", {EXIT=>1-$ret}, @$LoH])
+        unless $not_N{$test_name};
+      push (@new, ["P-$test_name", "'(' $flags ')'", {EXIT=>$ret}, @$LoH])
+        unless $not_P{$test_name};
+      push (@new, ["NP-$test_name", "! '(' $flags ')'", {EXIT=>1-$ret}, @$LoH])
+        unless $not_P{$test_name};
+      push (@new, ["NNP-$test_name", "! ! '(' $flags ')'", {EXIT=>$ret, @$LoH}])
+        unless $not_P{$test_name};
+    }
+
+  return @new;
+}
+
+my @Tests =
+(
+  ['1a', {EXIT=>1}],
+  ['1b', qw(-z '')],
+  ['1c', 'any-string'],
+  ['1d', qw(-n any-string)],
+  ['1e', "''", {EXIT=>1}],
+  ['1f', '-'],
+  ['1g', '--'],
+  ['1h', '-0'],
+  ['1i', '-f'],
+  ['1j', '--help'],
+  ['1k', '--version'],
+
+  ['streq-1', qw(t = t)],
+  ['streq-2', qw(t = f), {EXIT=>1}],
+  ['streqeq-1', qw(t == t)],
+  ['streqeq-2', qw(t == f), {EXIT=>1}],
+  ['streq-3', qw(! = !)],
+  ['streq-4', qw(= = =)],
+  ['streq-5', "'(' = '('"],
+  ['streq-6', "'(' = ')'", {EXIT=>1}],
+  ['strne-1', qw(t != t), {EXIT=>1}],
+  ['strne-2', qw(t != f)],
+  ['strne-3', qw(! != !), {EXIT=>1}],
+  ['strne-4', qw(= != =), {EXIT=>1}],
+  ['strne-5', "'(' != '('", {EXIT=>1}],
+  ['strne-6', "'(' != ')'"],
+
+  ['and-1', qw(t -a t)],
+  ['and-2', qw('' -a t), {EXIT=>1}],
+  ['and-3', qw(t -a ''), {EXIT=>1}],
+  ['and-4', qw('' -a ''), {EXIT=>1}],
+
+  ['or-1', qw(t -o t)],
+  ['or-2', qw('' -o t)],
+  ['or-3', qw(t -o '')],
+  ['or-4', qw('' -o ''), {EXIT=>1}],
+
+  ['eq-1', qw(9 -eq 9)],
+  ['eq-2', qw(0 -eq 0)],
+  ['eq-3', qw(0 -eq 00)],
+  ['eq-4', qw(8 -eq 9), {EXIT=>1}],
+  ['eq-5', qw(1 -eq 0), {EXIT=>1}],
+  ['eq-6', "$limits->{UINTMAX_OFLOW} -eq 0", {EXIT=>1}],
+
+  ['gt-1', qw(5 -gt 5), {EXIT=>1}],
+  ['gt-2', qw(5 -gt 4)],
+  ['gt-3', qw(4 -gt 5), {EXIT=>1}],
+  ['gt-4', qw(-1 -gt -2)],
+  ['gt-5', "$limits->{UINTMAX_OFLOW} -gt $limits->{INTMAX_UFLOW}"],
+
+  ['lt-1', qw(5 -lt 5), {EXIT=>1}],
+  ['lt-2', qw(5 -lt 4), {EXIT=>1}],
+  ['lt-3', qw(4 -lt 5)],
+  ['lt-4', qw(-1 -lt -2), {EXIT=>1}],
+  ['lt-5', "$limits->{INTMAX_UFLOW} -lt $limits->{UINTMAX_OFLOW}"],
+
+  ['inv-1', qw(0x0 -eq 00), {EXIT=>2},
+   {ERR=>"$prog: invalid integer '0x0'\n"}],
+
+  ['t1', "-t"],
+  ['t2', qw(-t 1), {EXIT=>1}],
+
+  ['paren-1', "'(' '' ')'", {EXIT=>1}],
+  ['paren-2', "'(' '(' ')'"],
+  ['paren-3', "'(' ')' ')'"],
+  ['paren-4', "'(' ! ')'"],
+  ['paren-5', "'(' -a ')'"],
+);
+
+@Tests = add_inverse_op_tests \@Tests;
+@Tests = add_pn_tests \@Tests;
+
+my $save_temps = $ENV{DEBUG};
+my $verbose = $ENV{VERBOSE};
+
+my $fail = run_tests ($prog, \$prog, \@Tests, $save_temps, $verbose);
+exit $fail;
-- 
2.8.0



From MAILER-DAEMON Thu Apr 07 05:47:47 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ao6XT-0008Ke-JP
	for mharc-coreutils@gnu.org; Thu, 07 Apr 2016 05:47:47 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:51802)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1ao6XR-0008K8-6V
	for coreutils@gnu.org; Thu, 07 Apr 2016 05:47:46 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1ao6XO-0006EB-SZ
	for coreutils@gnu.org; Thu, 07 Apr 2016 05:47:45 -0400
Received: from mout.kundenserver.de ([217.72.192.73]:63434)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1ao6XO-0006Dy-Iu
	for coreutils@gnu.org; Thu, 07 Apr 2016 05:47:42 -0400
Received: from [192.168.101.10] ([217.86.64.216]) by mrelayeu.kundenserver.de
	(mreue101) with ESMTPSA (Nemesis) id 0M8hqV-1bjFgw2fY3-00wEQe;
	Thu, 07 Apr 2016 11:47:37 +0200
Subject: Re: [PATCH v2 1/2] test: Add unary operator -E: test that a file is
	an empty directory
To: =?UTF-8?Q?Mattias_Andr=c3=a9e?= <maandree@member.fsf.org>,
	coreutils@gnu.org
References: <1459962572-31799-1-git-send-email-maandree@member.fsf.org>
	<1460018097-31668-1-git-send-email-maandree@member.fsf.org>
From: Bernhard Voelker <mail@bernhard-voelker.de>
Message-ID: <57062CB8.7030201@bernhard-voelker.de>
Date: Thu, 7 Apr 2016 11:47:36 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.6.0
MIME-Version: 1.0
In-Reply-To: <1460018097-31668-1-git-send-email-maandree@member.fsf.org>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 8bit
X-Provags-ID: V03:K0:FPsqafBs7k4KDWk6URmbgIkXDns9g+wE2Jy+C4ML19nVl4U3/VW
	agrHM0OSaMvOwJPYtwp4StjnDK+kjHMWVtr0T4NcPUNSdorfbPUSx2piP2OVloGl8e3fIP8
	8wOrNCVa/dq7UAWM3ywb/Uc81U+JNZCDks9y0EDxukek5f0l5ge+xBKUVaA0l9aanzmQ2Ht
	eq827OQBgHTKUUL6Anvlw==
X-UI-Out-Filterresults: notjunk:1;V01:K0:B/BYT62K5mk=:XX8P2W026v2sm8BMeMYxnm
	VLBQVlnK0dnNpVZkgFcrzxG1RiGe1im1X0xzNkgMeHvI6hu6OLVTjG86hps9F8JBY9i8FPRGW
	jNtDnc0Qm3wPwQWokR1mXB7oQZOF+rKj2GHxH6A8kAGVDTz6MlYz0ke1OlleL68EB1Mp7CduK
	9Mk1cFG6itWr94NtvGbVqyOLWEV0Yrm4oZBP/2oqU6NXr2ZwC0LKE5kzeGN6a7HqDfIGtDYs3
	eF9X5duW5UR8JNwZscrI+0sL2JSCqdZ8ox4BJfCFkUnhMGk1vNf3ktStErU2CHRclac1EiV1X
	cksZPAhhY1pYTt4B59boy16Q8B2KBd+Bbh/11VmHNuFT/GLMS6r+KYiDtSHGtVSNOO3zjA/iV
	DG01kUtPwmbeUqivy53W4UQOBC9hJnryvvZSvV9qVr5SVNLqBlL7W1uQcUzPdvtQuOWHeW2BS
	JyfG/esz2lMJfV5rfhR+45dF1y+Pt69kUkJvRYv4+uML8qaRlRBzaEXYn4E2wQxkGN/HUDU74
	i+UZK+ytDFxkv++pY+z9Yzv1vGyqswP/S6tBeKeIvvRX47KzhQvdYfx8XBlcyxti6twm8cylf
	YkVf3PebOZBDuJXhZmLZWeJkMEPS1bSQ4BgF9tG4dM2WUQcz2IiGZxubdV2vtumxT+7lfByPU
	5TjaaYMDfV5idFnWMQ3wbYTWKnxY3MM3CYDI2wDXdzxMamFXmaVtbcYoatt5k6mPrlJIyIzTV
	cv/lEMe/L4FXn+Mb
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 217.72.192.73
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 07 Apr 2016 09:47:46 -0000

On 04/07/2016 10:34 AM, Mattias Andrée wrote:
> diff --git a/src/test.c b/src/test.c
> index 8ac7467..eb9c43a 100644
> --- a/src/test.c
> +++ b/src/test.c
> @@ -27,6 +27,7 @@
>  #endif
>  
>  #include <config.h>
> +#include <dirent.h>
>  #include <stdio.h>
>  #include <sys/types.h>
>  
> @@ -179,6 +180,39 @@ get_mtime (char const *filename, struct timespec *mtime)
>    return ok;
>  }
>  
> +/* Return true iff DIR is empty. DIR must be a directory.  */
> +static bool
> +empty_p (char const *dirname)
> +{
> +  DIR *dir;
> +  struct dirent *de;
> +
> +  dir = opendir (dirname);
> +  if (!dir)
> +    {
> +      error (0, errno, "%s", dirname);
> +      test_exit (TEST_FAILURE);
> +    }
> +
> +  while (errno = 0, (de = readdir (dir)))
> +    {
> +      if (de->d_name[0] == '.')
> +        if (de->d_name[1 + (de->d_name[1] == '.')] == '\0')
> +          continue;
> +      closedir (dir);
> +      return 0;
> +    }
> +
> +  if (errno)
> +    {
> +      error (0, errno, "%s", dirname);
> +      closedir (dir);
> +      test_exit (TEST_FAILURE);
> +    }
> +  closedir (dir);
> +  return 1;
> +}
> +
>  /* Return true if S is one of the test command's binary operators.  */
>  static bool
>  binop (char const *s)
> @@ -457,6 +491,12 @@ unary_operator (void)
>        return (stat (argv[pos - 1], &stat_buf) == 0
>                && S_ISDIR (stat_buf.st_mode));
>  
> +    case 'E':			/* File is an empty directory? */
> +      unary_advance ();
> +      return (stat (argv[pos - 1], &stat_buf) == 0
> +              && S_ISDIR (stat_buf.st_mode)
> +              && empty_p (argv[pos - 1]));
> +

While I find this feature quite useful - although I never needed such a
test yet -, I see the following problems:

* While the other file type based tests only use stat/lstat, this
one additionally needs opendir/readdir/closedir, i.e., the permissions
on the directory could slip into the game:

  $ mkdir /dev/shm/dir

  $ chmod =0000 /dev/shm/dir

  $ src/test -E /dev/shm/dir && echo OK || echo FAIL
  src/test: /dev/shm/dir: Permission denied
  FAIL

  $ src/test -d /dev/shm/dir && echo OK || echo FAIL
  OK

* The above stat/opendir is racy:

  $ while test -d /dev/shm/dir ; do \
      chmod =0000 /dev/shm/dir; \
      chmod =0700 /dev/shm/dir; \
    done &

  $ for f in $(seq 100); do \
      src/test -E /dev/shm/dir 2>/dev/null \
        && echo OK; \
    done \
      | grep -c OK
  49

Avoiding stat at all, and relying on opendir may be a better way.

However, as Eric pointed out, coreutils' test and \[ are not in use very
often, so the discussion and implementation should IMO start for the
builtins of the major shells first.

Have a nice day,
Berny


From MAILER-DAEMON Thu Apr 07 06:05:59 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ao6p5-0000vB-R1
	for mharc-coreutils@gnu.org; Thu, 07 Apr 2016 06:05:59 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:55412)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1ao6p3-0000v1-C8
	for coreutils@gnu.org; Thu, 07 Apr 2016 06:05:58 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1ao6oy-0002Mq-BB
	for coreutils@gnu.org; Thu, 07 Apr 2016 06:05:57 -0400
Received: from smtp-3.sys.kth.se ([2001:6b0:1:1300:250:56ff:fea6:2de2]:36951)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1ao6ox-0002MO-Ut
	for coreutils@gnu.org; Thu, 07 Apr 2016 06:05:52 -0400
Received: from smtp-3.sys.kth.se (localhost.localdomain [127.0.0.1])
	by smtp-3.sys.kth.se (Postfix) with ESMTP id CE0DA25C9
	for <coreutils@gnu.org>; Thu,  7 Apr 2016 12:05:50 +0200 (CEST)
X-Virus-Scanned: by amavisd-new at kth.se
Received: from smtp-3.sys.kth.se ([127.0.0.1])
	by smtp-3.sys.kth.se (smtp-3.sys.kth.se [127.0.0.1]) (amavisd-new,
	port 10024) with LMTP id aukuuFswwvre for <coreutils@gnu.org>;
	Thu,  7 Apr 2016 12:05:49 +0200 (CEST)
X-KTH-Auth: maandree [81.228.219.220]
X-KTH-mail-from: maandree@member.fsf.org
X-KTH-rcpt-to: coreutils@gnu.org
Received: from localhost.localdomain (h220n13-jak-a12.ias.bredband.telia.com
	[81.228.219.220])
	by smtp-3.sys.kth.se (Postfix) with ESMTPSA id D236B51E
	for <coreutils@gnu.org>; Thu,  7 Apr 2016 12:05:48 +0200 (CEST)
Date: Thu, 7 Apr 2016 12:05:41 +0200
From: Mattias =?UTF-8?B?QW5kcsOpZQ==?= <maandree@member.fsf.org>
To: <coreutils@gnu.org>
Subject: Re: [PATCH v2 1/2] test: Add unary operator -E: test that a file is
	an empty directory
Message-ID: <20160407120541.3bc2351d.maandree@kth.se>
In-Reply-To: <57062CB8.7030201@bernhard-voelker.de>
References: <1459962572-31799-1-git-send-email-maandree@member.fsf.org>
	<1460018097-31668-1-git-send-email-maandree@member.fsf.org>
	<57062CB8.7030201@bernhard-voelker.de>
X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-unknown-linux-gnu)
X-Awesomeness: 120 %
User-Agent: Claws Mail
X-Operating-System: GNU/Linux
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	boundary="Sig_/KXhv4z7G2l1oXzwUmFlGQl7";
	protocol="application/pgp-signature"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 2001:6b0:1:1300:250:56ff:fea6:2de2
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 07 Apr 2016 10:05:58 -0000

--Sig_/KXhv4z7G2l1oXzwUmFlGQl7
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Thu, 7 Apr 2016 11:47:36 +0200
Bernhard Voelker <mail@bernhard-voelker.de> wrote:

> On 04/07/2016 10:34 AM, Mattias Andr=C3=A9e wrote:
> > diff --git a/src/test.c b/src/test.c
> > index 8ac7467..eb9c43a 100644
> > --- a/src/test.c
> > +++ b/src/test.c
> > @@ -27,6 +27,7 @@
> >  #endif
> > =20
> >  #include <config.h>
> > +#include <dirent.h>
> >  #include <stdio.h>
> >  #include <sys/types.h>
> > =20
> > @@ -179,6 +180,39 @@ get_mtime (char const *filename,
> > struct timespec *mtime) return ok;
> >  }
> > =20
> > +/* Return true iff DIR is empty. DIR must be a
> > directory.  */ +static bool
> > +empty_p (char const *dirname)
> > +{
> > +  DIR *dir;
> > +  struct dirent *de;
> > +
> > +  dir =3D opendir (dirname);
> > +  if (!dir)
> > +    {
> > +      error (0, errno, "%s", dirname);
> > +      test_exit (TEST_FAILURE);
> > +    }
> > +
> > +  while (errno =3D 0, (de =3D readdir (dir)))
> > +    {
> > +      if (de->d_name[0] =3D=3D '.')
> > +        if (de->d_name[1 + (de->d_name[1] =3D=3D '.')] =3D=3D
> > '\0')
> > +          continue;
> > +      closedir (dir);
> > +      return 0;
> > +    }
> > +
> > +  if (errno)
> > +    {
> > +      error (0, errno, "%s", dirname);
> > +      closedir (dir);
> > +      test_exit (TEST_FAILURE);
> > +    }
> > +  closedir (dir);
> > +  return 1;
> > +}
> > +
> >  /* Return true if S is one of the test command's
> > binary operators.  */ static bool
> >  binop (char const *s)
> > @@ -457,6 +491,12 @@ unary_operator (void)
> >        return (stat (argv[pos - 1], &stat_buf) =3D=3D 0
> >                && S_ISDIR (stat_buf.st_mode));
> > =20
> > +    case 'E':			/* File is an
> > empty directory? */
> > +      unary_advance ();
> > +      return (stat (argv[pos - 1], &stat_buf) =3D=3D 0
> > +              && S_ISDIR (stat_buf.st_mode)
> > +              && empty_p (argv[pos - 1]));
> > + =20
>=20
> While I find this feature quite useful - although I never
> needed such a test yet -, I see the following problems:
>=20
> * While the other file type based tests only use
> stat/lstat, this one additionally needs
> opendir/readdir/closedir, i.e., the permissions on the
> directory could slip into the game:
>=20
>   $ mkdir /dev/shm/dir
>=20
>   $ chmod =3D0000 /dev/shm/dir
>=20
>   $ src/test -E /dev/shm/dir && echo OK || echo FAIL
>   src/test: /dev/shm/dir: Permission denied
>   FAIL
>=20
>   $ src/test -d /dev/shm/dir && echo OK || echo FAIL
>   OK

I don't think this is a problem. For reliable
script you need to check whether the test
failed or was successful. That is, in the case
of test, you have to consider whether test
exited with value 0, 1, or >1.

>=20
> * The above stat/opendir is racy:
>=20
>   $ while test -d /dev/shm/dir ; do \
>       chmod =3D0000 /dev/shm/dir; \
>       chmod =3D0700 /dev/shm/dir; \
>     done &
>=20
>   $ for f in $(seq 100); do \
>       src/test -E /dev/shm/dir 2>/dev/null \
>         && echo OK; \
>     done \
>       | grep -c OK
>   49
>=20
> Avoiding stat at all, and relying on opendir may be a
> better way.

Perhaps it is better to check errno !=3D ENOTDIR when
opendir fails, but the race itself is not important.

>=20
> However, as Eric pointed out, coreutils' test and \[ are
> not in use very often, so the discussion and
> implementation should IMO start for the builtins of the
> major shells first.

Yes, the shells that implement test needs to be updated.
But until then, it can use the stand-alone by simply
running `env test` instead of `test`. You really should
be doing that anyway unless you need one of the operators
that are only implemented in the shell, the shells'
implementations are not that good.

>=20
> Have a nice day,
> Berny


--Sig_/KXhv4z7G2l1oXzwUmFlGQl7
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJXBjD1AAoJEM4wYJDpiwjHragP/iwgB9DYRet8WfIySoIlFiuA
MC97ld/QzMc19BzR2CKN3qQyVT1RTtECynzol4sNHmbCEw0x4k/yjx9NB+zIQi7m
3UBDlIpVjGNjVZOJbvEy3kjGk8P7twkFjv2/qqQzrJRgXt9LBG2AfRtsgf5s+EQK
o5DjAYgc3uXOfafOD0/65qZCwuzB1/QWhIJuaxkgfOhrXMUPaCv1N+WYhxM1kWvd
w9zDBcpcouw16CVw4q87cf8fjDsrIwPJAbgYZHafJlveIAPx/3ZbE3VJxluJ5Ph9
linRZIUcvBWHoI7o+ptFMO+V1ogkZnNCQ+bRdVfSQj4V0Um7pj10RWQoXHAEBx4S
28B8FGf735ZWmeEfF+PwwE1FmSUMsY66HaJGiqKOy3g5v8QDGLr2OCVc6uu1PvzD
dhdD8wvLf7ieUiKA3W73PYgdJOIVPGMOr2kypnuifUe6tpfcncCoT52ec5WKrCGo
dpPAWVj+z21HJ83SNg3odQrx/uklG8wdvbiNG/ecaCG+9cNDowjPJ/qzCOiY6I+k
JtNAExnHytxPSWkSBSatgqAsxsjMBqJz1H8xj34wiQ4ovhxixxyeJjcfEFAFuWgG
O4QwUCE2XZf4J0/F5Uf/RLOlxdXRBwf0TsIXCHCEcjYd0kse/OrWckr6UEV0U0Ox
5HRjzfoMds8D+9ze/RnH
=3XWK
-----END PGP SIGNATURE-----

--Sig_/KXhv4z7G2l1oXzwUmFlGQl7--


From MAILER-DAEMON Fri Apr 08 10:34:06 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1aoXU5-0007fe-Us
	for mharc-coreutils@gnu.org; Fri, 08 Apr 2016 10:34:05 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:41210)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <renich@woralelandia.com>) id 1aoXU4-0007cb-14
	for coreutils@gnu.org; Fri, 08 Apr 2016 10:34:04 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <renich@woralelandia.com>) id 1aoXU2-0002KE-UY
	for coreutils@gnu.org; Fri, 08 Apr 2016 10:34:03 -0400
Received: from mail-yw0-x233.google.com ([2607:f8b0:4002:c05::233]:34394)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <renich@woralelandia.com>) id 1aoXU2-0002K5-Ns
	for coreutils@gnu.org; Fri, 08 Apr 2016 10:34:02 -0400
Received: by mail-yw0-x233.google.com with SMTP id d68so136514588ywe.1
	for <coreutils@gnu.org>; Fri, 08 Apr 2016 07:34:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=woralelandia-com.20150623.gappssmtp.com; s=20150623;
	h=mime-version:from:date:message-id:subject:to;
	bh=SxreegyMfrfLnRzzB/6MlDYibEaXF529xco88DBbufU=;
	b=AHqx/2f9AZYibDDMsLElDNQRKf/FakC/e/uQinatZvOmEdeHFxTDOrrC3yj6Bb0Xjw
	T2rwpvNJTLghxFGXS5cfOspW2n9DXUstALeRWuJZttXN/PDqE8gVSr82CYFL59NGTGkq
	bKcsxR8/SZUQ43XM4BIG431uoQuYKmbTKLhI8V2o4JUH0Z/hRLtQCQCLRGsbpUJrWR9E
	3CgI0za1/Pawe56aaw21YFz0dZpmuy/tudq4zppDcuiUxewhDPRTuEspCB/ZVTnbSVxx
	kQMoHBVf74UTrmbUaJKC5yJ29Pro81S5Avu6lC9OhAsT4j4ZZraC3u5gkBklqsi9rV1V
	P8GA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
	bh=SxreegyMfrfLnRzzB/6MlDYibEaXF529xco88DBbufU=;
	b=GrpjCdDvFaMnt8CCv1Oenax13MkmDscDEh4xlBgo/nS8h507R8pM/qwB5mM3PF6umb
	VYbUET/0weJiqn2+yxzf4hqTd6++aDYvvqEeqtKB00yx6R5xlES5F0CWdDWB0t0KMe5b
	/hQaapXn5pB2dIYa20GzMf4Qq21cD5fEV9VJ6SoEC6S8SmxsouchlRF9kBg7OFfw9KP2
	FTjjmah+cwSLG2moKsCfMe184C88lKN7GbeDrvtFiVtKoOFb+6TW6r8CaJvbD5ew9EX9
	DTXzKSehZKXSsHAUDJH5MNop/BpwCH0zriasbrxuCj6lEdvPpBb4zA7d6pK2v4N7s+7z
	351A==
X-Gm-Message-State: AD7BkJK7b6zZcZXe8D8tHyG23O67bVBKxcdqEQU58IolzzP1SzzcOgg00lPCHuldepZwI4bx8wbzhc1eqr39qQ==
X-Received: by 10.129.97.7 with SMTP id v7mr4774890ywb.237.1460126041956; Fri,
	08 Apr 2016 07:34:01 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.13.242.133 with HTTP; Fri, 8 Apr 2016 07:33:42 -0700 (PDT)
From: Renich Bon Ciric <renich@woralelandia.com>
Date: Fri, 8 Apr 2016 09:33:42 -0500
Message-ID: <CAGxGTk7u35xcwvTgMGVp5DF3mcAhyzg91=xtcTcXmApT+rSvzg@mail.gmail.com>
Subject: ls' --group-directories-first
To: coreutils@gnu.org
Content-Type: text/plain; charset=UTF-8
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2607:f8b0:4002:c05::233
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 08 Apr 2016 14:34:05 -0000

Hello,

IMHO, --group-directories-first should be the default behavior of ls.
I think users expect this from the command already. What do you think?

-- 
It's hard to be free... but I love to struggle. Love isn't asked for;
it's just given. Respect isn't asked for; it's earned!
Renich Bon Ciric

http://www.woralelandia.com/
http://www.introbella.com/


From MAILER-DAEMON Fri Apr 08 12:20:28 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1aoZ92-0006Fb-Ff
	for mharc-coreutils@gnu.org; Fri, 08 Apr 2016 12:20:28 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:38583)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1aoZ90-0006Af-13
	for coreutils@gnu.org; Fri, 08 Apr 2016 12:20:26 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1aoZ8w-0003nN-Ef
	for coreutils@gnu.org; Fri, 08 Apr 2016 12:20:25 -0400
Received: from mx1.redhat.com ([209.132.183.28]:56674)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1aoZ8w-0003nC-9U
	for coreutils@gnu.org; Fri, 08 Apr 2016 12:20:22 -0400
Received: from int-mx09.intmail.prod.int.phx2.redhat.com
	(int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by mx1.redhat.com (Postfix) with ESMTPS id D6CC913A5C;
	Fri,  8 Apr 2016 16:20:21 +0000 (UTC)
Received: from [10.3.113.199] (ovpn-113-199.phx2.redhat.com [10.3.113.199])
	by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id u38GKLdd009408; Fri, 8 Apr 2016 12:20:21 -0400
Subject: Re: ls' --group-directories-first
To: Renich Bon Ciric <renich@woralelandia.com>, coreutils@gnu.org
References: <CAGxGTk7u35xcwvTgMGVp5DF3mcAhyzg91=xtcTcXmApT+rSvzg@mail.gmail.com>
From: Eric Blake <eblake@redhat.com>
Openpgp: url=http://people.redhat.com/eblake/eblake.gpg
Organization: Red Hat, Inc.
Message-ID: <5707DA45.1020108@redhat.com>
Date: Fri, 8 Apr 2016 10:20:21 -0600
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.7.1
MIME-Version: 1.0
In-Reply-To: <CAGxGTk7u35xcwvTgMGVp5DF3mcAhyzg91=xtcTcXmApT+rSvzg@mail.gmail.com>
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="xPduPBWx7hFH8AxmrGo5TKANlH3Sv293R"
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 209.132.183.28
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 08 Apr 2016 16:20:27 -0000

This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--xPduPBWx7hFH8AxmrGo5TKANlH3Sv293R
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 04/08/2016 08:33 AM, Renich Bon Ciric wrote:
> Hello,
>=20
> IMHO, --group-directories-first should be the default behavior of ls.
> I think users expect this from the command already. What do you think?

This would violate POSIX, which requires sorting in a particular order,
so we CAN'T make it default - doing so would break expectations of
scripts that have come to rely on POSIX ordering.  But you can always
set up an alias or wrapper script so that you always invoke with your
desired options locally.

--=20
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


--xPduPBWx7hFH8AxmrGo5TKANlH3Sv293R
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJXB9pFAAoJEKeha0olJ0NqQ8sH/iZ5Ci9bjy9IpUbcjiJ7w9/l
0CEMlXqljeoNsd3CN9FiTOKFdcQZJj06Hv0xDiun/suJgT26DhHRnj2ASieWdcL6
mI72Fb8IBoTj7jMkcY/jVlsiMa0iYrpWlKnindI82LSOXJUw7JQF8dnddDq5nwt7
c5GyLAjnGlnCw3Vu4iLYHRY1KTzcBGcCGX+y2HvreXhr+GAaGSVtsxe/mAX9/ZRu
6lSCmSF7kAnLExOc42VJLMBqq0v5uKy6b6DNumtNKryNAq3kGQRnA8kMrGTQhu0P
PEcCLVxNXhDm9dkAEzRC1ZHgig4HOfhfQdXAspSrzIa8D/IeuyHtk5Sw8kxUkyM=
=EKvD
-----END PGP SIGNATURE-----

--xPduPBWx7hFH8AxmrGo5TKANlH3Sv293R--


From MAILER-DAEMON Fri Apr 08 12:22:35 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1aoZB5-0001ww-FN
	for mharc-coreutils@gnu.org; Fri, 08 Apr 2016 12:22:35 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:39015)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <renich@woralelandia.com>) id 1aoZB3-0001tR-F6
	for coreutils@gnu.org; Fri, 08 Apr 2016 12:22:34 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <renich@woralelandia.com>) id 1aoZB2-000499-7j
	for coreutils@gnu.org; Fri, 08 Apr 2016 12:22:33 -0400
Received: from mail-yw0-x231.google.com ([2607:f8b0:4002:c05::231]:33424)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <renich@woralelandia.com>) id 1aoZB2-00048P-2e
	for coreutils@gnu.org; Fri, 08 Apr 2016 12:22:32 -0400
Received: by mail-yw0-x231.google.com with SMTP id t10so140533000ywa.0
	for <coreutils@gnu.org>; Fri, 08 Apr 2016 09:22:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=woralelandia-com.20150623.gappssmtp.com; s=20150623;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc; bh=+wqWXNWw9nkC09G/I0MmuPB7HH+8PkxIBGKomUj4da0=;
	b=iUsuRGq8ozvQ9dE/jkMDPJDq28MuaQrmXiM0QRdO+eVhLBDqfL8/5kFqWkBBvZ1ufL
	4t4Hc1HYeHae2gIu9EWTfD+UnwW3jJi101IEK06EFxV1FwkvEMhluumawUPwXWd2heid
	xW87iv5giYz/j3F2kPUxoOcWj1gifHU8v9nXrdgvj30URCX3peg3061RuYhuTsaX4T3+
	mT5DnoekHoORWyhWUcL05tiSyEGqxW7g3N0+n3FRJTczXQ/l89d0tcGkTkXCI4hXsaFs
	r8LTMI7ngCh02SaHRwjOLPYcLET0BhVQd78wYaot09zZKiG7XsINFo3pkT8Kdn6Xjm9L
	Y3UQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:cc;
	bh=+wqWXNWw9nkC09G/I0MmuPB7HH+8PkxIBGKomUj4da0=;
	b=EsYhvbjT8DV2IhM5vcPWvyt9LID+e8lc0OlBUO9niQxK2UJL1J+YNp7hNDTyw3K8En
	aKiY9EI6bZzz8OPTnlN0kUOe+P5x+gCE7+3rpVy+EBJTSyInl9FkBbcm2sJqqs25BXuo
	XHVot6TsIGmCdb43u4M8Rg+xamEC+7j47/yjckqUNq8mO6URKctV0tMozQDeKGfVWCC4
	RflwDYtBJ6GUmuFXEHjUrd0FLNvhFGeUJatOqDlXIurrs2LW0t2Y7BksKVZ8uIZzqV6J
	amx2w/zIsUmgSsTRDe7gSQ3ztCKREeDHADFZOktCe0TKlDSAy4LeyyY4iu7bztek7huJ
	xPjw==
X-Gm-Message-State: AD7BkJLAs98+tKazXSqre/TPzHnfAM6M4VpxX5XarovHf4qJqlII0/ZG9nDX6qH1qB2ZoCtODW7Oo5E3RV/k9A==
X-Received: by 10.37.231.11 with SMTP id e11mr4981361ybh.145.1460132551648;
	Fri, 08 Apr 2016 09:22:31 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.13.242.133 with HTTP; Fri, 8 Apr 2016 09:22:12 -0700 (PDT)
In-Reply-To: <5707DA45.1020108@redhat.com>
References: <CAGxGTk7u35xcwvTgMGVp5DF3mcAhyzg91=xtcTcXmApT+rSvzg@mail.gmail.com>
	<5707DA45.1020108@redhat.com>
From: Renich Bon Ciric <renich@woralelandia.com>
Date: Fri, 8 Apr 2016 11:22:12 -0500
Message-ID: <CAGxGTk7xg8Q6jXV-MdOPS-DQDg0epHvCyCvsW1Sgjmc-WLCypg@mail.gmail.com>
Subject: Re: ls' --group-directories-first
To: Eric Blake <eblake@redhat.com>
Cc: coreutils@gnu.org
Content-Type: text/plain; charset=UTF-8
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2607:f8b0:4002:c05::231
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 08 Apr 2016 16:22:34 -0000

On Fri, Apr 8, 2016 at 11:20 AM, Eric Blake <eblake@redhat.com> wrote:
> This would violate POSIX, which requires sorting in a particular order,
> so we CAN'T make it default - doing so would break expectations of
> scripts that have come to rely on POSIX ordering.  But you can always
> set up an alias or wrapper script so that you always invoke with your
> desired options locally.

Thank you for taking the the to explain. I will check the alias for ls
in my distro.

Have a good day.

-- 
It's hard to be free... but I love to struggle. Love isn't asked for;
it's just given. Respect isn't asked for; it's earned!
Renich Bon Ciric

http://www.woralelandia.com/
http://www.introbella.com/


From MAILER-DAEMON Mon Apr 11 01:01:00 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1apTy8-0001Rf-0x
	for mharc-coreutils@gnu.org; Mon, 11 Apr 2016 01:01:00 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:49125)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1apTy4-0001O6-T7
	for coreutils@gnu.org; Mon, 11 Apr 2016 01:00:57 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1apTy1-0004xy-Lt
	for coreutils@gnu.org; Mon, 11 Apr 2016 01:00:56 -0400
Received: from mail-qg0-x231.google.com ([2607:f8b0:400d:c04::231]:33558)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1apTy1-0004xr-G4
	for coreutils@gnu.org; Mon, 11 Apr 2016 01:00:53 -0400
Received: by mail-qg0-x231.google.com with SMTP id j35so135544093qge.0
	for <coreutils@gnu.org>; Sun, 10 Apr 2016 22:00:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:subject:from:in-reply-to:date:cc:message-id:references
	:to; bh=zG2OZhdnPX/EzNszT3UrlbKYTgu+I5LbED2lS4Vj6b8=;
	b=D1HdRxex35IkukOGTDhYxl0ZW47or2CjEHcxjULr3yzWM9XvymIuRU5t49DZlBTNYe
	NzXYxzvYyBAu25cgZt3kA04g5+IhhZk0n1NmTZGm4VAJ3dAKF1xckDunc9Ju22TeJ4Z3
	UTT3uXFbhSbaOkeYxnKS7ipvcojUm2CFeTQNt7vwOrmc2AhxSO+BlLGJzIw7tzgcv+XD
	UKbyFSgl36qzKvvuIlKDpn5U4uxB4YKQR8BaB2eckoSrEXwOiUQhTr2nEJZ1MV49Wqr2
	RjIRHik4P9/tu88CcuQfofJh5iSLdUIrFRVGeOm/E7z9E1NIl5oifXxuU3ja2O+zlSLk
	aRAw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc
	:message-id:references:to;
	bh=zG2OZhdnPX/EzNszT3UrlbKYTgu+I5LbED2lS4Vj6b8=;
	b=iEPnzEj/e4EMP2Sew3s4bhWSXcY9SYbhsWFYvk5saXyLNBrdbO7MG9lcsmb5P4BfSx
	AMJkYyp2t5Fj/5DBtg4bAYX0GugyIZzPEos6yAIU3xzwsRF6Y5vMYuKCu1FZ9EKPRFcJ
	2PPBKCN4lOFH44EbbVcgh0ie0rdqpIqi3y+OP28GnRDqhzZ61lz12jw0WbDtTPnhR57n
	Fy8HCvk9xUL8r2KIhiJ5rvNFTYjsmc90F4wAMDolnRFEqvpRIOpXi7baA8gVRcSsdjsk
	mZBmbwiqeUJPQc4JiG1HHoFXz/YHKteUbYJTclyk8XXvO2DuY3QBfltd2BrXvh1nWazS
	ogdQ==
X-Gm-Message-State: AD7BkJIpd1f6rJIFEC+q9o6TTvlfbtEN5SNHRyqPgJRDL0VlVduLkKfDJklZYYjGdWVeKw==
X-Received: by 10.140.157.16 with SMTP id d16mr27587821qhd.89.1460350852798;
	Sun, 10 Apr 2016 22:00:52 -0700 (PDT)
Received: from ix.home (pool-100-38-105-55.nycmny.fios.verizon.net.
	[100.38.105.55]) by smtp.gmail.com with ESMTPSA id
	l67sm10495630qgl.47.2016.04.10.22.00.51
	(version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
	Sun, 10 Apr 2016 22:00:51 -0700 (PDT)
Content-Type: multipart/mixed;
	boundary="Apple-Mail=_194C1A57-2C35-45B0-B55F-27ABBDFED083"
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\))
Subject: Re: prevent seq from inflow on I/O errors
From: Assaf Gordon <assafgordon@gmail.com>
In-Reply-To: <57037EDD.2020604@bernhard-voelker.de>
Date: Mon, 11 Apr 2016 01:00:50 -0400
Cc: =?utf-8?Q?P=C3=A1draig_Brady?= <P@draigBrady.com>,
	Coreutils <coreutils@gnu.org>
Message-Id: <F9289C73-DA02-415F-8649-2E787F788E71@gmail.com>
References: <788E7E16-EFE1-47D0-96CD-A35FB080BBA6@gmail.com>
	<570256BD.7010302@draigBrady.com>
	<57037EDD.2020604@bernhard-voelker.de>
To: Bernhard Voelker <mail@bernhard-voelker.de>
X-Mailer: Apple Mail (2.2102)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2607:f8b0:400d:c04::231
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 11 Apr 2016 05:00:58 -0000


--Apple-Mail=_194C1A57-2C35-45B0-B55F-27ABBDFED083
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=windows-1252

Hello Bernhard, P=E1draig,

> On Apr 5, 2016, at 05:01, Bernhard Voelker <mail@bernhard-voelker.de> =
wrote:
>=20
> Some findings below:

Thank you for the feedback and improvements.

Patch attached that includes your suggestions.

Comments welcomed,
 - assaf


--Apple-Mail=_194C1A57-2C35-45B0-B55F-27ABBDFED083
Content-Disposition: attachment;
	filename=0001-seq-detect-and-report-I-O-errors-immediately.patch
Content-Type: application/octet-stream;
	name="0001-seq-detect-and-report-I-O-errors-immediately.patch"
Content-Transfer-Encoding: quoted-printable

=46rom=20f0a5e9ed97d286466855d77b34e71825017f4991=20Mon=20Sep=2017=20=
00:00:00=202001=0AFrom:=20Assaf=20Gordon=20<assafgordon@gmail.com>=0A=
Date:=20Sun,=2010=20Apr=202016=2011:28:13=20+0100=0ASubject:=20[PATCH]=20=
seq:=20detect=20and=20report=20I/O=20errors=20immediately=0A=0AEnsure=20=
I/O=20errors=20are=20detected=20(and=20terminate=20seq),=20preventing=20=
seq=0Afrom=20infloop=20(or=20running=20for=20long=20time=20with=20a=20=
large=0Arange)=20upon=20write=20errors=20or=20ignored=20SIGPIPE.=20=
Examples:=0A=0A=20=20=20=20=20seq=201=20inf=20>=20/dev/full=20=20=20=20=20=
=20=20=20=20=20=20=20=20(seq_fast)=0A=20=20=20=20=20seq=201.1=200.1=20=
inf=20>/dev/full=20=20=20=20=20=20=20=20(print_numbers)=0A=0A*=20=
src/seq.c=20(io_error):=20A=20new=20function=20to=20diagnose=20=
appropriate=0Astdio=20errors=20and=20exit=20the=20program=20with=20=
failure=20status.=0A(seq_fast,=20print_numbers):=20Explicitly=20check=20=
for=20write=20errors=0Aand=20terminate=20the=20program=20with=20=
diagnostic.=0A*=20tests/misc/seq-io-errors.sh:=20Test=20new=20error=20=
detection.=0A*=20tests/local.mk:=20Add=20new=20test.=0A*=20NEWS:=20=
Mention=20the=20fix.=0A---=0A=20NEWS=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20|=20=203=20+++=0A=20src/seq.c=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20|=2027=20=
+++++++++++++++++++-----=0A=20tests/local.mk=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20|=20=201=20+=0A=20tests/misc/seq-io-errors.sh=20|=2050=20=
+++++++++++++++++++++++++++++++++++++++++++++=0A=204=20files=20changed,=20=
76=20insertions(+),=205=20deletions(-)=0A=20create=20mode=20100755=20=
tests/misc/seq-io-errors.sh=0A=0Adiff=20--git=20a/NEWS=20b/NEWS=0Aindex=20=
d3597d0..e58ed44=20100644=0A---=20a/NEWS=0A+++=20b/NEWS=0A@@=20-15,6=20=
+15,9=20@@=20GNU=20coreutils=20NEWS=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20-*-=20=
outline=20-*-=0A=20=20=20=20stty=20--help=20no=20longer=20outputs=20=
extraneous=20gettext=20header=20lines=0A=20=20=20=20for=20translated=20=
languages.=20[bug=20introduced=20in=20coreutils-8.24]=0A=20=0A+=20=20=20=
seq=20now=20immediately=20exits=20upon=20write=20errors.=0A+=20=20=20=
[This=20bug=20was=20present=20in=20"the=20beginning".]=0A+=0A=20**=20=
Changes=20in=20behavior=0A=20=0A=20=20=20=20stat=20now=20outputs=20=
nanosecond=20information=20for=20time=20stamps=20even=20if=0Adiff=20=
--git=20a/src/seq.c=20b/src/seq.c=0Aindex=20fbb94a0..3095715=20100644=0A=
---=20a/src/seq.c=0A+++=20b/src/seq.c=0A@@=20-267,6=20+267,18=20@@=20=
long_double_format=20(char=20const=20*fmt,=20struct=20layout=20*layout)=0A=
=20=20=20=20=20=20=20}=0A=20}=0A=20=0A+static=20void=20=
ATTRIBUTE_NORETURN=0A+io_error=20(void)=0A+{=0A+=20=20int=20status=20=3D=20=
EXIT_FAILURE;=0A+=20=20if=20(errno=20!=3D=20EPIPE)=0A+=20=20=20=20error=20=
(0,=20errno,=20_("standard=20output"));=0A+=20=20else=0A+=20=20=20=20=
status=20=3D=20EXIT_SUCCESS;=0A+=20=20clearerr=20(stdout);=0A+=20=20exit=20=
(status);=0A+}=0A+=0A=20/*=20Actually=20print=20the=20sequence=20of=20=
numbers=20in=20the=20specified=20range,=20with=20the=0A=20=20=20=20given=20=
or=20default=20stepping=20and=20format.=20=20*/=0A=20=0A@@=20-284,7=20=
+296,8=20@@=20print_numbers=20(char=20const=20*fmt,=20struct=20layout=20=
layout,=0A=20=20=20=20=20=20=20for=20(i=20=3D=201;=20;=20i++)=0A=20=20=20=
=20=20=20=20=20=20{=0A=20=20=20=20=20=20=20=20=20=20=20long=20double=20=
x0=20=3D=20x;=0A-=20=20=20=20=20=20=20=20=20=20printf=20(fmt,=20x);=0A+=20=
=20=20=20=20=20=20=20=20=20if=20(printf=20(fmt,=20x)=20<=200)=0A+=20=20=20=
=20=20=20=20=20=20=20=20=20io_error=20();=0A=20=20=20=20=20=20=20=20=20=20=
=20if=20(out_of_range)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20break;=0A=
=20=20=20=20=20=20=20=20=20=20=20x=20=3D=20first=20+=20i=20*=20step;=0A=
@@=20-325,10=20+338,12=20@@=20print_numbers=20(char=20const=20*fmt,=20=
struct=20layout=20layout,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20break;=0A=20=20=20=20=20=20=20=20=20=20=20=20=20}=0A=20=0A-=20=20=20=
=20=20=20=20=20=20=20fputs=20(separator,=20stdout);=0A+=20=20=20=20=20=20=
=20=20=20=20if=20(fputs=20(separator,=20stdout)=20=3D=3D=20EOF)=0A+=20=20=
=20=20=20=20=20=20=20=20=20=20io_error=20();=0A=20=20=20=20=20=20=20=20=20=
}=0A=20=0A-=20=20=20=20=20=20fputs=20(terminator,=20stdout);=0A+=20=20=20=
=20=20=20if=20(fputs=20(terminator,=20stdout)=20=3D=3D=20EOF)=0A+=20=20=20=
=20=20=20=20=20io_error=20();=0A=20=20=20=20=20}=0A=20}=0A=20=0A@@=20=
-495,14=20+510,16=20@@=20seq_fast=20(char=20const=20*a,=20char=20const=20=
*b)=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20output=20buffer=20so=20=
far,=20and=20reset=20to=20start=20of=20buffer.=20=20*/=0A=20=20=20=20=20=20=
=20=20=20=20=20if=20(buf_end=20-=20(p_len=20+=201)=20<=20bufp)=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20{=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20fwrite=20(buf,=20bufp=20-=20buf,=201,=20stdout);=0A+=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20if=20(fwrite=20(buf,=20bufp=20-=20buf,=201,=20=
stdout)=20!=3D=201)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
io_error=20();=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20bufp=20=3D=20=
buf;=0A=20=20=20=20=20=20=20=20=20=20=20=20=20}=0A=20=20=20=20=20=20=20=20=
=20}=0A=20=0A=20=20=20=20=20=20=20/*=20Write=20any=20remaining=20=
buffered=20output,=20and=20the=20terminator.=20=20*/=0A=20=20=20=20=20=20=
=20*bufp++=20=3D=20*terminator;=0A-=20=20=20=20=20=20fwrite=20(buf,=20=
bufp=20-=20buf,=201,=20stdout);=0A+=20=20=20=20=20=20if=20(fwrite=20=
(buf,=20bufp=20-=20buf,=201,=20stdout)=20!=3D=201)=0A+=20=20=20=20=20=20=20=
=20io_error=20();=0A=20=0A=20=20=20=20=20=20=20IF_LINT=20(free=20(buf));=0A=
=20=20=20=20=20}=0Adiff=20--git=20a/tests/local.mk=20b/tests/local.mk=0A=
index=20a83c3d0..8b2a19a=20100644=0A---=20a/tests/local.mk=0A+++=20=
b/tests/local.mk=0A@@=20-235,6=20+235,7=20@@=20all_tests=20=3D=09=09=09=09=
=09\=0A=20=20=20tests/misc/ptx.pl=09=09=09=09\=0A=20=20=20=
tests/misc/test.pl=09=09=09=09\=0A=20=20=20tests/misc/seq.pl=09=09=09=09=
\=0A+=20=20tests/misc/seq-io-errors.sh=09=09=09\=0A=20=20=20=
tests/misc/seq-long-double.sh=09=09=09\=0A=20=20=20=
tests/misc/seq-precision.sh=09=09=09\=0A=20=20=20tests/misc/head.pl=09=09=
=09=09\=0Adiff=20--git=20a/tests/misc/seq-io-errors.sh=20=
b/tests/misc/seq-io-errors.sh=0Anew=20file=20mode=20100755=0Aindex=20=
0000000..2f381e0=0A---=20/dev/null=0A+++=20b/tests/misc/seq-io-errors.sh=0A=
@@=20-0,0=20+1,50=20@@=0A+#!/bin/sh=0A+#=20Test=20for=20proper=20=
detection=20of=20I/O=20errors=20in=20seq=0A+=0A+#=20Copyright=20(C)=20=
2016=20Free=20Software=20Foundation,=20Inc.=0A+=0A+#=20This=20program=20=
is=20free=20software:=20you=20can=20redistribute=20it=20and/or=20modify=0A=
+#=20it=20under=20the=20terms=20of=20the=20GNU=20General=20Public=20=
License=20as=20published=20by=0A+#=20the=20Free=20Software=20Foundation,=20=
either=20version=203=20of=20the=20License,=20or=0A+#=20(at=20your=20=
option)=20any=20later=20version.=0A+=0A+#=20This=20program=20is=20=
distributed=20in=20the=20hope=20that=20it=20will=20be=20useful,=0A+#=20=
but=20WITHOUT=20ANY=20WARRANTY;=20without=20even=20the=20implied=20=
warranty=20of=0A+#=20MERCHANTABILITY=20or=20FITNESS=20FOR=20A=20=
PARTICULAR=20PURPOSE.=20=20See=20the=0A+#=20GNU=20General=20Public=20=
License=20for=20more=20details.=0A+=0A+#=20You=20should=20have=20=
received=20a=20copy=20of=20the=20GNU=20General=20Public=20License=0A+#=20=
along=20with=20this=20program.=20=20If=20not,=20see=20=
<http://www.gnu.org/licenses/>.=0A+=0A+.=20"${srcdir=3D.}/tests/init.sh";=20=
path_prepend_=20./src=0A+print_ver_=20seq=0A+=0A+if=20!=20test=20-w=20=
/dev/full=20||=20!=20test=20-c=20/dev/full;=20then=0A+=20=20skip_=20=
'/dev/full=20is=20required'=0A+fi=0A+=0A+#=20Run=20'seq'=20with=20a=20=
timeout,=20preventing=20infinite-loop=20run.=0A+#=20expected=20returned=20=
codes:=0A+#=20=201=20=20=20=20=20-=20seq=20detected=20an=20I/O=20error=20=
and=20exited=20with=20an=20error.=0A+#=20=20124=20=20=20-=20timed-out=20=
(seq=20likely=20infloop)=0A+#=20=20other=20-=20unexpected=20error=0A=
+timed_seq_fail()=20{=20timeout=2010=20seq=20"$@"=20>/dev/full=20=
2>/dev/null;=20}=0A+=0A+=0A+#=20Test=20infinite=20sequence,=20using=20=
fast-path=20method=20(seq_fast).=0A+returns_=201=20timed_seq_fail=201=20=
inf=20||=20fail=3D1=0A+=0A+#=20Test=20infinite=20sequence,=20using=20=
slow-path=20method=20(print_numbers).=0A+returns_=201=20timed_seq_fail=20=
1.1=20.1=20inf=20||=20fail=3D1=0A+=0A+#=20Test=20non-infinite=20=
sequence,=20using=20slow-path=20method=20(print_numbers).=0A+#=20=
(despite=20being=20non-infinite,=20the=20entire=20sequence=20should=20=
take=20long=20time=20to=0A+#=20=20print.=20Thus,=20either=20an=20I/O=20=
error=20is=20detected=20immediately,=20or=20seq=20will=0A+#=20=20=
timeout).=0A+returns_=201=20timed_seq_fail=201=200.0001=2099999999=20||=20=
fail=3D1=0A+=0A+#=20upon=20EPIPE=20with=20signals=20ignored,=20'seq'=20=
should=20still=20exit=20without=20an=20error.=0A+(trap=20''=20PIPE;=20=
timeout=2010=20sh=20-c=20'seq=20inf=202>err=20|=20head=20-n1')=20||=20=
fail=3D1=0A+compare=20/dev/null=20err=20||=20fail=3D1=0A+=0A+Exit=20=
$fail=0A--=20=0A2.7.0=0A=0A=

--Apple-Mail=_194C1A57-2C35-45B0-B55F-27ABBDFED083
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=windows-1252




--Apple-Mail=_194C1A57-2C35-45B0-B55F-27ABBDFED083--


From MAILER-DAEMON Mon Apr 11 06:01:39 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1apYf5-0003zA-0U
	for mharc-coreutils@gnu.org; Mon, 11 Apr 2016 06:01:39 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:33559)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1apYf2-0003uf-Vr
	for coreutils@gnu.org; Mon, 11 Apr 2016 06:01:37 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1apYey-0008LI-Gw
	for coreutils@gnu.org; Mon, 11 Apr 2016 06:01:36 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:45633)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1apYey-0008Kt-Bu
	for coreutils@gnu.org; Mon, 11 Apr 2016 06:01:32 -0400
Received: from localhost.localdomain (unknown [109.76.229.107])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id E7EBA16D;
	Mon, 11 Apr 2016 11:01:30 +0100 (IST)
Subject: Re: prevent seq from inflow on I/O errors
To: Assaf Gordon <assafgordon@gmail.com>
References: <788E7E16-EFE1-47D0-96CD-A35FB080BBA6@gmail.com>
	<570256BD.7010302@draigBrady.com>
	<57037EDD.2020604@bernhard-voelker.de>
	<F9289C73-DA02-415F-8649-2E787F788E71@gmail.com>
Cc: Coreutils <coreutils@gnu.org>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <570B75FA.4010309@draigBrady.com>
Date: Mon, 11 Apr 2016 11:01:30 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <F9289C73-DA02-415F-8649-2E787F788E71@gmail.com>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 82.195.144.49
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 11 Apr 2016 10:01:37 -0000

On 11/04/16 06:00, Assaf Gordon wrote:
> Hello Bernhard, P=E1draig,
>
>> On Apr 5, 2016, at 05:01, Bernhard Voelker <mail@bernhard-voelker.de> =
wrote:
>>
>> Some findings below:
>
> Thank you for the feedback and improvements.
>
> Patch attached that includes your suggestions.

+1

Thanks!


From MAILER-DAEMON Mon Apr 11 06:03:20 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1apYgi-000656-Dh
	for mharc-coreutils@gnu.org; Mon, 11 Apr 2016 06:03:20 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:33975)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1apYgc-0005xQ-NB
	for coreutils@gnu.org; Mon, 11 Apr 2016 06:03:18 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1apYgY-0000Fs-Nk
	for coreutils@gnu.org; Mon, 11 Apr 2016 06:03:14 -0400
Received: from mout.kundenserver.de ([212.227.17.13]:59353)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1apYgY-0000Fd-FB
	for coreutils@gnu.org; Mon, 11 Apr 2016 06:03:10 -0400
Received: from [192.168.101.10] ([217.86.64.216]) by mrelayeu.kundenserver.de
	(mreue102) with ESMTPSA (Nemesis) id 0LyVBG-1bu7Cv0qoA-015tLS;
	Mon, 11 Apr 2016 12:03:07 +0200
Subject: Re: prevent seq from inflow on I/O errors
To: Assaf Gordon <assafgordon@gmail.com>
References: <788E7E16-EFE1-47D0-96CD-A35FB080BBA6@gmail.com>
	<570256BD.7010302@draigBrady.com>
	<57037EDD.2020604@bernhard-voelker.de>
	<F9289C73-DA02-415F-8649-2E787F788E71@gmail.com>
Cc: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>,
	Coreutils <coreutils@gnu.org>
From: Bernhard Voelker <mail@bernhard-voelker.de>
Message-ID: <570B765A.2090409@bernhard-voelker.de>
Date: Mon, 11 Apr 2016 12:03:06 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.6.0
MIME-Version: 1.0
In-Reply-To: <F9289C73-DA02-415F-8649-2E787F788E71@gmail.com>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:DQnUyGIg9xNx4Uam9IU7FvWhANnkHHdT0n7VP8kiE8QqVqKI7MX
	Hln7zFf0ZuDSFtD2kTS0acodh1V3CRTt5Z8tTT4EyDc8LHASCJ9FcZZhjWnyrWz4cWiGuwv
	ZnmKaDefXUYvNiIKLB3cmfxUAb26Pkx25DZKDTIXZiNAlQdC5VXdaxX4IeUECaYqPkEOre5
	2o7mBM0WHO5f/P9TMmb/g==
X-UI-Out-Filterresults: notjunk:1;V01:K0:AEBg0BC14Vg=:Z5B70DQG5rsV0pAn5HUpy5
	idYhJmQSryCdvS+IvzXno/y0f/dEgtzMVTQmBttdm4TKNXEUcTNV1eHRgK6mxlPNSBFDiwJgj
	ssA6HEpbgOf73A2RpttGYQE8Ccy9N2LmwDMngpIWyykP/dHJzQMhOzcwzOcoWr0gO8w7HQap+
	Pd3W9pY/F+v22Sr+1O/lcTZ4aOYY+6c8THnxaLQ6ndaNM13zZoE9gaHv2kQWBB+G7MMjjFSvb
	h+kV1UK40ZRsAu+omjOIrwjZAm9Sizmf0J4vFaPglmnA1s7gl+4lHF7zisHBAGIWkmMB07ejH
	KsI1gUZGeCZseeE21nnFW2Z9LFZrg3JdS4Het4ho+G6wMFF+w3T1Sqm1C8wszYO3cYmyOQOJZ
	WHhVnOmKkt5WkTZn0S0vfsQrqguw7QX4DnTKFfrYWRKGGcIv1aMNtAc2Qi1iyCXhUhg6urVT4
	6Gl17xIlF5jlm3S/0Y5/67SLwioYcH7NhSN5r3jLP1dTitVpcnFBRNhoGQQt2gD0Sp5QpkrCl
	ODlzWoAteerWahRWCJw74TQCNPWbvXIvwfLqEaQmQt939fOyaFerf1AJDwU79oTyojUB8L4rN
	hv/2tNa3zs7uAs8GibB3wqZo4PGQJTAT+l8iIFlXlatENSomMyypzp7IpCAglOkHrxxiVQoIQ
	RMR+LcpCmsbxvYuhVV6qDvKNwIUS999e/rkfJhDB3SwqWP3x9H0NnZntUIkrt8H25jOSiqfZF
	/Q2dVDUjD107dF5O
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 212.227.17.13
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 11 Apr 2016 10:03:18 -0000

On 04/11/2016 07:00 AM, Assaf Gordon wrote:
> Thank you for the feedback and improvements.
> 
> Patch attached that includes your suggestions.

LGTM, thanks.

Have a nice day,
Berny


From MAILER-DAEMON Mon Apr 11 12:31:49 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1apekf-0008JP-NG
	for mharc-coreutils@gnu.org; Mon, 11 Apr 2016 12:31:49 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:44646)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <S.Kieske@mittwald.de>) id 1ape68-0007eR-4w
	for coreutils@gnu.org; Mon, 11 Apr 2016 11:49:56 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <S.Kieske@mittwald.de>) id 1ape63-0007Y1-5F
	for coreutils@gnu.org; Mon, 11 Apr 2016 11:49:56 -0400
Received: from mailout01.mymxserver.com ([185.15.192.32]:42843)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <S.Kieske@mittwald.de>) id 1ape62-0007Xc-Sr
	for coreutils@gnu.org; Mon, 11 Apr 2016 11:49:51 -0400
Received: from mx51.mymxserver.com (mail01.internal [172.16.51.30])
	by mailout01.mymxserver.com (Postfix) with ESMTP id 3CB42683C3
	for <coreutils@gnu.org>; Mon, 11 Apr 2016 17:49:49 +0200 (CEST)
Received: from mx51.mymxserver.com (localhost [127.0.0.1])
	by mx51.mymxserver.com (Postfix) with ESMTP id 3569820AB1
	for <coreutils@gnu.org>; Mon, 11 Apr 2016 17:49:49 +0200 (CEST)
Received: from localhost (ac01.internal [172.16.51.81])
	by mx51.mymxserver.com (Postfix) with ESMTP id 2FC5020829
	for <coreutils@gnu.org>; Mon, 11 Apr 2016 17:49:49 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at ac01.mittwald.de
Received: from mail51.webspaceconfig.de ([172.16.51.30])
	by localhost (ac01.mittwald.de [172.16.51.81]) (amavisd-new, port 10026)
	with ESMTP id 7xgGb3wDXINm for <coreutils@gnu.org>;
	Mon, 11 Apr 2016 17:49:48 +0200 (CEST)
Received: from MW-EXCHANGE.mw-ks.local (unknown [46.30.62.43])
	(Authenticated sender: p1000p113)
	by mail51.webspaceconfig.de (Postfix) with ESMTPA
	for <coreutils@gnu.org>; Mon, 11 Apr 2016 17:49:48 +0200 (CEST)
Received: from [192.168.8.112] (192.168.8.112) by MW-EXCHANGE.mw-ks.local
	(192.168.110.122) with Microsoft SMTP Server (TLS) id 14.3.279.2;
	Mon, 11 Apr 2016 17:49:48 +0200
X-Authenticated-mymxserver.com: Yes
Subject: Re: Bug in df -l -x?
To: <coreutils@gnu.org>
References: <570BC621.90707@mittwald.de>
From: Sven Kieske <s.kieske@mittwald.de>
Message-ID: <570BC79C.5080606@mittwald.de>
Date: Mon, 11 Apr 2016 17:49:48 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.7.0
MIME-Version: 1.0
In-Reply-To: <570BC621.90707@mittwald.de>
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature";
	boundary="TLcdhdEHQiK75qgNPEmR3sgsKUlnBlRcR"
X-Originating-IP: [192.168.8.112]
X-KSE-AntiSpam-Interceptor-Info: white sender email list
X-KSE-Antivirus-Interceptor-Info: scan successful
X-KSE-Antivirus-Info: Clean
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 185.15.192.32
X-Mailman-Approved-At: Mon, 11 Apr 2016 12:31:49 -0400
X-Content-Filtered-By: Mailman/MimeDel 2.1.21
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 11 Apr 2016 15:49:57 -0000

--TLcdhdEHQiK75qgNPEmR3sgsKUlnBlRcR
From: Sven Kieske <s.kieske@mittwald.de>
To: coreutils@gnu.org
Message-ID: <570BC79C.5080606@mittwald.de>
X-Authenticated-mymxserver.com: Yes
Subject: Re: Bug in df -l -x?
References: <570BC621.90707@mittwald.de>
In-Reply-To: <570BC621.90707@mittwald.de>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 11/04/16 17:43, Sven Kieske wrote:
(long rant about already fixed bug)

Forgive me my ignorance, it seems
this already got fixed in 8.24:

df --local no longer hangs with inaccessible remote mounts.
[bug introduced in coreutils-8.21] [1]

I will test with this newer version and report
back if the issue does not seem to be fixed.

Thanks

[1]:
http://git.savannah.gnu.org/gitweb/?p=3Dcoreutils.git;a=3Dblob;f=3DNEWS;h=
=3Ddd3ee9ccfde6f0cfc0a52f3348190187db1508dc;hb=3DHEAD
--=20
Mit freundlichen Gr=C3=BC=C3=9Fen / Regards

Sven Kieske

Systemadministrator
Mittwald CM Service GmbH & Co. KG
K=C3=B6nigsberger Stra=C3=9Fe 6
32339 Espelkamp
T: +495772 293100
F: +495772 293333
https://www.mittwald.de
Gesch=C3=A4ftsf=C3=BChrer: Robert Meyer
St.Nr.: 331/5721/1033, USt-IdNr.: DE814773217, HRA 6640, AG Bad Oeynhause=
n
Komplement=C3=A4rin: Robert Meyer Verwaltungs GmbH, HRB 13260, AG Bad Oey=
nhausen


--TLcdhdEHQiK75qgNPEmR3sgsKUlnBlRcR
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBAgAGBQJXC8ecAAoJEMby9TMDAbQRI5AQAKPqLWMj+JovgKxLgwehuu4u
Y8floTdlda6JTJgRgwTU+bnReN0WfzygcqfxIp0qm/dhzTx0a/CYu/93E0bK9gGs
YuEQse1i3qcxcT52jziNkNYT0P4jbdT8WjPNRHTTaPv5kIrwD6mjlD+Yj68kiWV+
N4NbWSWx0WFQfFsy7nAvg7BnuNwlCpUU/Bu6RFYo1lHvTjZmWVZE3uWkR3b32j+2
bL0rFmwxX7sVuxrW26Foe7w4WWRmXGf25W4a//IRFK7RryPTEj+hzqLYJX2xOZhh
LF60mOlHotTwSwEm3PWcBnJDSeuOyVN84n7fKjCo30iWlFVWXlA3mG1SoCiHqS8b
h15X5siQsoS3a5o5ZloB4KOIHwqx8O4CNYAM/HJ/GFPhW59GIMK6uUb9MBe6aqOG
EmtxNrW0Vx/fTyzL+V/7nI1KaFTe8PyeyZsneY1efJ3JGP94ryiUO9oxUPBJoZMy
r/bOi/xW4nW+qkxbJzpECGdhBvJfyp5xWDY9C2xfj2aoJUzbaoQtO/hToDMitR1Q
ZHkqwsa5kli5sdf9zFOlxk5PrF+8FThotWvzp3XMetESiZtQRGa+3ZHSSuOG76y/
De01ohjxnjgzrH889GkziiJGi6JB+4pHRR/l4dsqIk9hwrl4mqrl8NAQbPP/5lYm
bOOWPQhzjvXOUcGJNRlK
=YZFp
-----END PGP SIGNATURE-----

--TLcdhdEHQiK75qgNPEmR3sgsKUlnBlRcR--


From MAILER-DAEMON Mon Apr 11 12:31:50 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1apekg-0008L0-HT
	for mharc-coreutils@gnu.org; Mon, 11 Apr 2016 12:31:50 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43041)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <S.Kieske@mittwald.de>) id 1ape01-0007Ye-HQ
	for coreutils@gnu.org; Mon, 11 Apr 2016 11:43:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <S.Kieske@mittwald.de>) id 1apdzw-0006EC-Gm
	for coreutils@gnu.org; Mon, 11 Apr 2016 11:43:37 -0400
Received: from mailout01.mymxserver.com ([185.15.192.32]:40580)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <S.Kieske@mittwald.de>) id 1apdzw-0006Dz-7H
	for coreutils@gnu.org; Mon, 11 Apr 2016 11:43:32 -0400
Received: from mx51.mymxserver.com (mail02.internal [172.16.51.35])
	by mailout01.mymxserver.com (Postfix) with ESMTP id E2A6C69D0F
	for <coreutils@gnu.org>; Mon, 11 Apr 2016 17:43:29 +0200 (CEST)
Received: from mx51.mymxserver.com (localhost [127.0.0.1])
	by mx51.mymxserver.com (Postfix) with ESMTP id DAB5B80A4B
	for <coreutils@gnu.org>; Mon, 11 Apr 2016 17:43:29 +0200 (CEST)
Received: from localhost (ac02.internal [172.16.51.82])
	by mx51.mymxserver.com (Postfix) with ESMTP id D5A1580242
	for <coreutils@gnu.org>; Mon, 11 Apr 2016 17:43:29 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at ac02.mittwald.de
Received: from mail51.webspaceconfig.de ([172.16.51.35])
	by localhost (ac02.mittwald.de [172.16.51.82]) (amavisd-new, port 10026)
	with ESMTP id w1s6V8O8XtHP for <coreutils@gnu.org>;
	Mon, 11 Apr 2016 17:43:29 +0200 (CEST)
Received: from MW-EXCHANGE.mw-ks.local (unknown [46.30.62.43])
	(Authenticated sender: p1000p113)
	by mail51.webspaceconfig.de (Postfix) with ESMTPA
	for <coreutils@gnu.org>; Mon, 11 Apr 2016 17:43:29 +0200 (CEST)
Received: from [192.168.8.112] (192.168.8.112) by MW-EXCHANGE.mw-ks.local
	(192.168.110.122) with Microsoft SMTP Server (TLS) id 14.3.279.2;
	Mon, 11 Apr 2016 17:43:29 +0200
To: <coreutils@gnu.org>
From: Sven Kieske <s.kieske@mittwald.de>
X-Authenticated-mymxserver.com: Yes
Subject: Bug in df -l -x?
Message-ID: <570BC621.90707@mittwald.de>
Date: Mon, 11 Apr 2016 17:43:29 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.7.0
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha1;
	protocol="application/pgp-signature";
	boundary="KQRdvw3jULFB4Hdj1SiIWC87XCL5mjRSp"
X-Originating-IP: [192.168.8.112]
X-KSE-AntiSpam-Interceptor-Info: white sender email list
X-KSE-Antivirus-Interceptor-Info: scan successful
X-KSE-Antivirus-Info: Clean
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 185.15.192.32
X-Mailman-Approved-At: Mon, 11 Apr 2016 12:31:49 -0400
X-Content-Filtered-By: Mailman/MimeDel 2.1.21
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 11 Apr 2016 15:43:39 -0000

--KQRdvw3jULFB4Hdj1SiIWC87XCL5mjRSp
From: Sven Kieske <s.kieske@mittwald.de>
To: coreutils@gnu.org
Message-ID: <570BC621.90707@mittwald.de>
X-Authenticated-mymxserver.com: Yes
Subject: Bug in df -l -x?
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Hi,

first: please keep me cc'ed as
I'm not yet subscribed to the mailing list.

it seems that df -l and df -x
do not what the man page advises it does.

However I wanted to double check with
this list before filing a bug report.

according to my manual page:

-l, --local
              limit listing to local file systems
-x, --exclude-type=3DTYPE
              limit listing to file systems not of type TYPE

Well and it's true, the output is shortend for these remote
fs types, like nfs.

However, what df seems to do, according
to my strace attempts, is to open /etc/mtab
and to do a "stat" on every fs it finds in there (or every mountpoint?)
including also remote filesystems like cifs or nfs.

While this is, strictly speaking, doing
what the man page documents, it can lead to surprising results.

for example in some environments you use periodic
executions of "df" to monitor the disk usage of local
filesystems but you do not want to include remote filesystems
which get monitored on their according nfs server and they
may also vanish at any given time, because the environment
is very dynamic.

what happens is, that df might hang at an nfs mount point
when it is no longer mounted for an infinite time until you kill it.

here is an example of a ps output on a linux machine with hanging
df command since the 10th of March (until today):


ps auxf | grep " D "
root     17803  0.0  0.0   2036   704 pts/1    S+   16:58   0:00
  \_ grep --colour=3Dauto  D
root     27629  0.0  0.0   1696   572 ?        D    Mar10   0:00 df
-PTlk -x smbfs -x cifs -x iso9660 -x udf -x nfsv4 -x nfs -x mvfs -x zfs
root     28029  0.0  0.0   1696   572 ?        D    Mar10   0:00 df
-PTlk -x smbfs -x cifs -x iso9660 -x udf -x nfsv4 -x nfs -x mvfs -x zfs
root     28555  0.0  0.0   1696   568 ?        D    Mar10   0:00 df
-PTlk -x smbfs -x cifs -x iso9660 -x udf -x nfsv4 -x nfs -x mvfs -x zfs
root     29281  0.0  0.0   1696   568 ?        D    Mar10   0:00 df
-PTlk -x smbfs -x cifs -x iso9660 -x udf -x nfsv4 -x nfs -x mvfs -x zfs
root     29900  0.0  0.0   1696   568 ?        D    Mar10   0:00 df
-PTlk -x smbfs -x cifs -x iso9660 -x udf -x nfsv4 -x nfs -x mvfs -x zfs

here is the corresponding source code from a bash script which is used
for monitoring (from the popular "check_mk" Open Source Monitoring Tool):=


echo '<<<df>>>'
# The exclusion list is getting a bit of a problem. -l should hide any
remote FS but seems
# to be all but working.
excludefs=3D"-x smbfs -x cifs -x iso9660 -x udf -x nfsv4 -x nfs -x mvfs -=
x
zfs"
df -PTlk $excludefs | sed 1d


To reiterate:

yes, df does not _list_ any remote filesystems in it's output, but it
_processes_ them in some way, leading to a hang in df if the file system
is not there for whatever reason.

It would be kind if this behaviour could get changed, or if I'm doing
something wrong, maybe someone can enlighten me?
Your help would be much appreciated.

PS: for completeness sake, here is the tested version:

df --version
df (GNU coreutils) 8.22
[..]

--=20
Mit freundlichen Gr=C3=BC=C3=9Fen / Regards

Sven Kieske

Systemadministrator
Mittwald CM Service GmbH & Co. KG
K=C3=B6nigsberger Stra=C3=9Fe 6
32339 Espelkamp
T: +495772 293100
F: +495772 293333
https://www.mittwald.de
Gesch=C3=A4ftsf=C3=BChrer: Robert Meyer
St.Nr.: 331/5721/1033, USt-IdNr.: DE814773217, HRA 6640, AG Bad Oeynhause=
n
Komplement=C3=A4rin: Robert Meyer Verwaltungs GmbH, HRB 13260, AG Bad Oey=
nhausen


--KQRdvw3jULFB4Hdj1SiIWC87XCL5mjRSp
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAEBAgAGBQJXC8YhAAoJEMby9TMDAbQRluMQAJugoeEXYtSsByfmV3pL/8Rd
U5fP84Qznop6yUsaTUmPUQVh+Le61CqB5wp+cucuxJH6A87X0lBt6s4Y92Sm3YeC
YEJaF9MXkiBJGfFCs7M5PQYm15ZeJK9QcImHQwIE8QDtKC4CrOCt86npTElEXn4O
peD6DbVRpo/w9IKHWm95xRp796TmYQESjRnni5mL1rFBhwvmlkzZTS/u0/XLCxDw
aIAqmANgWqIEHx+5IKg4BswvWMFjMPsLGC8BqAq/zJEWc/teql3yIfJUOcqJqaqa
PHZAsq4AbOCvIPE1WXei3itqxCusXS7hgBrukjbXyulRVNakWd+WEL5qYqGPPPH/
U3wTavyud4bKaleEc97zJAzPmHwAZgdDfoCejDN5IakSGr7w5GJ5Kn2cniq7KsnJ
ULTeS+/pgaDZsiLdyEPaJwjrl04jcry+EePCZaet0UrC32SbhoINH6sWkYlxmtnm
MFU1Bq6Y2tN+Tjc7j0Ywyd6YxJkZN+0JDSlPbpvsB5QyqTeLNDWVNZtwmoLdWiVH
JHps8LtNbfeVGWXWQw/wQanjazzZzpVHFtPYzcm+UW3W1nHUCNz7XDOCJlF4pQ6y
iBYqdfs/EzKrSwzFj0ly+y36SLL+x3P5ulVojqzKbxfOVv+F9FJeICKkIMXYhaVt
Gk/VUU1hvomOXZJOcP3d
=pKV1
-----END PGP SIGNATURE-----

--KQRdvw3jULFB4Hdj1SiIWC87XCL5mjRSp--


From MAILER-DAEMON Mon Apr 11 13:30:18 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1apffG-0006G5-QC
	for mharc-coreutils@gnu.org; Mon, 11 Apr 2016 13:30:18 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:41068)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <thisisdaniellockyer@gmail.com>) id 1apffE-0006CR-99
	for coreutils@gnu.org; Mon, 11 Apr 2016 13:30:17 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <thisisdaniellockyer@gmail.com>) id 1apffB-00055S-3k
	for coreutils@gnu.org; Mon, 11 Apr 2016 13:30:16 -0400
Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:33902)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <thisisdaniellockyer@gmail.com>) id 1apffA-000555-TT
	for coreutils@gnu.org; Mon, 11 Apr 2016 13:30:13 -0400
Received: by mail-wm0-x241.google.com with SMTP id n3so22781058wmn.1
	for <coreutils@gnu.org>; Mon, 11 Apr 2016 10:30:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=date:from:to:subject:message-id:mime-version:content-disposition;
	bh=0VZGo0L/zvZ/MXD+WZVLD8VTpAAVYaUU9Hq1Ed3D++M=;
	b=rAZJ3Q4JtEPNWt2VBUGdnASqlyU6ykVOn9GIr02TBcAcB/dx0CLNbd17+bNaqGlOSQ
	f+7n2+M2MrTfbipcPWK62M0tXNYhJp7ckKCckNJEeV9Ajwo+MRLdiB0P+HiZE88SjVFC
	hY+zeu3TAc7ePbMBFewfn3pncxx/lzUNDRmB2kgEDqNVmp4N+cuH/oWvNHv+RzaPNHz4
	13LqlYKnqK08vwmnUzmKUOJuhWU0apcwWSGkoH1/C15631wjin4R3LfFt/9DzfdtmzWn
	aiHgM8Ck6WpYLcNnIRaqpQNm77n8VO5zlNbO+8oTYBlN4Zl3UKRNHVJiBrhX2uFovwik
	N3bg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:date:from:to:subject:message-id:mime-version
	:content-disposition;
	bh=0VZGo0L/zvZ/MXD+WZVLD8VTpAAVYaUU9Hq1Ed3D++M=;
	b=UzeYDZVIO3oBKa0+ihr4D4eyshVLDmhAwo6XCi3wxqsCc47QrmoPAayrpVkpnM9n4c
	vJSqs7Z4eR/VfcpWjz8lEXwOf6j4n4WcHoVVnOfXiR28amF8Bku4+gmmx5s0+XvW0GpA
	rJ0oqe6pP1iJUmmPxD54AM+PlmNjIqy6yFGpKtYqbpJt8aTGA862sLYUoyaSVlqkbMuw
	48BlyTGQe9oChPQE7+u8oUMZgT5OoJgvK/AixRUrSs5k3+DyqwDLFpR3CRndai72551c
	HABgLF+jR02DN1wDDTWHgixi56jw8a2exC1hwnZXBRtrx5bl707k71GUOl8N1r2bppjw
	ECKg==
X-Gm-Message-State: AD7BkJJ+ZjCs24OWtuNZ/OQ1bUt1xN4LfFMakc3b6RtjT99oIXhsog9c7uMK8nNc8iv9vg==
X-Received: by 10.28.63.73 with SMTP id m70mr20498162wma.55.1460395811823;
	Mon, 11 Apr 2016 10:30:11 -0700 (PDT)
Received: from localhost (nat-0-186.soton.ac.uk. [152.78.0.186])
	by smtp.gmail.com with ESMTPSA id
	d2sm29009404wjf.28.2016.04.11.10.30.11 for <coreutils@gnu.org>
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Mon, 11 Apr 2016 10:30:11 -0700 (PDT)
Date: Mon, 11 Apr 2016 18:30:10 +0100
From: Daniel Lockyer <thisisdaniellockyer@gmail.com>
To: coreutils@gnu.org
Subject: [PATCH] nl: free allocated strings to avoid valgrind warning
Message-ID: <20160411173010.GA12770@eve>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2a00:1450:400c:c09::241
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 11 Apr 2016 17:30:17 -0000

* src/nl.c (main): free (with IF_LINT guarding) header_del, body_del,
    footer_del and print_no_line_fmt to keep valgrind quiet about
    not being free before exiting.
---
 src/nl.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/nl.c b/src/nl.c
index a4a48bc..4064822 100644
--- a/src/nl.c
+++ b/src/nl.c
@@ -586,5 +586,10 @@ main (int argc, char **argv)
   if (have_read_stdin && fclose (stdin) == EOF)
     error (EXIT_FAILURE, errno, "-");
 
+  IF_LINT (free (header_del));
+  IF_LINT (free (body_del));
+  IF_LINT (free (footer_del));
+  IF_LINT (free (print_no_line_fmt));
+
   return ok ? EXIT_SUCCESS : EXIT_FAILURE;
 }
-- 
2.8.0



From MAILER-DAEMON Mon Apr 11 13:44:51 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1apftL-0007x5-E9
	for mharc-coreutils@gnu.org; Mon, 11 Apr 2016 13:44:51 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43294)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1apftJ-0007uV-48
	for coreutils@gnu.org; Mon, 11 Apr 2016 13:44:50 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1apftE-0007o1-4z
	for coreutils@gnu.org; Mon, 11 Apr 2016 13:44:49 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:46934)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1apftD-0007nr-Vh
	for coreutils@gnu.org; Mon, 11 Apr 2016 13:44:44 -0400
Received: from localhost.localdomain (unknown [109.76.229.107])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 7718E16D;
	Mon, 11 Apr 2016 18:44:42 +0100 (IST)
Subject: Re: [PATCH] nl: free allocated strings to avoid valgrind warning
To: Daniel Lockyer <thisisdaniellockyer@gmail.com>, coreutils@gnu.org
References: <20160411173010.GA12770@eve>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <570BE289.6030709@draigBrady.com>
Date: Mon, 11 Apr 2016 18:44:41 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <20160411173010.GA12770@eve>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 82.195.144.49
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 11 Apr 2016 17:44:50 -0000

On 11/04/16 18:30, Daniel Lockyer wrote:
> * src/nl.c (main): free (with IF_LINT guarding) header_del, body_del,
>      footer_del and print_no_line_fmt to keep valgrind quiet about
>      not being free before exiting.
> ---
>   src/nl.c | 5 +++++
>   1 file changed, 5 insertions(+)
>
> diff --git a/src/nl.c b/src/nl.c
> index a4a48bc..4064822 100644
> --- a/src/nl.c
> +++ b/src/nl.c
> @@ -586,5 +586,10 @@ main (int argc, char **argv)
>     if (have_read_stdin && fclose (stdin) =3D=3D EOF)
>       error (EXIT_FAILURE, errno, "-");
>
> +  IF_LINT (free (header_del));
> +  IF_LINT (free (body_del));
> +  IF_LINT (free (footer_del));
> +  IF_LINT (free (print_no_line_fmt));
> +
>     return ok ? EXIT_SUCCESS : EXIT_FAILURE;
>   }
>

This is just a "still reachable" warning I think.
We only consider freeing stuff when valgrind marks it as "definitely lost=
",
which was the case for your previous date.c patch but not here?

cheers,
P=E1draig


From MAILER-DAEMON Mon Apr 11 13:56:30 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1apg4c-0006Bf-De
	for mharc-coreutils@gnu.org; Mon, 11 Apr 2016 13:56:30 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:45755)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <thisisdaniellockyer@gmail.com>) id 1apg4Z-000685-Li
	for coreutils@gnu.org; Mon, 11 Apr 2016 13:56:28 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <thisisdaniellockyer@gmail.com>) id 1apg4W-0001jZ-De
	for coreutils@gnu.org; Mon, 11 Apr 2016 13:56:27 -0400
Received: from mail-wm0-x241.google.com ([2a00:1450:400c:c09::241]:36169)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <thisisdaniellockyer@gmail.com>) id 1apg4W-0001jV-7n
	for coreutils@gnu.org; Mon, 11 Apr 2016 13:56:24 -0400
Received: by mail-wm0-x241.google.com with SMTP id l6so22912327wml.3
	for <coreutils@gnu.org>; Mon, 11 Apr 2016 10:56:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=date:from:to:cc:subject:message-id:references:mime-version
	:content-disposition:content-transfer-encoding:in-reply-to;
	bh=L/4cVwv8TjxjY5mcyAhK+fGHXKsVtqw/uY0EpkGlrbc=;
	b=Y6ZxELJmkiykIFIPfI+TNbGiKPtCGatlgRw4vIaj6Ge4JiAZJhaHIKuaywqFtGeRlq
	mVT8YLewbfO2B8Zm47fnwpSdVZHqpqd2sbPR4UGh+sbhONHt7Yjs0sSApMQI/pw60jAc
	Cr1w2YDlVZ8BNK6afWKMnawqiTgxDvK8U/23qF9idAL8RpziHnzFYoYCUriXk5dOKDbp
	wb7AysMSOf55Ag5VGpSncutqQC+y6/5f+S72vtmTKNDSvkxKi6WFtfEb/EznBkL7wBPM
	36npS32Yck3a0uD29zftTDxjwWnqessbhrIlCV+EyQD1qNRhlBsfLpVKtHkQ9t5xxmL3
	RXVw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:date:from:to:cc:subject:message-id:references
	:mime-version:content-disposition:content-transfer-encoding
	:in-reply-to;
	bh=L/4cVwv8TjxjY5mcyAhK+fGHXKsVtqw/uY0EpkGlrbc=;
	b=Ph5pHqd6T1LVno/JUzG72TM06KdRQcRE4pLmaQuw6cEKEqmo/4uCHKX+pu3LToNvBx
	UX76LSuFCGf16DCnZMxsddoO8Ca8TLw6zGVg0YnkR3V7E8Z94xvjWmxvtMikKCxlTU9h
	UKNuqYI3UdWkbNeDNr0Q8mqm43jTNZX1oG/tKsxhd4Bh/uPlrMcVijn5O9miwVfiI2Rm
	Q7H5DSGVyfFrMMAcjDkqqW+qzfIgy2pwgy8JM78HNHFNc4TtYs5AA0tqBKG27a+srGvP
	AQk4/79uJZgGNcM0BlrZ+umpAei7MLPAeI6kiyqz5Gb+n9wRBaitWdAsFO3qckrRXYAh
	bAmg==
X-Gm-Message-State: AD7BkJLiy4Dw7E9EEbPAD7tt8qeHso9A0Xf/tfWwwMt0AyPy/DJwuQL1xfNliZXR8KiHmQ==
X-Received: by 10.194.184.38 with SMTP id er6mr24422373wjc.93.1460397383405;
	Mon, 11 Apr 2016 10:56:23 -0700 (PDT)
Received: from localhost (nat-0-186.soton.ac.uk. [152.78.0.186])
	by smtp.gmail.com with ESMTPSA id
	j10sm29088134wjb.46.2016.04.11.10.56.22
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Mon, 11 Apr 2016 10:56:22 -0700 (PDT)
Date: Mon, 11 Apr 2016 18:56:21 +0100
From: Daniel Lockyer <thisisdaniellockyer@gmail.com>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Cc: coreutils@gnu.org
Subject: Re: [PATCH] nl: free allocated strings to avoid valgrind warning
Message-ID: <20160411175621.GA15088@eve>
References: <20160411173010.GA12770@eve>
 <570BE289.6030709@draigBrady.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <570BE289.6030709@draigBrady.com>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2a00:1450:400c:c09::241
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 11 Apr 2016 17:56:28 -0000

On Mon, Apr 11, 2016 at 06:44:41PM +0100, Pádraig Brady wrote:
> On 11/04/16 18:30, Daniel Lockyer wrote:
> > * src/nl.c (main): free (with IF_LINT guarding) header_del, body_del,
> >      footer_del and print_no_line_fmt to keep valgrind quiet about
> >      not being free before exiting.
> > ---
> >   src/nl.c | 5 +++++
> >   1 file changed, 5 insertions(+)
> > 
> > diff --git a/src/nl.c b/src/nl.c
> > index a4a48bc..4064822 100644
> > --- a/src/nl.c
> > +++ b/src/nl.c
> > @@ -586,5 +586,10 @@ main (int argc, char **argv)
> >     if (have_read_stdin && fclose (stdin) == EOF)
> >       error (EXIT_FAILURE, errno, "-");
> > 
> > +  IF_LINT (free (header_del));
> > +  IF_LINT (free (body_del));
> > +  IF_LINT (free (footer_del));
> > +  IF_LINT (free (print_no_line_fmt));
> > +
> >     return ok ? EXIT_SUCCESS : EXIT_FAILURE;
> >   }
> > 
> 
> This is just a "still reachable" warning I think.
> We only consider freeing stuff when valgrind marks it as "definitely lost",
> which was the case for your previous date.c patch but not here?
> 
> cheers,
> Pádraig

You are correct, it is. I didn't know that was a condition but no
worries, I'll keep searching!

Thanks,
Daniel


From MAILER-DAEMON Mon Apr 11 17:17:05 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1apjCj-0006N0-Fs
	for mharc-coreutils@gnu.org; Mon, 11 Apr 2016 17:17:05 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:55665)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1apjCg-0006HD-TG
	for coreutils@gnu.org; Mon, 11 Apr 2016 17:17:03 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1apjCd-0000VF-N5
	for coreutils@gnu.org; Mon, 11 Apr 2016 17:17:02 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:47581)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1apjCd-0000Ul-H3
	for coreutils@gnu.org; Mon, 11 Apr 2016 17:16:59 -0400
Received: from [192.168.1.80] (unknown [109.76.229.107])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 1B14C16D;
	Mon, 11 Apr 2016 22:16:58 +0100 (IST)
Subject: Re: [PATCH] nl: free allocated strings to avoid valgrind warning
To: Daniel Lockyer <thisisdaniellockyer@gmail.com>
References: <20160411173010.GA12770@eve> <570BE289.6030709@draigBrady.com>
	<20160411175621.GA15088@eve>
Cc: coreutils@gnu.org
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <570C1449.8090207@draigBrady.com>
Date: Mon, 11 Apr 2016 22:16:57 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <20160411175621.GA15088@eve>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 82.195.144.49
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 11 Apr 2016 21:17:04 -0000

On 11/04/16 18:56, Daniel Lockyer wrote:
> On Mon, Apr 11, 2016 at 06:44:41PM +0100, P=E1draig Brady wrote:
>> On 11/04/16 18:30, Daniel Lockyer wrote:
>>> * src/nl.c (main): free (with IF_LINT guarding) header_del, body_del,
>>>       footer_del and print_no_line_fmt to keep valgrind quiet about
>>>       not being free before exiting.
>>> ---
>>>    src/nl.c | 5 +++++
>>>    1 file changed, 5 insertions(+)
>>>
>>> diff --git a/src/nl.c b/src/nl.c
>>> index a4a48bc..4064822 100644
>>> --- a/src/nl.c
>>> +++ b/src/nl.c
>>> @@ -586,5 +586,10 @@ main (int argc, char **argv)
>>>      if (have_read_stdin && fclose (stdin) =3D=3D EOF)
>>>        error (EXIT_FAILURE, errno, "-");
>>>
>>> +  IF_LINT (free (header_del));
>>> +  IF_LINT (free (body_del));
>>> +  IF_LINT (free (footer_del));
>>> +  IF_LINT (free (print_no_line_fmt));
>>> +
>>>      return ok ? EXIT_SUCCESS : EXIT_FAILURE;
>>>    }
>>>
>>
>> This is just a "still reachable" warning I think.
>> We only consider freeing stuff when valgrind marks it as "definitely l=
ost",
>> which was the case for your previous date.c patch but not here?
>>
>> cheers,
>> P=E1draig
>
> You are correct, it is. I didn't know that was a condition but no
> worries, I'll keep searching!

Theoretically that could be automated by setting up valgrind wrappers usi=
ng:
http://git.sv.gnu.org/gitweb/?p=3Dcoreutils.git;a=3Dblob;f=3DREADME-valgr=
ind;hb=3DHEAD
and using the--errors-for-leak-kinds=3Ddefinite option

cheers,
P=E1draig


From MAILER-DAEMON Wed Apr 13 11:43:11 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1aqMwh-00060Z-1l
	for mharc-coreutils@gnu.org; Wed, 13 Apr 2016 11:43:11 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:53760)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gcgcg-coreutils@m.gmane.org>) id 1aqMal-0007IZ-2O
	for coreutils@gnu.org; Wed, 13 Apr 2016 11:20:34 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gcgcg-coreutils@m.gmane.org>) id 1aqMah-0005fY-SO
	for coreutils@gnu.org; Wed, 13 Apr 2016 11:20:30 -0400
Received: from plane.gmane.org ([80.91.229.3]:41488)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gcgcg-coreutils@m.gmane.org>) id 1aqMah-0005fS-MN
	for coreutils@gnu.org; Wed, 13 Apr 2016 11:20:27 -0400
Received: from list by plane.gmane.org with local (Exim 4.69)
	(envelope-from <gcgcg-coreutils@m.gmane.org>) id 1aqMab-0000F8-4M
	for coreutils@gnu.org; Wed, 13 Apr 2016 17:20:21 +0200
Received: from 05449dd5.skybroadband.com ([5.68.157.213])
	by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <coreutils@gnu.org>; Wed, 13 Apr 2016 17:20:21 +0200
Received: from stephane.chazelas by 05449dd5.skybroadband.com with local
	(Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00
	for <coreutils@gnu.org>; Wed, 13 Apr 2016 17:20:21 +0200
X-Injected-Via-Gmane: http://gmane.org/
To: coreutils@gnu.org
From: Stephane Chazelas <stephane.chazelas@gmail.com>
Subject: Re: [PATCH v2 1/2] test: Add unary operator -E: test that a file is
	an empty directory
Date: Wed, 13 Apr 2016 16:16:54 +0100
Lines: 40
Message-ID: <20160413151654.GD6461@chaz.gmail.com>
References: <1459962572-31799-1-git-send-email-maandree@member.fsf.org>
	<1460018097-31668-1-git-send-email-maandree@member.fsf.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
X-Complaints-To: usenet@ger.gmane.org
X-Gmane-NNTP-Posting-Host: 05449dd5.skybroadband.com
Content-Disposition: inline
In-Reply-To: <1460018097-31668-1-git-send-email-maandree@member.fsf.org>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 80.91.229.3
X-Mailman-Approved-At: Wed, 13 Apr 2016 11:43:10 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 13 Apr 2016 15:20:35 -0000

2016-04-07 10:34:56 +0200, Mattias Andrée:
[....]
> +  if (!dir)
> +    {
> +      error (0, errno, "%s", dirname);
> +      test_exit (TEST_FAILURE);
> +    }

Note that it means it makes it the first operator that would
actually cause "test" to output something.

A test for non-empty without diagnostic output, like for [ -s ]
may be preferable.

For most of the current operators, test returns true if the test
can be performed and the test succeeds and returns false
otherwise without an error message.

For instance, [ -e /secret/file ] would return false if "file"
exists but you don't have search access to "/secret" and you
don't get an error.


> +
> +  while (errno = 0, (de = readdir (dir)))

That also means that would be the first operator that has a side
effect: update the access time of the directory.

Note that GNU find has a "-empty" predicate.

Zsh has a "F" (for "full") glob qualifier. *(F) expands to the
non-empty non-hidden directories in the current directory.

[ -F dir ], (for test for non-empty) could be an alternative. It
doesn't seem to be taken by any of the "test" implementation
I've checked.

-- 
Stephane



From MAILER-DAEMON Wed Apr 13 11:43:11 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1aqMwh-00061i-GF
	for mharc-coreutils@gnu.org; Wed, 13 Apr 2016 11:43:11 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43080)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gcgcg-coreutils@m.gmane.org>) id 1aqLy0-0005wf-IV
	for coreutils@gnu.org; Wed, 13 Apr 2016 10:40:29 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <gcgcg-coreutils@m.gmane.org>) id 1aqLxu-0002ZD-R8
	for coreutils@gnu.org; Wed, 13 Apr 2016 10:40:28 -0400
Received: from plane.gmane.org ([80.91.229.3]:37475)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <gcgcg-coreutils@m.gmane.org>) id 1aqLxu-0002Z9-KZ
	for coreutils@gnu.org; Wed, 13 Apr 2016 10:40:22 -0400
Received: from list by plane.gmane.org with local (Exim 4.69)
	(envelope-from <gcgcg-coreutils@m.gmane.org>) id 1aqLxs-0005Kv-0d
	for coreutils@gnu.org; Wed, 13 Apr 2016 16:40:20 +0200
Received: from 05449dd5.skybroadband.com ([5.68.157.213])
	by main.gmane.org with esmtp (Gmexim 0.1 (Debian))
	id 1AlnuQ-0007hv-00
	for <coreutils@gnu.org>; Wed, 13 Apr 2016 16:40:19 +0200
Received: from stephane.chazelas by 05449dd5.skybroadband.com with local
	(Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00
	for <coreutils@gnu.org>; Wed, 13 Apr 2016 16:40:19 +0200
X-Injected-Via-Gmane: http://gmane.org/
To: coreutils@gnu.org
From: Stephane Chazelas <stephane.chazelas@gmail.com>
Subject: Re: Whats the reason to suppress short unicode characters in printf?
Date: Wed, 13 Apr 2016 15:39:10 +0100
Lines: 26
Message-ID: <20160413143910.GC6461@chaz.gmail.com>
References: <383774da0bc1985fb0263d469529e52f@yourdomain.dom>
	<20160405024356.GC6588@vapier.lan>
	<CA+8g5KGmdXvcUsSiceJ=LZp49yoUE9yW+BM6D=VpZetvZMLmfg@mail.gmail.com>
	<5703C566.2090804@redhat.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: usenet@ger.gmane.org
X-Gmane-NNTP-Posting-Host: 05449dd5.skybroadband.com
Content-Disposition: inline
In-Reply-To: <5703C566.2090804@redhat.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 80.91.229.3
X-Mailman-Approved-At: Wed, 13 Apr 2016 11:43:09 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 13 Apr 2016 14:40:30 -0000

2016-04-05 08:02:14 -0600, Eric Blake:
[...]
> That said, it may be time to consider teaching coreutils to accept ALL
> \uXXXX escapes, rather than just the ones required by C99, as an
> extension for ease of use.
[...]

Especially considering that the current POSIX draft for sh's
$'\uxxxx' and $'\UXXXXXXXX' quotes/expansions now requires shell
to support $'\ue9' as well as $'\u00e9'

http://austingroupbugs.net/bug_view_page.php?bug_id=249

(an initial proposal only allowed $'\u00e9', but that changed
after this discussion:
http://thread.gmane.org/gmane.comp.standards.posix.austin.general/10289/focus=10295
)

I'd expect if they specify $'\ue9', they would also end up
specifying printf '\ue9' at some point.

All the bash, ksh93, lksh, zsh implementations of printf support
\ue9.

-- 
Stephane



From MAILER-DAEMON Wed Apr 13 11:57:32 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1aqNAa-0001Fz-NW
	for mharc-coreutils@gnu.org; Wed, 13 Apr 2016 11:57:32 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:37233)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1aqNAV-0001AK-86
	for coreutils@gnu.org; Wed, 13 Apr 2016 11:57:31 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1aqNAQ-0000Ga-81
	for coreutils@gnu.org; Wed, 13 Apr 2016 11:57:27 -0400
Received: from smtp-4.sys.kth.se ([2001:6b0:1:1300:250:56ff:fea6:2de3]:39902)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <maandree@member.fsf.org>) id 1aqNAP-0000GE-Su
	for coreutils@gnu.org; Wed, 13 Apr 2016 11:57:22 -0400
Received: from smtp-4.sys.kth.se (localhost.localdomain [127.0.0.1])
	by smtp-4.sys.kth.se (Postfix) with ESMTP id 6DFC8C71
	for <coreutils@gnu.org>; Wed, 13 Apr 2016 17:57:20 +0200 (CEST)
X-Virus-Scanned: by amavisd-new at kth.se
Received: from smtp-4.sys.kth.se ([127.0.0.1])
	by smtp-4.sys.kth.se (smtp-4.sys.kth.se [127.0.0.1]) (amavisd-new,
	port 10024) with LMTP id Mn1ioz8tgycU for <coreutils@gnu.org>;
	Wed, 13 Apr 2016 17:57:19 +0200 (CEST)
X-KTH-Auth: maandree [81.228.219.220]
X-KTH-mail-from: maandree@member.fsf.org
X-KTH-rcpt-to: coreutils@gnu.org
Received: from localhost.localdomain (h220n13-jak-a12.ias.bredband.telia.com
	[81.228.219.220])
	by smtp-4.sys.kth.se (Postfix) with ESMTPSA id 4670C65B
	for <coreutils@gnu.org>; Wed, 13 Apr 2016 17:57:18 +0200 (CEST)
Date: Wed, 13 Apr 2016 17:57:10 +0200
From: Mattias =?UTF-8?B?QW5kcsOpZQ==?= <maandree@member.fsf.org>
To: <coreutils@gnu.org>
Subject: Re: [PATCH v2 1/2] test: Add unary operator -E: test that a file is
	an empty directory
Message-ID: <20160413175710.64ec2dac.maandree@kth.se>
In-Reply-To: <20160413151654.GD6461@chaz.gmail.com>
References: <1459962572-31799-1-git-send-email-maandree@member.fsf.org>
	<1460018097-31668-1-git-send-email-maandree@member.fsf.org>
	<20160413151654.GD6461@chaz.gmail.com>
X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-unknown-linux-gnu)
X-Awesomeness: 120 %
User-Agent: Claws Mail
X-Operating-System: GNU/Linux
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
	boundary="Sig_/rIfGOBWvws.vPj4S4Kx1yCH";
	protocol="application/pgp-signature"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x
X-Received-From: 2001:6b0:1:1300:250:56ff:fea6:2de3
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 13 Apr 2016 15:57:31 -0000

--Sig_/rIfGOBWvws.vPj4S4Kx1yCH
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Wed, 13 Apr 2016 16:16:54 +0100
Stephane Chazelas <stephane.chazelas@gmail.com> wrote:

> 2016-04-07 10:34:56 +0200, Mattias Andr=C3=A9e:
> [....]
> > +  if (!dir)
> > +    {
> > +      error (0, errno, "%s", dirname);
> > +      test_exit (TEST_FAILURE);
> > +    } =20
>=20
> Note that it means it makes it the first operator that
> would actually cause "test" to output something.
>=20
> A test for non-empty without diagnostic output, like for
> [ -s ] may be preferable.

-s is of course already in use, but what is wrong with

  2> /dev/null

>=20
> For most of the current operators, test returns true if
> the test can be performed and the test succeeds and
> returns false otherwise without an error message.
>=20
> For instance, [ -e /secret/file ] would return false if
> "file" exists but you don't have search access to
> "/secret" and you don't get an error.

I don't believe there is anything wrong with that, but
of you want to be pedantic you should fail if you get EIO.
-s may also want to return success if you get EOVERFLOW.

>=20
>=20
> > +
> > +  while (errno =3D 0, (de =3D readdir (dir))) =20
>=20
> That also means that would be the first operator that has
> a side effect: update the access time of the directory.

Does that matter? If it does, we could use fdopendir instead
and open it with O_NOATIME. But that would make the solution
both more complex and less portable.

>=20
> Note that GNU find has a "-empty" predicate.
>=20
> Zsh has a "F" (for "full") glob qualifier. *(F) expands
> to the non-empty non-hidden directories in the current
> directory.
>=20
> [ -F dir ], (for test for non-empty) could be an
> alternative. It doesn't seem to be taken by any of the
> "test" implementation I've checked.
>=20

Sure, but -E may feel more natural, and we hardly need
both. We are much more familiar with thinking of an
empty directory as a separate file type. Additionally,
calling something, that contains at least one item is,
=E2=80=9Cfull=E2=80=9D is a misnomer.

--Sig_/rIfGOBWvws.vPj4S4Kx1yCH
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQIcBAEBCAAGBQJXDmxWAAoJEM4wYJDpiwjHPYEQAMDQE5K7giLD30un9Zrbjl8L
tvv70mZPd8T7DSO8vyaRn+5yOq0GMqvqC46D3KL7Guw17EEEbcaGd/1gyFerkZY+
uiqQ7G/0MU1wZKcOhWsQYSXVfgl5tCo5jwwR0bTVmni/NgSaV6O3HKdny8PIjgkv
L13cwNPJer9m0S2B153w97Zi8F5CgjLysRMt5cWFJTdcGihqowfHLA7U2Aqm1wP0
Ua4LQ+V9wkPNor+kSdiAGxNO+qf93bU+Hns4Y1HIjAeYSU5VaaSvKhgYXp8FN34y
AkAmYpL8g+3CMGHrSfi8xycZ5SREZyE8loeuUY3p92/JE5X23PIwUOfbJIOKr+sB
XuYi9E9n4vcWV8wm1TZqJEenh26G4cHLe33iHUNBgGHvdufq39nVnNubbhBgK68O
CWaZ7d5wNVBo4+kfzNcPbMeV0WikN1Q0Xm0cuB1i0YhQsEowypHhic/Mp4OQhxA9
/eQ+pga8IWUzZdVMVcI3GNITEJqLVpLJojIHEYhFoqhH8HqTexRuhRyLP0dm7mpo
jcZC7akDgelBBAszhcS5eoPUHtKM+fPkZb6BH4V/3A6H6MRzWKuaw65+Y+WIaMkl
Z0bfp/gvM3w3NlJKYTJ4oQSYRByizBaaN8LHy9z2rOYNS1ds2T/LlpO5XYTGi1En
Oshaca1az+T/ubuWWSHA
=PL16
-----END PGP SIGNATURE-----

--Sig_/rIfGOBWvws.vPj4S4Kx1yCH--


From MAILER-DAEMON Sun Apr 17 03:45:15 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1arhON-00033y-F5
	for mharc-coreutils@gnu.org; Sun, 17 Apr 2016 03:45:15 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:45203)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1arhOL-00030y-0k
	for coreutils@gnu.org; Sun, 17 Apr 2016 03:45:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1arhOH-0000UI-Rq
	for coreutils@gnu.org; Sun, 17 Apr 2016 03:45:12 -0400
Received: from mail-qg0-x231.google.com ([2607:f8b0:400d:c04::231]:32873)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1arhOH-0000UD-LR
	for coreutils@gnu.org; Sun, 17 Apr 2016 03:45:09 -0400
Received: by mail-qg0-x231.google.com with SMTP id v14so11613749qge.0
	for <coreutils@gnu.org>; Sun, 17 Apr 2016 00:45:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:subject:from:in-reply-to:date:cc:message-id:references
	:to; bh=rqxrharc09Zd5+s/0HNh+zFQDSl11/bcXW3O/2ZlGLw=;
	b=z3d26O403mq3N8pPuK95JIfdsORFdDCW7KjkKlb1FGmwzKx0Vr8O7iLtAsODrbUtuk
	rw3R7SzW3CsVd5V+GhW5wsL5W+0afYyccpvRYwevrQEqOacTtuNa+dS7omuWvA7qu1Qu
	hSlmmDba4G9xuycE3zUIeQUopRe2GxsnlqBUnPfC3//xQMZqZpDorOoZbnPVNTm1kF71
	RFkpj3sxHFo8PlR2xr2/vjadK+FRaQ9yKS/5e+SksTGFxKry8RPIo+OhbnZOWzDPExG4
	TjwOQ+x2ec/jC24HxI+akeEIFjn+0Uy5MxF2wSIUys1Qs2X/qzKlnVvNHoqNMcTQR8Qe
	WXKw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc
	:message-id:references:to;
	bh=rqxrharc09Zd5+s/0HNh+zFQDSl11/bcXW3O/2ZlGLw=;
	b=Z8ECIQwhvAUzmlX70MfUCQljNJJkhMOCOmCKdeLvaQYFK4FfnGnRU0qokE4Rk1kZil
	nH0uu1ZeBNeM3EG8mubHucoLe5kI41pKHW3lhD0/BhFqYw94cL2WmW0WZkb8cfbizYhF
	IB0Fg2ojYzmfjslagoM3SUFRoIIUYdWkzR3lk7FwhnKZQjpgvAYtVIg7UTyNxxA4jqLM
	FELGiLY2KpGaSJLmENRbsOs7JfL59rc0QYNuV8xPw057DtaTicoEa0yFphWGVNw67Y/0
	O6/Qt/XqdDutlRljsJgEcTL6a9xH52B6iMzE15IjQl+wwpaI7Bn/f14d7yuidDOsVbJ8
	20bw==
X-Gm-Message-State: AOPr4FWeYd2IbkPmOyX6Bf/VGaU40jLk40HhCV7YoJVR+GTWozXOKPl835g0qBCagRyNiQ==
X-Received: by 10.140.251.195 with SMTP id w186mr37349636qhc.32.1460879109136; 
	Sun, 17 Apr 2016 00:45:09 -0700 (PDT)
Received: from ix.home (pool-100-38-105-55.nycmny.fios.verizon.net.
	[100.38.105.55]) by smtp.gmail.com with ESMTPSA id
	z62sm24166727qka.26.2016.04.17.00.45.07
	(version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
	Sun, 17 Apr 2016 00:45:08 -0700 (PDT)
Content-Type: multipart/mixed;
	boundary="Apple-Mail=_78CF0AEE-4C5E-4C7D-9A38-0A4A9EB6AFC0"
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\))
Subject: Re: prevent seq from inflow inflow on I/O errors
From: Assaf Gordon <assafgordon@gmail.com>
In-Reply-To: <57037EDD.2020604@bernhard-voelker.de>
Date: Sun, 17 Apr 2016 03:45:05 -0400
Cc: Coreutils <coreutils@gnu.org>
Message-Id: <1BC925DA-15D0-4E54-BE80-92AD9D64C0E7@gmail.com>
References: <788E7E16-EFE1-47D0-96CD-A35FB080BBA6@gmail.com>
	<570256BD.7010302@draigBrady.com>
	<57037EDD.2020604@bernhard-voelker.de>
To: Bernhard Voelker <mail@bernhard-voelker.de>,
	=?utf-8?Q?P=C3=A1draig_Brady?= <P@draigBrady.com>
X-Mailer: Apple Mail (2.2102)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2607:f8b0:400d:c04::231
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 17 Apr 2016 07:45:14 -0000


--Apple-Mail=_78CF0AEE-4C5E-4C7D-9A38-0A4A9EB6AFC0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=windows-1252

Hello Bernhard, P=E1draig,

Attached an updated patch based on your comments and suggestions.
One difference from previous patch:
'seq' will not silently ignore EPIPE (if SIGPIPE is ignored by default), =
and will exit with 'broken pipe' message.
I split the tests into two: one with /dev/full (skipped unless /dev/full =
exists),
the other forcing a broken pipe (which can be tested anywhere).

comments welcomed,
thanks,
 - assaf



--Apple-Mail=_78CF0AEE-4C5E-4C7D-9A38-0A4A9EB6AFC0
Content-Disposition: attachment;
	filename=0001-seq-detect-and-report-I-O-errors-immediately.patch
Content-Type: application/octet-stream;
	name="0001-seq-detect-and-report-I-O-errors-immediately.patch"
Content-Transfer-Encoding: quoted-printable

=46rom=208e29cc911e8bd3267d1367444e3c4a829001fd4f=20Mon=20Sep=2017=20=
00:00:00=202001=0AFrom:=20Assaf=20Gordon=20<assafgordon@gmail.com>=0A=
Date:=20Sun,=2017=20Apr=202016=2002:28:13=20-0400=0ASubject:=20[PATCH]=20=
seq:=20detect=20and=20report=20I/O=20errors=20immediately=0A=0AEnsure=20=
I/O=20errors=20are=20detected=20(and=20terminate=20seq),=20preventing=20=
seq=0Afrom=20infloop=20(or=20running=20for=20long=20time=20with=20a=20=
large=0Arange)=20upon=20write=20errors=20or=20ignored=20SIGPIPE.=20=
Examples:=0A=0A=20=20=20=20=20seq=201=20inf=20>=20/dev/full=20=20=20=20=20=
=20=20=20=20=20=20=20=20(seq_fast)=0A=20=20=20=20=20seq=201.1=200.1=20=
inf=20>/dev/full=20=20=20=20=20=20=20=20(print_numbers)=0A=0A*=20=
src/seq.c=20(io_error):=20A=20new=20function=20to=20diagnose=20=
appropriate=0Astdio=20errors=20and=20exit=20the=20program=20with=20=
failure=20status.=0A(seq_fast,=20print_numbers):=20Explicitly=20check=20=
for=20write=20errors=0Aand=20terminate=20the=20program=20with=20=
diagnostic.=0A*=20tests/misc/seq-io-errors.sh:=20Test=20error=20=
detection=20with=20/dev/full.=0A*=20tests/misc/seq-epipe.sh:=20Test=20=
error=20detection=20with=20broken=20pipes.=0A*=20tests/local.mk:=20Add=20=
new=20tests.=0A*=20NEWS:=20Mention=20the=20fix.=0A---=0A=20NEWS=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20|=20=203=20=
+++=0A=20src/seq.c=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
|=2024=20++++++++++++++++++-----=0A=20tests/local.mk=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20|=20=202=20++=0A=20tests/misc/seq-epipe.sh=20=20=20=20=
=20|=2046=20+++++++++++++++++++++++++++++++++++++++++++++=0A=20=
tests/misc/seq-io-errors.sh=20|=2046=20=
+++++++++++++++++++++++++++++++++++++++++++++=0A=205=20files=20changed,=20=
116=20insertions(+),=205=20deletions(-)=0A=20create=20mode=20100755=20=
tests/misc/seq-epipe.sh=0A=20create=20mode=20100755=20=
tests/misc/seq-io-errors.sh=0A=0Adiff=20--git=20a/NEWS=20b/NEWS=0Aindex=20=
4cb5caf..e420716=20100644=0A---=20a/NEWS=0A+++=20b/NEWS=0A@@=20-15,6=20=
+15,9=20@@=20GNU=20coreutils=20NEWS=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20-*-=20=
outline=20-*-=0A=20=20=20=20stty=20--help=20no=20longer=20outputs=20=
extraneous=20gettext=20header=20lines=0A=20=20=20=20for=20translated=20=
languages.=20[bug=20introduced=20in=20coreutils-8.24]=0A=20=0A+=20=20=20=
seq=20now=20immediately=20exits=20upon=20write=20errors.=0A+=20=20=20=
[This=20bug=20was=20present=20in=20"the=20beginning".]=0A+=0A=20**=20=
Changes=20in=20behavior=0A=20=0A=20=20=20=20seq=20no=20longer=20accepts=20=
0=20value=20as=20increment,=20and=20now=20also=20rejects=20NaN=0Adiff=20=
--git=20a/src/seq.c=20b/src/seq.c=0Aindex=20de92bc2..1b9da40=20100644=0A=
---=20a/src/seq.c=0A+++=20b/src/seq.c=0A@@=20-278,6=20+278,15=20@@=20=
long_double_format=20(char=20const=20*fmt,=20struct=20layout=20*layout)=0A=
=20=20=20=20=20=20=20}=0A=20}=0A=20=0A+static=20void=20=
ATTRIBUTE_NORETURN=0A+io_error=20(void)=0A+{=0A+=20=20/*=20FIXME:=20=
consider=20option=20to=20silently=20ignore=20errno=3DEPIPE=20*/=0A+=20=20=
error=20(0,=20errno,=20_("standard=20output"));=0A+=20=20clearerr=20=
(stdout);=0A+=20=20exit=20(EXIT_FAILURE);=0A+}=0A+=0A=20/*=20Actually=20=
print=20the=20sequence=20of=20numbers=20in=20the=20specified=20range,=20=
with=20the=0A=20=20=20=20given=20or=20default=20stepping=20and=20format.=20=
=20*/=0A=20=0A@@=20-295,7=20+304,8=20@@=20print_numbers=20(char=20const=20=
*fmt,=20struct=20layout=20layout,=0A=20=20=20=20=20=20=20for=20(i=20=3D=20=
1;=20;=20i++)=0A=20=20=20=20=20=20=20=20=20{=0A=20=20=20=20=20=20=20=20=20=
=20=20long=20double=20x0=20=3D=20x;=0A-=20=20=20=20=20=20=20=20=20=20=
printf=20(fmt,=20x);=0A+=20=20=20=20=20=20=20=20=20=20if=20(printf=20=
(fmt,=20x)=20<=200)=0A+=20=20=20=20=20=20=20=20=20=20=20=20io_error=20=
();=0A=20=20=20=20=20=20=20=20=20=20=20if=20(out_of_range)=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20break;=0A=20=20=20=20=20=20=20=20=20=20=20x=20=
=3D=20first=20+=20i=20*=20step;=0A@@=20-336,10=20+346,12=20@@=20=
print_numbers=20(char=20const=20*fmt,=20struct=20layout=20layout,=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20break;=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20}=0A=20=0A-=20=20=20=20=20=20=20=20=20=20fputs=20=
(separator,=20stdout);=0A+=20=20=20=20=20=20=20=20=20=20if=20(fputs=20=
(separator,=20stdout)=20=3D=3D=20EOF)=0A+=20=20=20=20=20=20=20=20=20=20=20=
=20io_error=20();=0A=20=20=20=20=20=20=20=20=20}=0A=20=0A-=20=20=20=20=20=
=20fputs=20(terminator,=20stdout);=0A+=20=20=20=20=20=20if=20(fputs=20=
(terminator,=20stdout)=20=3D=3D=20EOF)=0A+=20=20=20=20=20=20=20=20=
io_error=20();=0A=20=20=20=20=20}=0A=20}=0A=20=0A@@=20-506,14=20+518,16=20=
@@=20seq_fast=20(char=20const=20*a,=20char=20const=20*b)=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20output=20buffer=20so=20far,=20and=20reset=20=
to=20start=20of=20buffer.=20=20*/=0A=20=20=20=20=20=20=20=20=20=20=20if=20=
(buf_end=20-=20(p_len=20+=201)=20<=20bufp)=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20{=0A-=20=20=20=20=20=20=20=20=20=20=20=20=20=20fwrite=20(buf,=20=
bufp=20-=20buf,=201,=20stdout);=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20if=20(fwrite=20(buf,=20bufp=20-=20buf,=201,=20stdout)=20!=3D=201)=0A+=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20io_error=20();=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20bufp=20=3D=20buf;=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20}=0A=20=20=20=20=20=20=20=20=20}=0A=20=0A=20=20=20=20=20=
=20=20/*=20Write=20any=20remaining=20buffered=20output,=20and=20the=20=
terminator.=20=20*/=0A=20=20=20=20=20=20=20*bufp++=20=3D=20*terminator;=0A=
-=20=20=20=20=20=20fwrite=20(buf,=20bufp=20-=20buf,=201,=20stdout);=0A+=20=
=20=20=20=20=20if=20(fwrite=20(buf,=20bufp=20-=20buf,=201,=20stdout)=20=
!=3D=201)=0A+=20=20=20=20=20=20=20=20io_error=20();=0A=20=0A=20=20=20=20=20=
=20=20IF_LINT=20(free=20(buf));=0A=20=20=20=20=20}=0Adiff=20--git=20=
a/tests/local.mk=20b/tests/local.mk=0Aindex=20a83c3d0..7bea2c3=20100644=0A=
---=20a/tests/local.mk=0A+++=20b/tests/local.mk=0A@@=20-235,6=20+235,8=20=
@@=20all_tests=20=3D=09=09=09=09=09\=0A=20=20=20tests/misc/ptx.pl=09=09=09=
=09\=0A=20=20=20tests/misc/test.pl=09=09=09=09\=0A=20=20=20=
tests/misc/seq.pl=09=09=09=09\=0A+=20=20tests/misc/seq-epipe.sh=09=09=09=
\=0A+=20=20tests/misc/seq-io-errors.sh=09=09=09\=0A=20=20=20=
tests/misc/seq-long-double.sh=09=09=09\=0A=20=20=20=
tests/misc/seq-precision.sh=09=09=09\=0A=20=20=20tests/misc/head.pl=09=09=
=09=09\=0Adiff=20--git=20a/tests/misc/seq-epipe.sh=20=
b/tests/misc/seq-epipe.sh=0Anew=20file=20mode=20100755=0Aindex=20=
0000000..21e9322=0A---=20/dev/null=0A+++=20b/tests/misc/seq-epipe.sh=0A=
@@=20-0,0=20+1,46=20@@=0A+#!/bin/sh=0A+#=20Test=20for=20proper=20=
detection=20of=20EPIPE=20with=20ignored=20SIGPIPE=0A+=0A+#=20Copyright=20=
(C)=202016=20Free=20Software=20Foundation,=20Inc.=0A+=0A+#=20This=20=
program=20is=20free=20software:=20you=20can=20redistribute=20it=20and/or=20=
modify=0A+#=20it=20under=20the=20terms=20of=20the=20GNU=20General=20=
Public=20License=20as=20published=20by=0A+#=20the=20Free=20Software=20=
Foundation,=20either=20version=203=20of=20the=20License,=20or=0A+#=20(at=20=
your=20option)=20any=20later=20version.=0A+=0A+#=20This=20program=20is=20=
distributed=20in=20the=20hope=20that=20it=20will=20be=20useful,=0A+#=20=
but=20WITHOUT=20ANY=20WARRANTY;=20without=20even=20the=20implied=20=
warranty=20of=0A+#=20MERCHANTABILITY=20or=20FITNESS=20FOR=20A=20=
PARTICULAR=20PURPOSE.=20=20See=20the=0A+#=20GNU=20General=20Public=20=
License=20for=20more=20details.=0A+=0A+#=20You=20should=20have=20=
received=20a=20copy=20of=20the=20GNU=20General=20Public=20License=0A+#=20=
along=20with=20this=20program.=20=20If=20not,=20see=20=
<http://www.gnu.org/licenses/>.=0A+=0A+.=20"${srcdir=3D.}/tests/init.sh";=20=
path_prepend_=20./src=0A+print_ver_=20seq=0A+=0A+#=20upon=20EPIPE=20with=20=
signals=20ignored,=20'seq'=20should=20exit=20with=20an=20error.=0A+(trap=20=
''=20PIPE;=0A+=20timeout=2010=20sh=20-c=20'(=20(seq=20inf=202>err=20;=20=
echo=20$?>code)=20|=20head=20-n1)'>/dev/null)=0A+=0A+#=20Exit-code=20=
must=20be=201,=20indicating=20'write=20error'=0A+cat=20<<=20\EOF=20>=20=
exp=20||=20framework_failure_=0A+1=0A+EOF=0A+if=20test=20-e=20code=20;=20=
then=0A+=20=20compare=20exp=20code=20||=20fail=3D1=0A+else=0A+=20=20#=20=
'exitcode'=20file=20was=20not=20created=0A+=20=20warn_=20"missing=20exit=20=
code=20file=20(seq=20failed=20to=20detect=20EPIPE?)"=0A+=20=20fail=3D1=0A=
+fi=0A+=0A+#=20The=20error=20message=20must=20begin=20with=20"standard=20=
output:"=0A+#=20(but=20don't=20hard-code=20the=20strerror=20text)=0A=
+compare_dev_null_=20/dev/null=20err=0A+if=20!=20grep=20-qE=20'^seq:=20=
standard=20output:=20.+$'=20err=20;=20then=0A+=20=20warn_=20"seq=20=
emitted=20incorrect=20error=20on=20EPIPE"=0A+=20=20fail=3D1=0A+fi=0A+=0A=
+Exit=20$fail=0Adiff=20--git=20a/tests/misc/seq-io-errors.sh=20=
b/tests/misc/seq-io-errors.sh=0Anew=20file=20mode=20100755=0Aindex=20=
0000000..8007187=0A---=20/dev/null=0A+++=20b/tests/misc/seq-io-errors.sh=0A=
@@=20-0,0=20+1,46=20@@=0A+#!/bin/sh=0A+#=20Test=20for=20proper=20=
detection=20of=20I/O=20errors=20in=20seq=0A+=0A+#=20Copyright=20(C)=20=
2016=20Free=20Software=20Foundation,=20Inc.=0A+=0A+#=20This=20program=20=
is=20free=20software:=20you=20can=20redistribute=20it=20and/or=20modify=0A=
+#=20it=20under=20the=20terms=20of=20the=20GNU=20General=20Public=20=
License=20as=20published=20by=0A+#=20the=20Free=20Software=20Foundation,=20=
either=20version=203=20of=20the=20License,=20or=0A+#=20(at=20your=20=
option)=20any=20later=20version.=0A+=0A+#=20This=20program=20is=20=
distributed=20in=20the=20hope=20that=20it=20will=20be=20useful,=0A+#=20=
but=20WITHOUT=20ANY=20WARRANTY;=20without=20even=20the=20implied=20=
warranty=20of=0A+#=20MERCHANTABILITY=20or=20FITNESS=20FOR=20A=20=
PARTICULAR=20PURPOSE.=20=20See=20the=0A+#=20GNU=20General=20Public=20=
License=20for=20more=20details.=0A+=0A+#=20You=20should=20have=20=
received=20a=20copy=20of=20the=20GNU=20General=20Public=20License=0A+#=20=
along=20with=20this=20program.=20=20If=20not,=20see=20=
<http://www.gnu.org/licenses/>.=0A+=0A+.=20"${srcdir=3D.}/tests/init.sh";=20=
path_prepend_=20./src=0A+print_ver_=20seq=0A+=0A+if=20!=20test=20-w=20=
/dev/full=20||=20!=20test=20-c=20/dev/full;=20then=0A+=20=20skip_=20=
'/dev/full=20is=20required'=0A+fi=0A+=0A+#=20Run=20'seq'=20with=20a=20=
timeout,=20preventing=20infinite-loop=20run.=0A+#=20expected=20returned=20=
codes:=0A+#=20=201=20=20=20=20=20-=20seq=20detected=20an=20I/O=20error=20=
and=20exited=20with=20an=20error.=0A+#=20=20124=20=20=20-=20timed-out=20=
(seq=20likely=20infloop)=0A+#=20=20other=20-=20unexpected=20error=0A=
+timed_seq_fail()=20{=20timeout=2010=20seq=20"$@"=20>/dev/full=20=
2>/dev/null;=20}=0A+=0A+=0A+#=20Test=20infinite=20sequence,=20using=20=
fast-path=20method=20(seq_fast).=0A+returns_=201=20timed_seq_fail=201=20=
inf=20||=20fail=3D1=0A+=0A+#=20Test=20infinite=20sequence,=20using=20=
slow-path=20method=20(print_numbers).=0A+returns_=201=20timed_seq_fail=20=
1.1=20.1=20inf=20||=20fail=3D1=0A+=0A+#=20Test=20non-infinite=20=
sequence,=20using=20slow-path=20method=20(print_numbers).=0A+#=20=
(despite=20being=20non-infinite,=20the=20entire=20sequence=20should=20=
take=20long=20time=20to=0A+#=20=20print.=20Thus,=20either=20an=20I/O=20=
error=20is=20detected=20immediately,=20or=20seq=20will=0A+#=20=20=
timeout).=0A+returns_=201=20timed_seq_fail=201=200.0001=2099999999=20||=20=
fail=3D1=0A+=0A+Exit=20$fail=0A--=20=0A2.7.0=0A=0A=

--Apple-Mail=_78CF0AEE-4C5E-4C7D-9A38-0A4A9EB6AFC0--


From MAILER-DAEMON Sun Apr 17 06:52:25 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1arkJV-0005pd-2k
	for mharc-coreutils@gnu.org; Sun, 17 Apr 2016 06:52:25 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:42696)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1arkJT-0005nq-9f
	for coreutils@gnu.org; Sun, 17 Apr 2016 06:52:24 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1arkJQ-0005td-47
	for coreutils@gnu.org; Sun, 17 Apr 2016 06:52:23 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:58140)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1arkJP-0005sg-VN
	for coreutils@gnu.org; Sun, 17 Apr 2016 06:52:20 -0400
Received: from [192.168.1.80] (unknown [109.76.250.144])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 3F5BE160;
	Sun, 17 Apr 2016 11:52:18 +0100 (IST)
Subject: Re: prevent seq from inflow inflow on I/O errors
To: Assaf Gordon <assafgordon@gmail.com>,
	Bernhard Voelker <mail@bernhard-voelker.de>
References: <788E7E16-EFE1-47D0-96CD-A35FB080BBA6@gmail.com>
	<570256BD.7010302@draigBrady.com>
	<57037EDD.2020604@bernhard-voelker.de>
	<1BC925DA-15D0-4E54-BE80-92AD9D64C0E7@gmail.com>
Cc: Coreutils <coreutils@gnu.org>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <57136AE1.6070007@draigBrady.com>
Date: Sun, 17 Apr 2016 11:52:17 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <1BC925DA-15D0-4E54-BE80-92AD9D64C0E7@gmail.com>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 82.195.144.49
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 17 Apr 2016 10:52:24 -0000

On 17/04/16 08:45, Assaf Gordon wrote:
> Hello Bernhard, P=E1draig,
>
> Attached an updated patch based on your comments and suggestions.
> One difference from previous patch:
> 'seq' will not silently ignore EPIPE (if SIGPIPE is ignored by default)=
, and will exit with 'broken pipe' message.
> I split the tests into two: one with /dev/full (skipped unless /dev/ful=
l exists),
> the other forcing a broken pipe (which can be tested anywhere).

Yes it's better not to change the EPIPE handling
so we're consistent with other utils.
That might be a change we consider separately.

Your patch looks good.

please push.

thanks!
P=E1draig



From MAILER-DAEMON Sun Apr 17 07:27:52 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1arkro-00005P-4I
	for mharc-coreutils@gnu.org; Sun, 17 Apr 2016 07:27:52 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:47834)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1arkrk-0008Pj-Nn
	for coreutils@gnu.org; Sun, 17 Apr 2016 07:27:49 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1arkrg-0005Pk-NM
	for coreutils@gnu.org; Sun, 17 Apr 2016 07:27:48 -0400
Received: from mout.kundenserver.de ([212.227.126.187]:57587)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1arkrg-0005Pg-Dn
	for coreutils@gnu.org; Sun, 17 Apr 2016 07:27:44 -0400
Received: from blackice.site ([217.86.64.216]) by mrelayeu.kundenserver.de
	(mreue003) with ESMTPSA (Nemesis) id 0LxKfu-1bocq42vTW-016zsR;
	Sun, 17 Apr 2016 13:27:42 +0200
From: Bernhard Voelker <mail@bernhard-voelker.de>
To: coreutils@gnu.org
Cc: Bernhard Voelker <mail@bernhard-voelker.de>
Subject: [PATCH] tests: let mkdir/p-v.sh fail when compare fails
Date: Sun, 17 Apr 2016 13:27:14 +0200
Message-Id: <1460892434-24472-1-git-send-email-mail@bernhard-voelker.de>
X-Mailer: git-send-email 2.1.4
X-Provags-ID: V03:K0:xm4KStIbP40vHSArks+sK3m1BaoL+uTHSmcnGMEdn9gVWS9bTW1
	swfG4FF2x5Dhsr9ZHf/Cwj4Wb2/kOOTkhS5iXMRhEI0EB3f2ltDvgiFBceLOcc2IyD5iMR8
	hgOFB5J6+KfYj3NHnjM8BpTDOir8Au0PMcskG1q4ijJvSSK0xv18oPP747Ay4OovNpveTe2
	U4SRANZ92wzYdzrx5s94Q==
X-UI-Out-Filterresults: notjunk:1;V01:K0:MPvDc/R9oW8=:f8HgUaDPOhCSg1vFoOIOEr
	xVycpdiEm5Zr33OUVy4Iy4ARCFAw9poHxW4DPQIoNhB2+g03aYxWmlqhMYBvecwl0lB8atPzq
	jlDjrcAUZcermpTlh5pDXE8YUx2wBE18PLzLCRwdx7jHGA4OU6YByEOmYx7Mrhf/eKV+QL/Xy
	WyyvobruhljeOw1Ic1yIp6h89NgLKrsFdyT1gPXxHlt1vxYvcrLtcGuga/MAncmOldj0m6W4w
	05ye09CuU4tTpiabQyl0OneEinrINqsSjBRJU1F7doAfRdF6VUi6F0UXgl6Mp6/ai2WMZo4Vo
	DFB/rNUvwe74k2b0WEVuDRcNF0rxfsFUmslwfLcBbrEIVvAsA0ggsCC/Zd2cM3ROFTVW8toN3
	JOh0dYtSU5tethBmz129dPZSZN+sB3Wlf8pcC3u0J5VRSG8sMsmOH6Qy/02Dv21pYk17ARSaw
	eehp1N0JBuPCHZ9k46tQ/FAEBJ3L6Ne3BODZBpfL+PwYrQKI1BToYKnRzx9p1yANSmY9s03ZY
	nPtRuoiR77PduJc1Z5XmMGGM0A9oPWod3HaW24ALCYOIq1IXidstMqJkeqGePUIKDnvHDdMgx
	OjRRBuP+p+agBsNkEpz2sFD3uCjTzycZUa/02yH1Nu357wz2s1m4znHeD6cUaZZf+KMk5D798
	MmRAsC/oZh3OgVcTpOrLcE7qRIoc6FNM6xBJyeQXEDYPbSOycw7D06kxk3Y+jQcv4LGI=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 212.227.126.187
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 17 Apr 2016 11:27:49 -0000

* tests/mkdir/p-v.sh: Set fail=1 when compare fails: the latter only
sets a non-Zero return code; evaluating that is up to the caller.
---
 tests/mkdir/p-v.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/mkdir/p-v.sh b/tests/mkdir/p-v.sh
index 3b5a136..0a9004b 100755
--- a/tests/mkdir/p-v.sh
+++ b/tests/mkdir/p-v.sh
@@ -21,7 +21,7 @@ print_ver_ mkdir
 
 mkdir -pv foo/a/b/c/d >out || fail=1
 
-compare - out <<\EOF
+compare - out <<\EOF || fail=1
 mkdir: created directory 'foo'
 mkdir: created directory 'foo/a'
 mkdir: created directory 'foo/a/b'
-- 
2.1.4



From MAILER-DAEMON Wed Apr 20 12:00:29 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1asuYH-0000Aa-Gh
	for mharc-coreutils@gnu.org; Wed, 20 Apr 2016 12:00:29 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:36289)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigbrady.com>) id 1asuYE-0008Nr-Ms
	for coreutils@gnu.org; Wed, 20 Apr 2016 12:00:27 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigbrady.com>) id 1asuYA-0003Ij-Fh
	for coreutils@gnu.org; Wed, 20 Apr 2016 12:00:26 -0400
Received: from mail2.vodafone.ie ([213.233.128.44]:56921)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigbrady.com>) id 1asuYA-0003IQ-AY
	for coreutils@gnu.org; Wed, 20 Apr 2016 12:00:22 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Aj4LAKOmF1dtT9h2/2dsb2JhbABegzgeBDF9sh2FQYQOFweFcIFHTAEBAQEBAWYnhEQWZyiBS4gLoy6bT4UpiCGEKQtAgkMFh3EDhxGJCoV7iBuCMocchT4Cjy1igTYBAQhEGoFLOzCIRwEBAQ
Received: from unknown (HELO lt.localdomain) ([109.79.216.118])
	by mail2.vodafone.ie with ESMTP; 20 Apr 2016 17:00:19 +0100
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
To: coreutils@gnu.org
Subject: [PATCH] tests: avoid potential overflows with `expr`
Date: Wed, 20 Apr 2016 17:00:09 +0100
Message-Id: <1461168009-1998-1-git-send-email-P@draigBrady.com>
X-Mailer: git-send-email 2.5.5
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 213.233.128.44
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Apr 2016 16:00:27 -0000

* cfg.mk (sc_prohibit_expr_unsigned): expr uses intmax_t internally
when GMP is not available, so flag any uses of unsigned limits.
* tests/misc/timeout-parameters.sh: Remove the overflow related
to UINT_MAX as it's handled by the following case.  Change the
following case from 99... to $TIME_T_OFLOW to be more expressive
in what it's actually testing.  Directly check that commands succeed,
rather than inspecting $? afterwards.
* tests/dd/skip-seek-past-dev.sh: Guard against large device sizes.
* tests/id/setgid.sh: Protect: Guard against large group IDs.
* tests/misc/cut-huge-range.sh: Tweak comment to avoid syntax check.
It's tempting to simplify to just skip the test if expr fails,
but SIZE_MAX > INTMAX_MAX is the common case.
---
 cfg.mk                           |  8 ++++++++
 tests/dd/skip-seek-past-dev.sh   |  3 ++-
 tests/id/setgid.sh               |  4 +++-
 tests/misc/cut-huge-range.sh     |  3 ++-
 tests/misc/timeout-parameters.sh | 19 ++++++-------------
 5 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index 6ef09dd..c917c87 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -568,6 +568,14 @@ sc_prohibit_test_empty:
 	halt='use `compare /dev/null ...`, not `test -s ...` in tests/'	\
 	  $(_sc_search_regexp)
 
+# Ensure that expr doesn't work directly on various unsigned int types,
+# as that's not generally supported without GMP.
+sc_prohibit_expr_unsigned:
+	@prohibit='expr .*(UINT|ULONG|[^S]SIZE|[UGP]ID|UINTMAX)'	\
+	halt='avoid passing unsigned limits to `expr` (without GMP)'	\
+	in_vc_files='^tests/'						\
+	  $(_sc_search_regexp)
+
 # Programs like sort, ls, expr use PROG_FAILURE in place of EXIT_FAILURE.
 # Others, use the EXIT_CANCELED, EXIT_ENOENT, etc. macros defined in system.h.
 # In those programs, ensure that EXIT_FAILURE is not used by mistake.
diff --git a/tests/dd/skip-seek-past-dev.sh b/tests/dd/skip-seek-past-dev.sh
index c24bbb7..2174985 100755
--- a/tests/dd/skip-seek-past-dev.sh
+++ b/tests/dd/skip-seek-past-dev.sh
@@ -39,7 +39,8 @@ dev_size=$(get_device_size "$device") ||
   skip_ "failed to determine size of $device"
 
 # Don't use shell arithmetic as older versions of dash use longs
-DEV_OFLOW=$(expr $dev_size + 1)
+DEV_OFLOW=$(expr $dev_size + 1) ||
+  skip_ "failed to adjust device size $dev_size"
 
 timeout 10 dd bs=1 skip=$DEV_OFLOW count=0 status=noxfer < "$device" 2> err
 test "$?" = "1" || fail=1
diff --git a/tests/id/setgid.sh b/tests/id/setgid.sh
index ea0db85..f2beeed 100755
--- a/tests/id/setgid.sh
+++ b/tests/id/setgid.sh
@@ -21,7 +21,9 @@ print_ver_ id
 require_root_
 
 # Construct a different group number
-gp1=$(expr $NON_ROOT_GID + 1)
+gp1=$NON_ROOT_GID
+gp1=$(expr $gp1 + 1) ||
+  skip_ "failed to adjust GID $NON_ROOT_GID"
 
 echo $gp1 > exp || framework_failure_
 
diff --git a/tests/misc/cut-huge-range.sh b/tests/misc/cut-huge-range.sh
index 92b62a9..2b8b703 100755
--- a/tests/misc/cut-huge-range.sh
+++ b/tests/misc/cut-huge-range.sh
@@ -46,7 +46,8 @@ subtract_one='
 # Ensure we can cut up to our sentinel value.
 # This is currently SIZE_MAX, but could be raised to UINTMAX_MAX
 # if we didn't allocate memory for each line as a unit.
-# Don't use expr to subtract one, since SIZE_MAX may exceed its maximum value.
+# Don't use expr to subtract one,
+# since SIZE_MAX may exceed its maximum value.
 CUT_MAX=$(echo $SIZE_MAX | sed "$subtract_one")
 
 # From coreutils-8.10 through 8.20, this would make cut try to allocate
diff --git a/tests/misc/timeout-parameters.sh b/tests/misc/timeout-parameters.sh
index 881e60d..14c9b66 100755
--- a/tests/misc/timeout-parameters.sh
+++ b/tests/misc/timeout-parameters.sh
@@ -38,29 +38,22 @@ test $? = 125 || fail=1
 # It was seen on 32 bit Linux/HPPA that a kernel time_t overflowed,
 # thus causing the timer to fire immediately.
 # So verify that doesn't happen before checking large timeouts
-KERNEL_OVERFLOW_LIMIT=$(expr $TIME_T_MAX - $(date +%s) + 100)
+KERNEL_OVERFLOW_LIMIT=$(expr $TIME_T_MAX - $(date +%s) + 100) ||
+  skip_ "failed to adjust TIME_T_MAX $TIME_T_MAX"
 timeout $KERNEL_OVERFLOW_LIMIT sleep 0
 if test $? != 124; then
   # timeout overflow
-  timeout $UINT_OFLOW sleep 0
-  test $? = 0 || fail=1
+  timeout $UINT_OFLOW sleep 0 || fail=1
 
   # timeout overflow
-  timeout $(expr $UINT_MAX / 86400 + 1)d sleep 0
-  test $? = 0 || fail=1
-
-  # timeout overflow
-  timeout 999999999999999999999999999999999999999999999999999999999999d sleep 0
-  test $? = 0 || fail=1
+  timeout ${TIME_T_OFLOW}d sleep 0 || fail=1
 
   # floating point notation
-  timeout 2.34e+5d sleep 0
-  test $? = 0 || fail=1
+  timeout 2.34e+5d sleep 0 || fail=1
 fi
 
 # floating point notation
-timeout 2.34 sleep 0
-test $? = 0 || fail=1
+timeout 2.34 sleep 0 || fail=1
 
 # nanoseconds potentially supported
 timeout .999999999 sleep 0 || fail=1
-- 
2.5.5



From MAILER-DAEMON Wed Apr 20 12:12:22 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1asujm-0004Jo-28
	for mharc-coreutils@gnu.org; Wed, 20 Apr 2016 12:12:22 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:40182)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigbrady.com>) id 1asujj-0004Ep-B0
	for coreutils@gnu.org; Wed, 20 Apr 2016 12:12:20 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigbrady.com>) id 1asujf-0006jM-CN
	for coreutils@gnu.org; Wed, 20 Apr 2016 12:12:19 -0400
Received: from mail2.vodafone.ie ([213.233.128.44]:45024)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigbrady.com>) id 1asujf-0006iJ-0m
	for coreutils@gnu.org; Wed, 20 Apr 2016 12:12:15 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AjwLAAGpF1dtT9h2/2dsb2JhbABegzgeBDF9t16EDhcHhXCBSEwBAQEBAQFmJ4REFmcogUuIC6Mtm0+FKYpOgXwLQIJDBZgPhXuIG4Fkh2oMhTICjy1igTYBAQhEGoFLOzCIRwEBAQ
Received: from unknown (HELO lt.localdomain) ([109.79.216.118])
	by mail2.vodafone.ie with ESMTP; 20 Apr 2016 17:12:12 +0100
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
To: coreutils@gnu.org
Subject: [PATCH] tests: fix recent false failure due to a race
Date: Wed, 20 Apr 2016 17:12:08 +0100
Message-Id: <1461168728-3963-1-git-send-email-P@draigBrady.com>
X-Mailer: git-send-email 2.5.5
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 213.233.128.44
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Apr 2016 16:12:20 -0000

* tests/cp/parent-perm-race.sh: This new race introduced in
commit v8.25-5-g632eda5 is quite hard to hit, but is due to
`ls > fifo` doing write()/close()/exit() once `cp` has
open() the source fifo.  Then the subsequent comparison of the
destination file may fail due to the file being missing or empty.
Previously `ls` generated output that was independent of `cp`.
Now we must wait for `cp` to finish before inspecting the
destination file that it wrote.
---
 tests/cp/parent-perm-race.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/cp/parent-perm-race.sh b/tests/cp/parent-perm-race.sh
index 0d0841c..8d09329 100755
--- a/tests/cp/parent-perm-race.sh
+++ b/tests/cp/parent-perm-race.sh
@@ -43,6 +43,8 @@ do
   # $d/attr and has started to read the source file $attr/fifo.
   timeout 10 sh -c "ls -ld d/$attr >$attr/fifo" || fail=1
 
+  wait $pid || fail=1
+
   ls_output=$(cat d/$attr/fifo) || fail=1
   case $attr,$ls_output in
   ownership,d???--[-S]--[-S]* | \
@@ -52,8 +54,6 @@ do
   *)
     fail=1;;
   esac
-
-  wait $pid || fail=1
 done
 
 Exit $fail
-- 
2.5.5



From MAILER-DAEMON Wed Apr 20 13:31:51 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1asvyh-0007wX-Ou
	for mharc-coreutils@gnu.org; Wed, 20 Apr 2016 13:31:51 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:59519)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigbrady.com>) id 1asvye-0007rX-Ux
	for coreutils@gnu.org; Wed, 20 Apr 2016 13:31:50 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigbrady.com>) id 1asvya-0002Zr-T1
	for coreutils@gnu.org; Wed, 20 Apr 2016 13:31:48 -0400
Received: from mail2.vodafone.ie ([213.233.128.44]:29808)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigbrady.com>) id 1asvya-0002XU-Kh
	for coreutils@gnu.org; Wed, 20 Apr 2016 13:31:44 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: Aj4KAPG7F1dtT9h2/2dsb2JhbABegzkeBDF9gnOvK4VBhA8XB4JAgzCBTUwBAQEBAQFmJ4REFmcogTIZiAyjSJsoKoUpjEoLQIJDBYd0j1dEhXuIG4IyhxyFPgKHY4dKYoE2AYIyOzCHDCWBFgEBAQ
Received: from unknown (HELO lt.localdomain) ([109.79.216.118])
	by mail2.vodafone.ie with ESMTP; 20 Apr 2016 18:31:41 +0100
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
To: coreutils@gnu.org
Subject: [PATCH] sleep,timeout: support overflowing floating point values
Date: Wed, 20 Apr 2016 18:31:39 +0100
Message-Id: <1461173499-32531-1-git-send-email-P@draigBrady.com>
X-Mailer: git-send-email 2.5.5
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 213.233.128.44
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Apr 2016 17:31:50 -0000

* src/sleep.c (main): Allow ERANGE since we allow "inf" values.
* src/timeout.c (parse_duration): Likewise.
* tests/misc/sleep.sh: New file. Tests for sleep(1).
* tests/misc/timeout-parameters.sh: Add case for newly allowed
$LDBL_MAX.  Also use returns_ throughout the file.  Also avoid
small timeout values which might give false failures under load.
---
 src/sleep.c                      |  2 +-
 src/timeout.c                    |  2 +-
 tests/local.mk                   |  1 +
 tests/misc/sleep.sh              | 38 ++++++++++++++++++++++++++++++++++++++
 tests/misc/timeout-parameters.sh | 26 ++++++++++++--------------
 5 files changed, 53 insertions(+), 16 deletions(-)
 create mode 100755 tests/misc/sleep.sh

diff --git a/src/sleep.c b/src/sleep.c
index a865c76..acee3bb 100644
--- a/src/sleep.c
+++ b/src/sleep.c
@@ -124,7 +124,7 @@ main (int argc, char **argv)
     {
       double s;
       const char *p;
-      if (! xstrtod (argv[i], &p, &s, c_strtod)
+      if (! (xstrtod (argv[i], &p, &s, c_strtod) || errno == ERANGE)
           /* Nonnegative interval.  */
           || ! (0 <= s)
           /* No extra chars after the number and an optional s,m,h,d char.  */
diff --git a/src/timeout.c b/src/timeout.c
index 9c31df5..462ef6b 100644
--- a/src/timeout.c
+++ b/src/timeout.c
@@ -314,7 +314,7 @@ parse_duration (const char* str)
   double duration;
   const char *ep;
 
-  if (!xstrtod (str, &ep, &duration, c_strtod)
+  if (! (xstrtod (str, &ep, &duration, c_strtod) || errno == ERANGE)
       /* Nonnegative interval.  */
       || ! (0 <= duration)
       /* No extra chars after the number and an optional s,m,h,d char.  */
diff --git a/tests/local.mk b/tests/local.mk
index a83c3d0..424f460 100644
--- a/tests/local.mk
+++ b/tests/local.mk
@@ -333,6 +333,7 @@ all_tests =					\
   tests/misc/shred-size.sh			\
   tests/misc/shuf.sh				\
   tests/misc/shuf-reservoir.sh			\
+  tests/misc/sleep.sh				\
   tests/misc/sort.pl				\
   tests/misc/sort-benchmark-random.sh		\
   tests/misc/sort-compress.sh			\
diff --git a/tests/misc/sleep.sh b/tests/misc/sleep.sh
new file mode 100755
index 0000000..38d6913
--- /dev/null
+++ b/tests/misc/sleep.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+# Validate sleep parameters
+
+# Copyright (C) 2016 Free Software Foundation, Inc.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
+print_ver_ sleep
+getlimits_
+
+# invalid timeouts
+returns_ 1 timeout 10 sleep invalid || fail=1
+returns_ 1 timeout 10 sleep -- -1 || fail=1
+returns_ 1 timeout 10 sleep 42D || fail=1
+returns_ 1 timeout 10 sleep 42d 42D || fail=1
+
+# subsecond actual sleep
+timeout 10 sleep 0.001 || fail=1
+
+# Small timeouts for larger sleeps racy,
+# but false positives should be avoided on most systems
+returns_ 124 timeout 0.1 sleep 1d 2h 3s 4m || fail=1
+returns_ 124 timeout 0.1 sleep inf || fail=1
+returns_ 124 timeout 0.1 sleep $LDBL_MAX || fail=1
+
+Exit $fail
diff --git a/tests/misc/timeout-parameters.sh b/tests/misc/timeout-parameters.sh
index 14c9b66..28e7c15 100755
--- a/tests/misc/timeout-parameters.sh
+++ b/tests/misc/timeout-parameters.sh
@@ -24,16 +24,13 @@ getlimits_
 # internal errors are 125, distinct from execution failure
 
 # invalid timeout
-timeout invalid sleep 0
-test $? = 125 || fail=1
+returns_ 125 timeout invalid sleep 0 || fail=1
 
 # invalid kill delay
-timeout --kill-after=invalid 1 sleep 0
-test $? = 125 || fail=1
+returns_ 125 timeout --kill-after=invalid 1 sleep 0 || fail=1
 
 # invalid timeout suffix
-timeout 42D sleep 0
-test $? = 125 || fail=1
+returns_ 125 timeout 42D sleep 0 || fail=1
 
 # It was seen on 32 bit Linux/HPPA that a kernel time_t overflowed,
 # thus causing the timer to fire immediately.
@@ -50,24 +47,25 @@ if test $? != 124; then
 
   # floating point notation
   timeout 2.34e+5d sleep 0 || fail=1
+
+  # floating point overflow
+  timeout $LDBL_MAX sleep 0 || fail=1
+  returns_ 125 timeout -- -$LDBL_MAX sleep 0 || fail=1
 fi
 
 # floating point notation
-timeout 2.34 sleep 0 || fail=1
+timeout 10.34 sleep 0 || fail=1
 
 # nanoseconds potentially supported
-timeout .999999999 sleep 0 || fail=1
+timeout 9.999999999 sleep 0 || fail=1
 
 # invalid signal spec
-timeout --signal=invalid 1 sleep 0
-test $? = 125 || fail=1
+returns_ 125 timeout --signal=invalid 1 sleep 0 || fail=1
 
 # invalid command
-timeout 10 .
-test $? = 126 || fail=1
+returns_ 126 timeout 10 . || fail=1
 
 # no such command
-timeout 10 no_such
-test $? = 127 || fail=1
+returns_ 127 timeout 10 no_such || fail=1
 
 Exit $fail
-- 
2.5.5



From MAILER-DAEMON Wed Apr 20 18:21:47 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1at0VH-00058s-MN
	for mharc-coreutils@gnu.org; Wed, 20 Apr 2016 18:21:47 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:45003)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1at0VF-00054v-Fr
	for coreutils@gnu.org; Wed, 20 Apr 2016 18:21:46 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1at0VA-0003H7-GJ
	for coreutils@gnu.org; Wed, 20 Apr 2016 18:21:45 -0400
Received: from mout.kundenserver.de ([212.227.126.187]:64163)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1at0VA-0003H3-75
	for coreutils@gnu.org; Wed, 20 Apr 2016 18:21:40 -0400
Received: from [192.168.101.10] ([217.86.64.216]) by mrelayeu.kundenserver.de
	(mreue004) with ESMTPSA (Nemesis) id 0LpiwE-1bPcE223uA-00fO9R;
	Thu, 21 Apr 2016 00:21:36 +0200
Subject: Re: [PATCH] tests: fix recent false failure due to a race
To: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>, coreutils@gnu.org
References: <1461168728-3963-1-git-send-email-P@draigBrady.com>
From: Bernhard Voelker <mail@bernhard-voelker.de>
Message-ID: <571800EF.1050401@bernhard-voelker.de>
Date: Thu, 21 Apr 2016 00:21:35 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.6.0
MIME-Version: 1.0
In-Reply-To: <1461168728-3963-1-git-send-email-P@draigBrady.com>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 8bit
X-Provags-ID: V03:K0:vq92LfRJk9mNgyL1T0FNlQzxT5TNestsWf6cCSciqq2V0ipSox7
	fdrObsp5ZqFYOpjoBMGudJ7WKDZkuj8+2z44zCDHp0Ga1IeCc33KPjzZnNZb80AvmsX3zX7
	kL+rwlH8vNIHhExjZU99nqrRwLXfhA4TgI6uT+xEvzK9KvmEMdeElInWamtbshTH5Ky4eK5
	YBI55XeaL9nChnVjjTR/w==
X-UI-Out-Filterresults: notjunk:1;V01:K0:XnyUivkqlEY=:52srOTo6sgQS591+oyLdqO
	ax8vDZFAcvGJ4Pyswm2rL6LkYME6m55MB4gGUgK9hMHJAaW9EExE4fbpWdJzOJjGLykk4ZBWG
	xErdVLcU/msn72GbuxW8zMl0lBJtecfuAFnXaeF03WpiQzCWn/WeUKUgyW7KTTYpAkEHgHKAi
	wuc0UAd8SfljgtF8XOJCp9Pi9tbCislMN5X8b1PgI5eja1+7oSld5Ng+1rAxWd8gb5OqWcuLf
	BYySd5UwzhCLmpHkaEhZCb1NgrAUq3GPXfLJLttwsOui+V1id2m2GXu5wDg9aJiuqVteiHaYU
	JjJaR0Fxs+336E0bZaHTgJhdPeDEQ9D9RNeQzmIUQgByDeuhdIHmZ5AxpEB/9N8XEhZzIRMPa
	6Y0S0TDXWSLqd0Ftn/+DoILQJ33ImI8Svy3THI+RicVSpm3l41AYgqCI03r4hJ7GhY6/5tXxp
	yNytE0NViFjLwd82bsWxBfdWzjbwSLtEb408UIvBJRpwWF93NV/Yps/9CTfUCjWinvR5rFaju
	vSIxEdLLzhGPrhNZhkXeRng3jRruwKPMbq3gEFa6Ky+cS1KQ3qdBICNOiDp+x0NJA3NljENCi
	xrYExFfvokEtimgU03EDIDIlMMHL78OxjjrZ7jjoiJC1mtlFKA6vda2+8Nv20op0bRSjbE6kb
	njHBMOkbaRID+4dIqtlBOGQ5IUe7WHcBDZOvwX6RnUesXQld5TdUYpag3yDiPtRvciC7CAG1V
	LRyCiGyRqIHCpaM/
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 212.227.126.187
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Apr 2016 22:21:46 -0000

On 04/20/2016 06:12 PM, Pádraig Brady wrote:
> * tests/cp/parent-perm-race.sh: This new race introduced in
> commit v8.25-5-g632eda5 is quite hard to hit, but is due to
> `ls > fifo` doing write()/close()/exit() once `cp` has
> open() the source fifo.  Then the subsequent comparison of the
> destination file may fail due to the file being missing or empty.
> Previously `ls` generated output that was independent of `cp`.
> Now we must wait for `cp` to finish before inspecting the
> destination file that it wrote.
> ---
>  tests/cp/parent-perm-race.sh | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/cp/parent-perm-race.sh b/tests/cp/parent-perm-race.sh
> index 0d0841c..8d09329 100755
> --- a/tests/cp/parent-perm-race.sh
> +++ b/tests/cp/parent-perm-race.sh
> @@ -43,6 +43,8 @@ do
>    # $d/attr and has started to read the source file $attr/fifo.
>    timeout 10 sh -c "ls -ld d/$attr >$attr/fifo" || fail=1
>  
> +  wait $pid || fail=1
> +
>    ls_output=$(cat d/$attr/fifo) || fail=1
>    case $attr,$ls_output in
>    ownership,d???--[-S]--[-S]* | \
> @@ -52,8 +54,6 @@ do
>    *)
>      fail=1;;
>    esac
> -
> -  wait $pid || fail=1
>  done
>  
>  Exit $fail
> 

Nice one! ... and a good analysis:
+1

Thanks & have a nice day,
Berny


From MAILER-DAEMON Wed Apr 20 18:57:15 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1at13b-0002gC-Kt
	for mharc-coreutils@gnu.org; Wed, 20 Apr 2016 18:57:15 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:53067)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1at13Y-0002d4-Mj
	for coreutils@gnu.org; Wed, 20 Apr 2016 18:57:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1at13T-0003Xh-K8
	for coreutils@gnu.org; Wed, 20 Apr 2016 18:57:12 -0400
Received: from mout.kundenserver.de ([212.227.126.135]:63551)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1at13T-0003XD-A9
	for coreutils@gnu.org; Wed, 20 Apr 2016 18:57:07 -0400
Received: from [192.168.101.10] ([217.86.64.216]) by mrelayeu.kundenserver.de
	(mreue002) with ESMTPSA (Nemesis) id 0MMsCl-1aoM6216nn-008XDW;
	Thu, 21 Apr 2016 00:57:05 +0200
Subject: Re: [PATCH] sleep,timeout: support overflowing floating point values
To: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>, coreutils@gnu.org
References: <1461173499-32531-1-git-send-email-P@draigBrady.com>
From: Bernhard Voelker <mail@bernhard-voelker.de>
Message-ID: <57180940.4090700@bernhard-voelker.de>
Date: Thu, 21 Apr 2016 00:57:04 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.6.0
MIME-Version: 1.0
In-Reply-To: <1461173499-32531-1-git-send-email-P@draigBrady.com>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 8bit
X-Provags-ID: V03:K0:twiOrJUU+7L+O8j+ALQOlF/l4ioRn1qmpZ/NmEusrlj8rc4TfwR
	fmTKmaLLXc+zvb1iXf8O8QXHLjEUgIf90frotyblM6dwv0e/PaWYGBp+8RYtt81vyi8Kz8Z
	v5lyUp8GFY8NbxFpQ1bCnuJUevcQgNx0/WBL2jEIzh4iH/wZyum33hPQ98jyVvte/IEfOtB
	AAVDb95YLP1S3hiIWM41A==
X-UI-Out-Filterresults: notjunk:1;V01:K0:70Y76c6r6bo=:+FQuDyKfFwOo6l7QlNOYBh
	lX806kZ/V37CSaYAKa76DR718KBtDnYitaPrFxveSUdNhlUo2PGWjbq+FuW3q9h+Z2zQmtvkF
	8RC+4bpzw0n8KU3PUijlP6Ciu8kSDi0IX1Z9a5QD7x0ycD0/xkzEif80nIWkvGkO+V40aZaj5
	SWeB7Ncxw3dcmVVVo2YHfZ4bDKSNEUtYJIk8G/d9Ny0AXxfO7ahd76rl1OhpWAZ7N6JEp9A4L
	19oLwVjlP+OQtlvHfqx7sSLpDFXbOAtcn6eTDsr801YrBwInQKDloMYcJ3tq1SvepI8gXy0H6
	sfLHTQdONbhmL4PZxj2IRpE3NaLGxTAkcn8Ql4QjzD3p1rqWAdYbP+LpWDRXsoaGV1TQVw1qb
	cn0B9CYe3ftAtOVWmBZrFtJk5IApZitOtzFKUdb0zVX8qkofs5rcASOM6ibNF0HtH6hftR3Q9
	3Yg9VaeIGvv8WJBiqQ15xVh1rGm7LAjcTFx+kNikZjDl8ChgkV3fcyftyAKZYreOx18cZ/3/g
	c86kRsjlJJZRExkVHcX0E4kWIEvdnF/vwtiLScQpTp8RDGpUgXLgRHyck22zpD8q0xCLsVYdN
	INc2hWr7uiIlWS2U6UcVVohX11etkIKlwQ856eVDUb7HMJ064dQr+GQqh3cDHIDkUGGQo516s
	oxejKAMaPbYoYx+9GmQ/R+9LPJ4tBdRuuCbWRyFoKoWeOp9q5VSMnOwjX2kaVKqWDsEINg3Er
	Goy5kQEnb7RUEkNF
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 212.227.126.135
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Apr 2016 22:57:13 -0000

On 04/20/2016 07:31 PM, Pádraig Brady wrote:
> * src/sleep.c (main): Allow ERANGE since we allow "inf" values.
> * src/timeout.c (parse_duration): Likewise.
> * tests/misc/sleep.sh: New file. Tests for sleep(1).

Nice!
For completeness, you could add the following cases:

  * sleep nan      # invalid time interval
  * sleep -- -1    # invalid time interval
  * sleep          # missing operand
  * sleep "0x2"    # hexadecimal value allowed
  * sleep "0x1p2"  # hexadecimal value with suffix allowed

> * tests/misc/timeout-parameters.sh: Add case for newly allowed
> $LDBL_MAX.  Also use returns_ throughout the file.  Also avoid
> small timeout values which might give false failures under load.

LGTM.

Have a nice day,
Berny


From MAILER-DAEMON Wed Apr 20 19:09:55 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1at1Fr-0005Fb-9X
	for mharc-coreutils@gnu.org; Wed, 20 Apr 2016 19:09:55 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:55322)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1at1Fo-0005Ac-SV
	for coreutils@gnu.org; Wed, 20 Apr 2016 19:09:53 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1at1Fk-0006QK-QH
	for coreutils@gnu.org; Wed, 20 Apr 2016 19:09:52 -0400
Received: from mout.kundenserver.de ([212.227.126.133]:51119)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1at1Fk-0006QA-H5
	for coreutils@gnu.org; Wed, 20 Apr 2016 19:09:48 -0400
Received: from [192.168.101.10] ([217.86.64.216]) by mrelayeu.kundenserver.de
	(mreue002) with ESMTPSA (Nemesis) id 0MGsCH-1axkKp2IfB-00DVt6;
	Thu, 21 Apr 2016 01:09:46 +0200
Subject: Re: [PATCH] tests: avoid potential overflows with `expr`
To: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>, coreutils@gnu.org
References: <1461168009-1998-1-git-send-email-P@draigBrady.com>
From: Bernhard Voelker <mail@bernhard-voelker.de>
Message-ID: <57180C39.3080503@bernhard-voelker.de>
Date: Thu, 21 Apr 2016 01:09:45 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.6.0
MIME-Version: 1.0
In-Reply-To: <1461168009-1998-1-git-send-email-P@draigBrady.com>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 8bit
X-Provags-ID: V03:K0:9TbYz3ydxKauftr1+Aa/JSvUpPBs4uKUxi0LSaUXa0ymxITNeAF
	pOCSNuM7IDss0vfNO29VAo+nnRP6tqRcw5rIBxU/7zI41vsQKH2+e6tcpu2PH0zECFxDghk
	Aj6/I5yuLQEFyPKOp5HL0UdX9wJPtXq5G9tpGp8AxvS3YedKIoXU3KuBWzRg+GmNIYC/9pJ
	lYDwPtC0bb/bVTXw/9Mgw==
X-UI-Out-Filterresults: notjunk:1;V01:K0:3AwKcj4tKlA=:E1KEMBI1UodzDPRYHLA78l
	Beb/pg/Twhp5G/8l68drg/YJaZuQ/HFfyHOsxq5DAdc6/jGksyVQHN1dFHTSNhmYZjm3I6086
	KJ81akzI1u+/fLKwkF6+awjYf+OlZ029HhY4tVz4m50BpZ2gEK7+8Iwzg2dZnffu4pAxrDXC1
	YlZWhoFHPMz9r6nUJTHz7AQfouqngliLnZ1pLZzlRRMDlwT/W3+FGgyIuhzMPIFdwzAZN0a7y
	intwk1IdNSiEK9OVzL9XqJ0h+IK2423W5s4y22ZD2zNe4mzTkqB246AjqXmq8p8wNL6dRTZc6
	ibF/H0Z4V3v2eReSnPrxkJgmsAliInnd14Ur58bI1DT4ZegFTpitzgtqH7d3p5yopglwtdpsn
	woXrf1xXjHmjW9LX70i0/JUsHleHIA7vK8IMpqi2E+bpMiPXNaMHoBSc5ljX+gar8Ro7jX9dL
	v/4lMPnjiaMRgOSrqiiK5ClL8epHy7iU7zXMY3D7ydvCpdk7AlY041T21Ur1LUeJRHT20bP7L
	BZ425ySRrWLAzaFLVFgIzQ5ZiLnez9BV1ZZAuukUyvayzFqVCn7QFgLTF2E9VhaKw8LX6fZKf
	ybKMtqOuLjLoM+YQjPjvA5imzrgA6oZ+yW0p2CFvsthoZxISMaRkwksUUca/giY2x3Jhss7lM
	yEmur1x52RtnC8vfmOJXRd4k1qWdg3zhSgYalMM6GHBTRvnXsEJCx8egtTxFj1advRlDfY81H
	9Sof476fUwT+LLp+
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 212.227.126.133
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 20 Apr 2016 23:09:53 -0000

On 04/20/2016 06:00 PM, Pádraig Brady wrote:
> * cfg.mk (sc_prohibit_expr_unsigned): expr uses intmax_t internally
> when GMP is not available, so flag any uses of unsigned limits.
> * tests/misc/timeout-parameters.sh: Remove the overflow related
> to UINT_MAX as it's handled by the following case.  Change the
> following case from 99... to $TIME_T_OFLOW to be more expressive
> in what it's actually testing.  Directly check that commands succeed,
> rather than inspecting $? afterwards.
> * tests/dd/skip-seek-past-dev.sh: Guard against large device sizes.
> * tests/id/setgid.sh: Protect: Guard against large group IDs.
> * tests/misc/cut-huge-range.sh: Tweak comment to avoid syntax check.
> It's tempting to simplify to just skip the test if expr fails,
> but SIZE_MAX > INTMAX_MAX is the common case.

+1

Thanks & have a nice day,
Berny


From MAILER-DAEMON Sun Apr 24 18:36:24 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1auSdc-0006CK-5i
	for mharc-coreutils@gnu.org; Sun, 24 Apr 2016 18:36:24 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:56444)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1auSdZ-000684-F7
	for coreutils@gnu.org; Sun, 24 Apr 2016 18:36:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1auSdV-0007EY-W4
	for coreutils@gnu.org; Sun, 24 Apr 2016 18:36:21 -0400
Received: from mail-qk0-x230.google.com ([2607:f8b0:400d:c09::230]:34725)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1auSdV-0007EU-Rv
	for coreutils@gnu.org; Sun, 24 Apr 2016 18:36:17 -0400
Received: by mail-qk0-x230.google.com with SMTP id r184so56293312qkc.1
	for <coreutils@gnu.org>; Sun, 24 Apr 2016 15:36:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to;
	bh=W0PXSiw0Ak0dSoXHwNaELWz6PtyynC57Ig9GEFTUcSQ=;
	b=kx5PD6RW6aJHghNleIhAtoXP2cvRilJmhgPTSlOS1vR+zot4YclXhJlR1442NF+p9e
	Le+yKlYLpsLCJ613ikdrCCbgjLTKqKfzJ7t+kNVz4CnJ5CrheW14X5lt+zoVkl/NlWPk
	CogDjPTnDol4hboTHgGFRJsHl9dXWloRYHwW+sEQP7gKeqrm47LqjOrvzzcLc8jDe1Sj
	ztISJUfiDnUqOPn1HxqT1dJON0UNLFx4qiVCZ17A7eXk/fYCuuA5saLfwayQE4v4ubFz
	sM7g5ILmW5o6/mpraHXY0on6B8XPggwjCgrpbiws/HcDHXv4Mi6ZIKvv3Dd9v4wMy9FT
	NYyw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to;
	bh=W0PXSiw0Ak0dSoXHwNaELWz6PtyynC57Ig9GEFTUcSQ=;
	b=RIm9I/byPqtmWVsDl6UkYQm5ZLqcjFr62aZC87cGiv6ZNgIQd68JOOZiXX8VJRk67a
	O+c/ZJk13eZ4/vloia0dVMUAEFwCBTz3mF4mzEH3659gsg7micRGvJW2XQLJMIG3xIhE
	h2nS0mYm6kmU7EH+zKPcxx2FtXmBZXul6JdGCGuf9by6AX2l+kw3R6/tIPorLgQ+ZnU1
	Byh3sSO31BWnWtHbkdvakyzC33HpPQlNJA1s+axKFYOfFXQs9he2WHmUgXqDBn7W+C8B
	RRUopbal1qXw+TdcoXlwEm2S21FDVxHut4aMG/cfcPKP78fN1GP5147JHDh9Z/KXtZrb
	D2UQ==
X-Gm-Message-State: AOPr4FUkV40iGN06G1xPe3TLjOziTG2u+hLgnqeuP4l8maSuEQQ4bzG2Uy/T0T+uv4b94g==
X-Received: by 10.55.27.21 with SMTP id b21mr15453987qkb.208.1461537377432;
	Sun, 24 Apr 2016 15:36:17 -0700 (PDT)
Received: from ix.home (pool-100-38-105-55.nycmny.fios.verizon.net.
	[100.38.105.55])
	by smtp.gmail.com with ESMTPSA id a77sm6166901qkj.6.2016.04.24.15.36.16
	(version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
	Sun, 24 Apr 2016 15:36:16 -0700 (PDT)
Content-Type: text/plain; charset=windows-1252
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\))
Subject: Re: prevent seq from inflow inflow on I/O errors
From: Assaf Gordon <assafgordon@gmail.com>
In-Reply-To: <57136AE1.6070007@draigBrady.com>
Date: Sun, 24 Apr 2016 18:36:14 -0400
Cc: Coreutils <coreutils@gnu.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <3534D2B6-109B-45E2-95A3-8AEB8566F588@gmail.com>
References: <788E7E16-EFE1-47D0-96CD-A35FB080BBA6@gmail.com>
	<570256BD.7010302@draigBrady.com>
	<57037EDD.2020604@bernhard-voelker.de>
	<1BC925DA-15D0-4E54-BE80-92AD9D64C0E7@gmail.com>
	<57136AE1.6070007@draigBrady.com>
To: =?windows-1252?Q?P=E1draig_Brady?= <P@draigBrady.com>,
	Bernhard Voelker <mail@bernhard-voelker.de>
X-Mailer: Apple Mail (2.2102)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2607:f8b0:400d:c09::230
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Apr 2016 22:36:22 -0000


> On Apr 17, 2016, at 06:52, P=E1draig Brady <P@draigBrady.com> wrote:
> Yes it's better not to change the EPIPE handling
> so we're consistent with other utils.
> That might be a change we consider separately.
>=20
> Your patch looks good.
>=20
> please push.

thank you, pushed in:
 =
http://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=3Dc92585b10b29ce=
2c31c69cea52e69ef053c9679f


regards,
 - assaf=


From MAILER-DAEMON Sun Apr 24 18:56:35 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1auSx9-0001X3-E7
	for mharc-coreutils@gnu.org; Sun, 24 Apr 2016 18:56:35 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:58338)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1auSx6-0001RL-AA
	for coreutils@gnu.org; Sun, 24 Apr 2016 18:56:33 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1auSx1-00028e-AZ
	for coreutils@gnu.org; Sun, 24 Apr 2016 18:56:32 -0400
Received: from mail-qk0-x230.google.com ([2607:f8b0:400d:c09::230]:34349)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1auSx0-00028S-GS
	for coreutils@gnu.org; Sun, 24 Apr 2016 18:56:27 -0400
Received: by mail-qk0-x230.google.com with SMTP id r184so56383739qkc.1
	for <coreutils@gnu.org>; Sun, 24 Apr 2016 15:56:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:subject:from:in-reply-to:date:cc:message-id:references
	:to; bh=Sd7l34baGBX8+fV6K9RsHfnCR4L5jrhqH2ovkISKjkY=;
	b=y+i1yatXTy2TUJR9OMzVOW5Q8T1HRKdnIpK94OaO8OwpA1qynnqXd9z2A9N4gFpas5
	fteBXBAywCT75srFG0xxaXDpJOd4NKrOFg+Fx8i2lliAi8Z31vIukDqfkgtOVBXA635S
	upXD9O6AjQ58XO6psEweYFewt6/pKovv3/rfLCI60iX+DOrx3ITkARtwgubuCMz+mEhm
	lGxgsyeGzc1V+rirgeqAws66qdGjru0Ssa6LmxGqcuh1p43JfJsAdQ0YcQ+tjAS+dn4W
	/AXfTTIYDFMsE1Q9YQmmi03mBeK0SCi6D5+S5xjHPYUbCZztzMXiUybRGe7MV/jNia98
	+B0g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc
	:message-id:references:to;
	bh=Sd7l34baGBX8+fV6K9RsHfnCR4L5jrhqH2ovkISKjkY=;
	b=JuUZ8LDyevWhDSY3ImzOmh2esbID8R1pgZbhuTh8w9qYZMuqnPbAZqGpLxFmF1k+2C
	YhsgJViD+ePdtxucI/m6bnYdk112BnK4uZYjNo5plkP8xqwGDR4e3vKURGn6M7iFBTT8
	tde3atgwAdJEyimWfoGeYC9GhRx0IV8GAwz2CTgXyDUo4l4oBE5tkC4t92kSJjl5HRpT
	BMkn+wBL0LJWSudG/rMRIi7vuVB8DU6XzmzBvCtvDxKoJrZPvnUEPARToCjM8kvkvSZ9
	vHYnrLCNJIwVUhZD4Wq/4fkWsoGvjnvQErqVNqML6maZulcKB17ILsZdPhMDNdxHPeWV
	x/uA==
X-Gm-Message-State: AOPr4FXZ/mmx2fk1a4DUA6cpher3TtTNLAzjMbiHErnps5T7J1Hghi/eHVJANxW2uxsSDQ==
X-Received: by 10.55.117.18 with SMTP id q18mr15264854qkc.194.1461538585630;
	Sun, 24 Apr 2016 15:56:25 -0700 (PDT)
Received: from ix.home (pool-100-38-105-55.nycmny.fios.verizon.net.
	[100.38.105.55])
	by smtp.gmail.com with ESMTPSA id f66sm6183338qkb.5.2016.04.24.15.56.24
	(version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
	Sun, 24 Apr 2016 15:56:24 -0700 (PDT)
Content-Type: multipart/mixed;
	boundary="Apple-Mail=_486DBABB-CE1F-49CB-BAD3-3BAB93443723"
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\))
Subject: Re: suggested feautre: "date --debug" - print date parsing diagnostics
From: Assaf Gordon <assafgordon@gmail.com>
In-Reply-To: <56BD5FCC.8050607@draigBrady.com>
Date: Sun, 24 Apr 2016 18:56:22 -0400
Cc: Coreutils <coreutils@gnu.org>
Message-Id: <B7528601-1583-44C8-8286-ABAC076DD104@gmail.com>
References: <AC91BFB5-9A51-412B-BFA1-4356C885E77F@gmail.com>
	<CE5F75AD-E67E-4C60-9D9B-F3C114C85790@gmail.com>
	<42B22D28-29E9-4D2B-90A1-D8C6B1BC4E09@gmail.com>
	<56A45C6E.2050509@draigBrady.com>
	<D71B7552-36C1-4959-987D-9D9E90E78897@gmail.com>
	<56B43310.8060703@draigBrady.com>
	<2F3B51BA-A5A3-4E19-9640-DFEB0C9E68ED@gmail.com>
	<56BD5FCC.8050607@draigBrady.com>
To: =?utf-8?Q?P=C3=A1draig_Brady?= <P@draigBrady.com>
X-Mailer: Apple Mail (2.2102)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2607:f8b0:400d:c09::230
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Apr 2016 22:56:33 -0000


--Apple-Mail=_486DBABB-CE1F-49CB-BAD3-3BAB93443723
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=windows-1252

Hello,

Sorry for the delayed update.

Attached is an updated patch for "date --debug" option, including few =
specific tests for the new options (one patch is for coreutils, and the =
other for gnulib).

comments welcomed,
 -assaf



--Apple-Mail=_486DBABB-CE1F-49CB-BAD3-3BAB93443723
Content-Disposition: attachment;
	filename=gnulib-0001-parse-datetime-debug.patch
Content-Type: application/octet-stream;
	name="gnulib-0001-parse-datetime-debug.patch"
Content-Transfer-Encoding: quoted-printable

=46rom=20cecb878f4bd4eadc8f1f55e230576c3242e9f2a2=20Mon=20Sep=2017=20=
00:00:00=202001=0AFrom:=20Assaf=20Gordon=20<assafgordon@gmail.com>=0A=
Date:=20Thu,=2011=20Feb=202016=2019:49:24=20-0500=0ASubject:=20[PATCH]=20=
parse-datetime:=20add=20optional=20debug=20printing=0A=0Aprint=20parsing=20=
information,=20warnings,=20and=20errors=20to=20stderr.=0A=0A*=20=
lib/parse-datetime.h:=20(parse_datetimte_debug):=20new=20global=20=
variable.=0A*=20lib/parse-datetime.y:=0A=20=20=20=20(DEBUG_*):=20=20=
macros=20calling=20debug=20functions=20if=20debugging=20is=20enabled.=0A=20=
=20=20=20(PROGRESS*):=20same=20as=20DEBUG,=20for=20progress=20reporting.=0A=
=20=20=20=20(dbg_printf):=20print=20message=20to=20stderr,=20with=20=
'date'=20prefix.=0A=20=20=20=20(struct=20parser_control):=20add=20=
'debug_*_seen'=20variables.=0A=20=20=20=20(str_days):=20converts=20day=20=
ordinal/number=20to=20string=20(e.g.=20'last=20wed').=0A=20=20=20=20=
(debug_print_current_time,=20debug_print_relateive_time):=20prints=20the=0A=
=20=20=20=20current/relative=20date/time=20value=20of=20parser_control.=0A=
=20=20=20=20(YACC=20parser=20syntax):=20print=20parsed=20parts=20with=20=
DEBUG_*=20macros.=0A=20=20=20=20(to_year):=20warn=20about=202-digit=20=
year=20parsing.=0A=20=20=20=20(yylex):=20=20=20warn=20about=20=
unrecognized=20words.=0A=20=20=20=20(get_effective_timezone):=20returns=20=
current=20timezone=20in=20minutes.=0A=20=20=20=20=
(debug_strf{time,date,datetime}):=20convert=20'struct=20tm'=20to=20=
string=20as=0A=20=20=20=20clearly=20and=20unambigiously=20as=20possible.=0A=
=20=20=20=20(debug_mktime_not_ok):=20print=20detailed=20information=20=
about=20failed=0A=20=20=20=20date/time=20values.=0A=20=20=20=20=
(parse_datetime):=20add=20DEBUG=20messages=20for=20failures,=20warnings.=20=
Add=0A=20=20=20=20PROGRESS=20messages=20for=20status=20messages.=0A*=20=
modules/parse-datetime:=20add=20'timegm',=20'gettext-h'=20dependencies.=0A=
---=0A=20lib/parse-datetime.h=20=20=20|=20=20=202=20+=0A=20=
lib/parse-datetime.y=20=20=20|=20679=20=
+++++++++++++++++++++++++++++++++++++++++++++++--=0A=20=
modules/parse-datetime=20|=20=20=202=20+=0A=203=20files=20changed,=20663=20=
insertions(+),=2020=20deletions(-)=0A=0Adiff=20--git=20=
a/lib/parse-datetime.h=20b/lib/parse-datetime.h=0Aindex=20=
c38b000..b849db3=20100644=0A---=20a/lib/parse-datetime.h=0A+++=20=
b/lib/parse-datetime.h=0A@@=20-19,4=20+19,6=20@@=0A=20#include=20=
<stdbool.h>=0A=20#include=20<time.h>=0A=20=0A+extern=20bool=20=
parse_datetime_debug;=0A+=0A=20bool=20parse_datetime=20(struct=20=
timespec=20*,=20char=20const=20*,=20struct=20timespec=20const=20*);=0A=
diff=20--git=20a/lib/parse-datetime.y=20b/lib/parse-datetime.y=0Aindex=20=
163a0ea..3964db6=20100644=0A---=20a/lib/parse-datetime.y=0A+++=20=
b/lib/parse-datetime.y=0A@@=20-59,14=20+59,18=20@@=0A=20#=20undef=20=
static=0A=20#endif=0A=20=0A+#include=20<inttypes.h>=0A=20#include=20=
<c-ctype.h>=0A=20#include=20<limits.h>=0A=20#include=20<stdio.h>=0A=20=
#include=20<stdlib.h>=0A=20#include=20<string.h>=0A=20=0A+#include=20=
"gettext.h"=0A=20#include=20"xalloc.h"=0A=20=0A+#define=20_(str)=20=
gettext=20(str)=0A+=0A=20/*=20Bison's=20skeleton=20tests=20_STDLIB_H,=20=
while=20some=20stdlib.h=20headers=0A=20=20=20=20use=20_STDLIB_H_=20as=20=
witness.=20=20Map=20the=20latter=20to=20the=20one=20bison=20uses.=20=20=
*/=0A=20/*=20FIXME:=20this=20is=20temporary.=20=20Remove=20when=20we=20=
have=20a=20mechanism=20to=20ensure=0A@@=20-105,6=20+109,8=20@@=0A=20=0A=20=
#define=20HOUR(x)=20((x)=20*=2060)=0A=20=0A+#define=20STREQ(a,=20b)=20=
(strcmp=20(a,=20b)=20=3D=3D=200)=0A+=0A=20/*=20long_time_t=20is=20a=20=
signed=20integer=20type=20that=20contains=20all=20time_t=20values.=20=20=
*/=0A=20verify=20(TYPE_IS_INTEGER=20(time_t));=0A=20#if=20=
TIME_T_FITS_IN_LONG_INT=0A@@=20-118,6=20+124,64=20@@=20typedef=20time_t=20=
long_time_t;=0A=20=20=20=20errors=20that=20the=20cast=20doesn't.=20=20*/=0A=
=20static=20unsigned=20char=20to_uchar=20(char=20ch)=20{=20return=20ch;=20=
}=0A=20=0A+/*=20Enable=20diagnostic=20debug=20output=20to=20STDERR=20*/=0A=
+bool=20parse_datetime_debug=20=3D=20false;=0A+=0A+/*=20Debug=20message=20=
without=20parameters=20*/=0A+#define=20DEBUG0(msg)=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20\=0A+=20=20=
do=20{=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20\=0A+=20=20=20=20=
if=20(parse_datetime_debug)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20\=0A+=20=20=20=20=20=20dbg_printf=20(msg);=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20\=0A+=20=20}=20while=20=
(0)=0A+=0A+/*=20Debug=20message=20with=20printf-style=20parameters=20*/=0A=
+#define=20DEBUG(x,...)=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20\=0A+=20=20do=20{=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20\=0A+=20=20=20=20if=20(parse_datetime_debug)=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20\=0A+=20=20=20=20=20=
=20dbg_printf=20(x,__VA_ARGS__);=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20\=0A+=20=20}=20while=20(0)=0A+=0A+/*=20Progress=20messages=20treated=20=
the=20same=20as=20debug=20messages=20*/=0A+#define=20PROGRESS=20=20DEBUG=0A=
+#define=20PROGRESS0=20DEBUG0=0A+=0A+/*=20Print=20the=20date/time=20of=20=
the=20parser_control=20struct=20*/=0A+#define=20=
DEBUG_PRINT_CURRENT_TIME(item,pc)=20=20\=0A+=20=20do=20{=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20\=0A+=20=20=20=20if=20(parse_datetime_debug)=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20\=0A+=20=20=20=20=20=20=
debug_print_current_time=20(item,=20pc);=20\=0A+=20=20}=20while=20(0)=0A=
+=0A+/*=20Print=20the=20relative=20date/time=20of=20the=20parser=20=
control=20struct=20*/=0A+#define=20DEBUG_PRINT_RELATIVE_TIME(item,pc)=20=
\=0A+=20=20do=20{=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20\=0A+=20=20=20=20=
if=20(parse_datetime_debug)=20=20=20=20=20=20=20=20=20=20=20=20=20=20\=0A=
+=20=20=20=20=20=20debug_print_rel_time=20(item,=20pc);=20=20=20=20=20\=0A=
+=20=20}=20while=20(0)=0A+=0A+/*=20if=20'mktime_ok'=20failed,=20print=20=
informative=20message=20with=20possible=20reasons=20*/=0A+#define=20=
DEBUG_MKTIME_NOT_OK(tm0,tm1,pc,zones_seen)=20=20=20=20=20=20\=0A+=20=20=
do=20{=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20\=0A+=20=20=20=20if=20(parse_datetime_debug)=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20\=0A+=20=20=20=20=
=20=20debug_mktime_not_ok=20(tm0,=20tm1,=20pc,=20zones_seen);=20=20=20\=0A=
+=20=20=20}=20while=20(0)=0A+=0A+=0A+=0A+static=20void=0A+dbg_printf=20=
(const=20char=20*msg,...)=0A+{=0A+=20=20va_list=20args;=0A+=20=20/*=20=
TODO:=20use=20gnulib's=20'program_name'=20instead?=20*/=0A+=20=20fputs=20=
("date:=20",=20stderr);=0A+=0A+=20=20va_start=20(args,=20msg);=0A+=20=20=
vfprintf=20(stderr,=20msg,=20args);=0A+=20=20va_end=20(args);=0A+}=0A+=0A=
+=0A+=0A=20/*=20Lots=20of=20this=20code=20assumes=20time_t=20and=20=
time_t-like=20values=20fit=20into=0A=20=20=20=20long_time_t.=20=20*/=0A=20=
verify=20(TYPE_MINIMUM=20(long_time_t)=20<=3D=20TYPE_MINIMUM=20(time_t)=0A=
@@=20-209,6=20+273,20=20@@=20typedef=20struct=0A=20=20=20size_t=20=
times_seen;=0A=20=20=20size_t=20zones_seen;=0A=20=0A+=20=20/*=20which=20=
of=20the=20'seen'=20parts=20has=20been=20printed=20when=20debugging=20*/=0A=
+=20=20size_t=20debug_dates_seen;=0A+=20=20size_t=20debug_days_seen;=0A+=20=
=20size_t=20debug_local_zones_seen;=0A+=20=20size_t=20debug_dsts_seen;=0A=
+=20=20size_t=20debug_times_seen;=0A+=20=20size_t=20debug_zones_seen;=0A=
+=0A+=20=20/*=20true=20if=20the=20user=20specified=20explicit=20ordinal=20=
day=20value,=20*/=0A+=20=20bool=20debug_ordinal_day_seen;=0A+=0A+=20=20=
/*=20the=20default=20input=20timezone,=20set=20by=20TZ=20value=20*/=0A+=20=
=20long=20int=20debug_default_input_timezone;=0A+=0A=20=20=20/*=20Table=20=
of=20local=20time=20zone=20abbreviations,=20terminated=20by=20a=20null=20=
entry.=20=20*/=0A=20=20=20table=20local_time_zone_table[3];=0A=20}=20=
parser_control;=0A@@=20-282,6=20+360,174=20@@=20set_hhmmss=20=
(parser_control=20*pc,=20long=20int=20hour,=20long=20int=20minutes,=0A=20=
=20=20pc->seconds.tv_nsec=20=3D=20nsec;=0A=20}=0A=20=0A+/*=20returns=20a=20=
textual=20representation=20of=20the=20day=20ordinal/number=20values=0A+=20=
=20=20in=20the=20parser_control=20struct=20(e.g.=20'last=20wed',=20'this=20=
tues',=20'thu')=20*/=0A+static=20const=20char*=0A+str_days=20=
(parser_control=20*pc,=20char*=20/*output*/=20buffer,=20size_t=20n)=0A+{=0A=
+=20=20/*=20TODO:=20use=20the=20=20relative_time_table[]=20for=20reverse=20=
lookup=20*/=0A+=20=20static=20const=20char*=20ordinal_values[]=20=3D=20{=0A=
+=20=20=20=20=20"last",=0A+=20=20=20=20=20"this",=0A+=20=20=20=20=20=
"next/first",=0A+=20=20=20=20=20"(SECOND)",=20/*=20SECOND=20is=20=
commented=20out=20in=20relative_time_table[]=20*/=0A+=20=20=20=20=20=
"third",=0A+=20=20=20=20=20"fourth",=0A+=20=20=20=20=20"fifth",=0A+=20=20=
=20=20=20"sixth",=0A+=20=20=20=20=20"seventh",=0A+=20=20=20=20=20=
"eight",=0A+=20=20=20=20=20"ninth",=0A+=20=20=20=20=20"tenth",=0A+=20=20=20=
=20=20"eleventh",=0A+=20=20=20=20=20"twelfth"};=0A+=0A+=20=20static=20=
const=20char*=20days_values[]=20=3D=20{=0A+=20=20=20=20=20"Sun",=0A+=20=20=
=20=20=20"Mon",=0A+=20=20=20=20=20"Tue",=0A+=20=20=20=20=20"Wed",=0A+=20=20=
=20=20=20"Thu",=0A+=20=20=20=20=20"Fri",=0A+=20=20=20=20=20"Sat"=0A+=20=20=
=20=20};=0A+=0A+=20=20/*=20don't=20add=20an=20ordinal=20prefix=20if=20=
the=20user=20didn't=20specify=20it=0A+=20=20=20=20=20(e.g.,=20"this=20=
wed"=20vs=20"wed")=20*/=0A+=20=20if=20(pc->debug_ordinal_day_seen)=0A+=20=
=20=20=20{=0A+=20=20=20=20=20=20/*=20use=20word=20description=20of=20=
possible=20(e.g.=20-1=20=3D=20last,=203=20=3D=20third)=20*/=0A+=20=20=20=20=
=20=20if=20(pc->day_ordinal>=3D-1=20&&=20pc->day_ordinal=20<=3D12)=0A+=20=
=20=20=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=20=20=20strncpy=20=
(buffer,=20ordinal_values[=20pc->day_ordinal+1=20],=20n);=0A+=20=20=20=20=
=20=20=20=20=20=20buffer[n-1]=3D'\0';=0A+=20=20=20=20=20=20=20=20}=0A+=20=
=20=20=20=20=20else=0A+=20=20=20=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=
=20=20=20snprintf=20(buffer,n,"%ld",pc->day_ordinal);=0A+=20=20=20=20=20=20=
=20=20}=0A+=20=20=20=20}=0A+=20=20else=0A+=20=20=20=20{=0A+=20=20=20=20=20=
=20buffer[0]=20=3D=20'\0';=0A+=20=20=20=20}=0A+=0A+=20=20/*=20Add=20the=20=
day=20name=20*/=0A+=20=20if=20(pc->day_number>=3D0=20&&=20=
pc->day_number<=3D6)=0A+=20=20=20=20{=0A+=20=20=20=20=20=20size_t=20l=20=
=3D=20strlen=20(buffer);=0A+=20=20=20=20=20=20if=20(l>0)=0A+=20=20=20=20=20=
=20=20=20{=0A+=20=20=20=20=20=20=20=20=20=20strncat=20(buffer,"=20=
",n-l);=0A+=20=20=20=20=20=20=20=20=20=20++l;=0A+=20=20=20=20=20=20=20=20=
}=0A+=20=20=20=20=20=20strncat=20=
(buffer,days_values[pc->day_number],n-l);=0A+=20=20=20=20}=0A+=20=20else=0A=
+=20=20=20=20{=0A+=20=20=20=20=20=20/*=20invalid=20day_number=20value=20=
-=20should=20never=20happen=20*/=0A+=20=20=20=20}=0A+=20=20return=20=
buffer;=0A+}=0A+=0A+/*=20debugging:=20print=20the=20current=20time=20in=20=
the=20parser_control=20structure.=0A+=20=20=20The=20parser=20will=20=
increment=20"*_seen"=20members=20for=20those=20which=20were=20parsed.=0A=
+=20=20=20This=20function=20will=20print=20only=20newly=20seen=20parts.=20=
*/=0A+static=20void=0A+debug_print_current_time=20(const=20char*=20item,=20=
parser_control=20*pc)=0A+{=0A+=20=20char=20tmp[100]=20=3D=20{0};=0A+=20=20=
DEBUG=20(_("parsed=20%s=20part:=20"),=20item);=20/*=20no=20newline,=20=
more=20items=20printed=20below=20*/=0A+=0A+=20=20if=20(pc->dates_seen=20=
!=3D=20pc->debug_dates_seen)=0A+=20=20=20=20{=0A+=20=20=20=20=20=20=
/*TODO:=20use=20pc->year.negative?=20*/=0A+=20=20=20=20=20=20fprintf=20=
(stderr,"(Y-M-D)=20%04ld-%02ld-%02ld=20",=0A+=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20pc->year.value,=20pc->month,=20pc->day);=0A+=20=20=20=20=20=20=
pc->debug_dates_seen=20=3D=20pc->dates_seen;=0A+=20=20=20=20}=0A+=0A+=20=20=
if=20(pc->times_seen=20!=3D=20pc->debug_times_seen)=0A+=20=20=20=20{=0A+=20=
=20=20=20=20=20fprintf=20(stderr,"%02ld:%02ld:%02ld",=0A+=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20pc->hour,=20pc->minutes,=20pc->seconds.tv_sec);=0A=
+=20=20=20=20=20=20if=20(pc->seconds.tv_nsec!=3D0)=0A+=20=20=20=20=20=20=20=
=20fprintf=20(stderr,"%09ld",=20pc->seconds.tv_nsec);=0A+=20=20=20=20=20=20=
if=20(pc->meridian=3D=3DMERpm)=0A+=20=20=20=20=20=20=20=20fputs=20=
("pm",stderr);=0A+=20=20=20=20=20=20fputc=20('=20',stderr);=0A+=20=20=20=20=
=20=20pc->debug_times_seen=20=3D=20pc->times_seen;=0A+=20=20=20=20}=0A+=0A=
+=20=20if=20(pc->days_seen=20!=3D=20pc->debug_days_seen)=0A+=20=20=20=20=
{=0A+=20=20=20=20=20=20fprintf=20(stderr,_("%s=20(day=20ordinal=3D%ld=20=
number=3D%d)"),=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20str_days=20=
(pc,tmp,sizeof=20(tmp)),=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
pc->day_ordinal,=20pc->day_number);=0A+=20=20=20=20=20=20=
pc->debug_days_seen=20=3D=20pc->days_seen=20;=0A+=20=20=20=20}=0A+=0A+=20=
=20if=20(pc->dsts_seen=20!=3D=20pc->debug_dsts_seen)=0A+=20=20=20=20{=0A=
+=20=20=20=20=20=20fprintf=20(stderr,_("is-dst=3D%d=20"),=20=
pc->local_isdst);=0A+=20=20=20=20=20=20pc->dsts_seen=20=3D=20=
pc->debug_dsts_seen;=0A+=20=20=20=20}=0A+=0A+=20=20/*=20TODO:=20fix=20=
incorrect=20display=20of=20EST=3D2:08h?=20*/=0A+=20=20if=20=
(pc->zones_seen=20!=3D=20pc->debug_zones_seen)=0A+=20=20=20=20{=0A+=20=20=
=20=20=20=20fprintf=20(stderr,_("TZ=3D%+03d:%02d"),=20=
(int)(pc->time_zone/60),=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
abs=20((int)pc->time_zone%60));=0A+=20=20=20=20=20=20=
pc->debug_zones_seen=20=3D=20pc->zones_seen;=0A+=20=20=20=20}=0A+=0A+=20=20=
if=20(pc->local_zones_seen=20!=3D=20pc->debug_local_zones_seen)=0A+=20=20=
=20=20{=0A+=20=20=20=20=20=20fprintf=20(stderr,_("Local-TZ=3D%+03d:%02d"),=
=20(int)(pc->time_zone/60),=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
abs=20((int)pc->time_zone%60));=0A+=20=20=20=20=20=20=
pc->debug_local_zones_seen=20=3D=20pc->local_zones_seen;=0A+=20=20=20=20=
}=0A+=0A+=20=20if=20(pc->timespec_seen)=0A+=20=20=20=20fprintf=20=
(stderr,_("number=20of=20seconds:=20%ld"),=20pc->seconds.tv_sec);=0A+=0A=
+=20=20fputc=20('\n',=20stderr);=0A+}=0A+=0A+/*=20debugging:=20print=20=
the=20current=20relative=20values.=20*/=0A+static=20void=0A=
+debug_print_rel_time=20(const=20char*=20item,=20const=20parser_control=20=
*pc)=0A+{=0A+=20=20DEBUG=20(_("parsed=20%s=20part:=20"),=20item);=20/*=20=
no=20newline,=20more=20items=20printed=20below=20*/=0A+=0A+=20=20if=20=
(pc->rel.year=3D=3D0=20&&=20pc->rel.month=3D=3D0=20&&=20pc->rel.day=3D=3D0=
=0A+=20=20=20=20=20=20&&=20pc->rel.hour=3D=3D0=20&&=20=
pc->rel.minutes=3D=3D00=20&&=20pc->rel.seconds=20=3D=3D=200=0A+=20=20=20=20=
=20=20&&=20pc->rel.ns=3D=3D0)=0A+=20=20=20=20{=0A+=20=20=20=20=20=20/*=20=
Special=20case:=20relative=20time=20of=20this/today/now=20*/=0A+=20=20=20=
=20=20=20fputs=20(_("today/this/now\n"),stderr);=0A+=20=20=20=20=20=20=
return=20;=0A+=20=20=20=20}=0A+=0A+#define=20PRINT_REL_PART(x,name)=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
\=0A+=20=20do=20{=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20\=0A+=20=20=20=20if=20(=20(pc->rel.x)=20!=3D=200=20)=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20\=0A+=20=20=20=20=20=20fprintf=20(stderr,"%+ld=20%s=20",=20=
pc->rel.x,=20name);=20=20=20=20=20=20\=0A+=20=20}=20while=20(0)=0A+=0A+=20=
=20PRINT_REL_PART=20(year,"year(s)");=0A+=20=20PRINT_REL_PART=20=
(month,"month(s)");=0A+=20=20PRINT_REL_PART=20(day,"day(s)");=0A+=20=20=
PRINT_REL_PART=20(hour,"hour(s)");=0A+=20=20PRINT_REL_PART=20=
(minutes,"minutes");=0A+=20=20PRINT_REL_PART=20(seconds,"seconds");=0A+=20=
=20PRINT_REL_PART=20(ns,"nanoseconds");=0A+=0A+=20=20fputc=20=
('\n',stderr);=0A+}=0A+=0A+=0A+=0A=20%}=0A=20=0A=20/*=20We=20want=20a=20=
reentrant=20parser,=20even=20if=20the=20TZ=20manipulation=20and=20the=20=
calls=20to=0A@@=20-330,6=20+576,7=20@@=20timespec:=0A=20=20=20=20=20=20=20=
{=0A=20=20=20=20=20=20=20=20=20pc->seconds=20=3D=20$2;=0A=20=20=20=20=20=20=
=20=20=20pc->timespec_seen=20=3D=20true;=0A+=20=20=20=20=20=20=20=20=
DEBUG_PRINT_CURRENT_TIME=20(_("number=20of=20seconds"),=20pc);=0A=20=20=20=
=20=20=20=20}=0A=20=20=20;=0A=20=0A@@=20-340,20=20+587,47=20@@=20items:=0A=
=20=0A=20item:=0A=20=20=20=20=20datetime=0A-=20=20=20=20=20=20{=20=
pc->times_seen++;=20pc->dates_seen++;=20}=0A+=20=20=20=20=20=20{=0A+=20=20=
=20=20=20=20=20=20pc->times_seen++;=20pc->dates_seen++;=0A+=20=20=20=20=20=
=20=20=20DEBUG_PRINT_CURRENT_TIME=20(_("datetime"),=20pc);=0A+=20=20=20=20=
=20=20}=0A=20=20=20|=20time=0A-=20=20=20=20=20=20{=20pc->times_seen++;=20=
}=0A+=20=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=20pc->times_seen++;=0A=
+=20=20=20=20=20=20=20=20DEBUG_PRINT_CURRENT_TIME=20(_("time"),=20pc);=0A=
+=20=20=20=20=20=20}=0A=20=20=20|=20local_zone=0A-=20=20=20=20=20=20{=20=
pc->local_zones_seen++;=20}=0A+=20=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=
=20pc->local_zones_seen++;=0A+=20=20=20=20=20=20=20=20=
DEBUG_PRINT_CURRENT_TIME=20(_("local_zone"),=20pc);=0A+=20=20=20=20=20=20=
}=0A=20=20=20|=20zone=0A-=20=20=20=20=20=20{=20pc->zones_seen++;=20}=0A+=20=
=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=20pc->zones_seen++;=0A+=20=20=20=
=20=20=20=20=20DEBUG_PRINT_CURRENT_TIME=20(_("zone"),=20pc);=0A+=20=20=20=
=20=20=20}=0A=20=20=20|=20date=0A-=20=20=20=20=20=20{=20=
pc->dates_seen++;=20}=0A+=20=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=20=
pc->dates_seen++;=0A+=20=20=20=20=20=20=20=20DEBUG_PRINT_CURRENT_TIME=20=
(_("date"),=20pc);=0A+=20=20=20=20=20=20}=0A=20=20=20|=20day=0A-=20=20=20=
=20=20=20{=20pc->days_seen++;=20}=0A+=20=20=20=20=20=20{=0A+=20=20=20=20=20=
=20=20=20pc->days_seen++;=0A+=20=20=20=20=20=20=20=20=
DEBUG_PRINT_CURRENT_TIME=20(_("day"),=20pc);=0A+=20=20=20=20=20=20}=0A=20=
=20=20|=20rel=0A+=20=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=20=
DEBUG_PRINT_RELATIVE_TIME=20(_("relative"),=20pc);=0A+=20=20=20=20=20=20=
}=0A=20=20=20|=20number=0A+=20=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=20=
DEBUG_PRINT_RELATIVE_TIME=20(_("number"),=20pc);=0A+=20=20=20=20=20=20}=0A=
=20=20=20|=20hybrid=0A+=20=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=20=
DEBUG_PRINT_RELATIVE_TIME=20(_("hybrid"),=20pc);=0A+=20=20=20=20=20=20}=0A=
=20=20=20;=0A=20=0A=20datetime:=0A@@=20-463,11=20+737,13=20@@=20day:=0A=20=
=20=20=20=20=20=20{=0A=20=20=20=20=20=20=20=20=20pc->day_ordinal=20=3D=20=
$1;=0A=20=20=20=20=20=20=20=20=20pc->day_number=20=3D=20$2;=0A+=20=20=20=20=
=20=20=20=20pc->debug_ordinal_day_seen=20=3D=20true;=0A=20=20=20=20=20=20=
=20}=0A=20=20=20|=20tUNUMBER=20tDAY=0A=20=20=20=20=20=20=20{=0A=20=20=20=20=
=20=20=20=20=20pc->day_ordinal=20=3D=20$1.value;=0A=20=20=20=20=20=20=20=20=
=20pc->day_number=20=3D=20$2;=0A+=20=20=20=20=20=20=20=20=
pc->debug_ordinal_day_seen=20=3D=20true;=0A=20=20=20=20=20=20=20}=0A=20=20=
=20;=0A=20=0A@@=20-486,12=20+762,18=20@@=20date:=0A=20=20=20=20=20=20=20=20=
=20=20=20=20you=20want=20portability,=20use=20the=20ISO=208601=20format.=20=
=20*/=0A=20=20=20=20=20=20=20=20=20if=20(4=20<=3D=20$1.digits)=0A=20=20=20=
=20=20=20=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=20=20=20=20=20DEBUG=20=
(_("warning:=20value=20%ld=20has=20%"PRIuMAX"=20digits.=20"=20\=0A+=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20"Assuming=20=
YYYY/MM/DD\n"),=20$1.value,=20$1.digits);=0A+=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20pc->year=20=3D=20$1;=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
pc->month=20=3D=20$3.value;=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
pc->day=20=3D=20$5.value;=0A=20=20=20=20=20=20=20=20=20=20=20}=0A=20=20=20=
=20=20=20=20=20=20else=0A=20=20=20=20=20=20=20=20=20=20=20{=0A+=20=20=20=20=
=20=20=20=20=20=20=20=20DEBUG=20(_("warning:=20value=20%ld=20has=20less=20=
than=204=20digits.=20"=20\=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20"Assuming=20MM/DD/YY[YY]\n"),=20$1.value);=0A+=0A=20=20=
=20=20=20=20=20=20=20=20=20=20=20pc->month=20=3D=20$1.value;=0A=20=20=20=20=
=20=20=20=20=20=20=20=20=20pc->day=20=3D=20$3.value;=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20pc->year=20=3D=20$5;=0A@@=20-905,7=20+1187,11=20@@=20=
to_year=20(textint=20textyear)=0A=20=20=20/*=20XPG4=20suggests=20that=20=
years=2000-68=20map=20to=202000-2068,=20and=0A=20=20=20=20=20=20years=20=
69-99=20map=20to=201969-1999.=20=20*/=0A=20=20=20else=20if=20=
(textyear.digits=20=3D=3D=202)=0A-=20=20=20=20year=20+=3D=20year=20<=20=
69=20?=202000=20:=201900;=0A+=20=20=20=20{=0A+=20=20=20=20=20=20year=20=
+=3D=20year=20<=2069=20?=202000=20:=201900;=0A+=20=20=20=20=20=20DEBUG=20=
(_("warning:=20adjusting=20year=20value=20%ld=20to=20%ld\n"),=0A+=20=20=20=
=20=20=20=20=20=20=20=20=20=20textyear.value,=20year);=0A+=20=20=20=20}=0A=
=20=0A=20=20=20return=20year;=0A=20}=0A@@=20-1170,7=20+1456,10=20@@=20=
yylex=20(union=20YYSTYPE=20*lvalp,=20parser_control=20*pc)=0A=20=20=20=20=
=20=20=20=20=20=20=20*p=20=3D=20'\0';=0A=20=20=20=20=20=20=20=20=20=20=20=
tp=20=3D=20lookup_word=20(pc,=20buff);=0A=20=20=20=20=20=20=20=20=20=20=20=
if=20(!=20tp)=0A-=20=20=20=20=20=20=20=20=20=20=20=20return=20'?';=0A+=20=
=20=20=20=20=20=20=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20DEBUG=20(_("error:=20unknown=20word=20'%s'\n"),=20buff);=0A+=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20return=20'?';=0A+=20=20=20=20=20=20=20=20=
=20=20=20=20}=0A=20=20=20=20=20=20=20=20=20=20=20lvalp->intval=20=3D=20=
tp->value;=0A=20=20=20=20=20=20=20=20=20=20=20return=20tp->type;=0A=20=20=
=20=20=20=20=20=20=20}=0A@@=20-1230,6=20+1519,10=20@@=20mktime_ok=20=
(struct=20tm=20const=20*tm0,=20struct=20tm=20const=20*tm1,=20time_t=20t)=0A=
=20=20=20=20Use=20heap=20allocation=20if=20TZ's=20length=20exceeds=20=
this.=20=20*/=0A=20enum=20{=20TZBUFSIZE=20=3D=20100=20};=0A=20=0A+/*=20A=20=
reasonable=20upper=20bound=20for=20the=20buffer=20used=20in=20debug=20=
print=20outs.=0A+=20=20=20see=20'days_to_name()'=20and=20=
'debug_strftime()'=20*/=0A+enum=20{=20DBGBUFSIZE=20=3D=2050=20};=0A+=0A=20=
/*=20Return=20a=20copy=20of=20TZ,=20stored=20in=20TZBUF=20if=20it=20=
fits,=20and=20heap-allocated=0A=20=20=20=20otherwise.=20=20*/=0A=20=
static=20char=20*=0A@@=20-1246,6=20+1539,131=20@@=20get_tz=20(char=20=
tzbuf[TZBUFSIZE])=0A=20=20=20return=20tz;=0A=20}=0A=20=0A+/*=20=
debugging:=20format=20a=20'struct=20tm'=20into=20a=20buffer,=20taking=20=
the=20parser's=0A+=20=20=20timezone=20information=20into=20account=20(if=20=
pc!=3DNULL).=20*/=0A+static=20const=20char*=0A+debug_strfdatetime=20=
(const=20struct=20tm=20*tm,=20const=20parser_control=20*pc,=0A+=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20char*=20/*output*/=20=
buf,=20size_t=20n)=0A+{=0A+=20=20/*=20TODO:=0A+=20=20=20=20=201.=20find=20=
an=20optimal=20way=20to=20print=20date=20string=20in=20a=20clear=20and=20=
unambiguous=0A+=20=20=20=20=20=20=20=20format.=20Currently,=20always=20=
add=20'(Y-M-D)'=20prefix.=0A+=20=20=20=20=20=20=20=20Consider=20=
'2016y01m10d'=20=20or=20'year(2016)=20month(01)=20day(10)'.=0A+=0A+=20=20=
=20=20=20=20=20=20If=20the=20user=20needs=20debug=20printing,=20it=20=
means=20he/she=20already=20having=0A+=20=20=20=20=20=20=20=20issues=20=
with=20the=20parsing=20-=20better=20to=20avoid=20formats=20that=20could=0A=
+=20=20=20=20=20=20=20=20be=20mis-interpreted=20(e.g.=20just=20=
YYYY-MM-DD).=0A+=0A+=20=20=20=20=202.=20Can=20strftime=20be=20used=20=
instead?=0A+=20=20=20=20=20=20=20=20depends=20if=20it=20is=20portable=20=
and=20can=20print=20invalid=20dates=20on=20all=20systems.=0A+=0A+=20=20=20=
=20=203.=20Print=20timezone=20information=20?=0A+=0A+=20=20=20=20=204.=20=
Print=20DST=20information=20?=0A+=0A+=20=20=20=20=205.=20Print=20=
nanosecond=20information=20?=0A+=0A+=20=20=20=20=20NOTE:=0A+=20=20=20=20=20=
Printed=20date/time=20values=20might=20not=20be=20valid,=20e.g.=20=
'2016-02-31'=0A+=20=20=20=20=20or=20'2016-19-2016'=20.=20=20These=20are=20=
the=20values=20as=20parsed=20from=20the=20user=0A+=20=20=20=20=20string,=20=
before=20validation.=0A+=20=20*/=0A+=20=20int=20m=20=3D=20snprintf=20=
(buf,n,"(Y-M-D)=20%04d-%02d-%02d=20%02d:%02d:%02d",=0A+=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20tm->tm_year+1900,=20=
tm->tm_mon+1,=20tm->tm_mday,=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20tm->tm_hour,=20tm->tm_min,=20tm->tm_sec);=0A+=0A+=20=20=
/*=20if=20parser_control=20information=20was=20provided=20(for=20=
timezone),=0A+=20=20=20=20=20and=20there's=20enough=20space=20in=20the=20=
buffer=20-=20add=20timezone=20info=20*/=0A+=20=20if=20(pc=20!=3D=20NULL=20=
&&=20((n-m)>0))=0A+=20=20=20=20{=0A+=20=20=20=20=20=20const=20long=20int=20=
tz=20=3D=20(pc->zones_seen=20||=20pc->local_zones_seen)=0A+=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?=20=
pc->time_zone=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20:=20pc->debug_default_input_timezone;=0A+=20=20=20=20=
=20=20snprintf=20(&buf[m],n-m,"=20TZ=3D%+03d:%02d",=20(int)(tz/60),=20=
abs=20((int)tz)%60);=0A+=20=20=20=20}=0A+=20=20return=20buf;=0A+}=0A+=0A=
+static=20const=20char*=0A+debug_strfdate=20(const=20struct=20tm=20*tm,=20=
char*=20/*output*/=20buf,=20size_t=20n)=0A+{=0A+=20=20snprintf=20=
(buf,n,"(Y-M-D)=20%04d-%02d-%02d",=0A+=20=20=20=20=20=20=20=20=20=20=20=20=
tm->tm_year+1900,=20tm->tm_mon+1,=20tm->tm_mday);=0A+=20=20return=20buf;=0A=
+}=0A+=0A+static=20const=20char*=0A+debug_strftime=20(const=20struct=20=
tm=20*tm,=20char*=20/*output*/=20buf,=20size_t=20n)=0A+{=0A+=20=20=
snprintf=20(buf,n,"%02d:%02d:%02d",=20tm->tm_hour,=20tm->tm_min,=20=
tm->tm_sec);=0A+=20=20return=20buf;=0A+}=0A+=0A+/*=20If=20'mktime_ok()'=20=
failed,=20display=20the=20failed=20time=20values,=0A+=20=20=20and=20=
provide=20possible=20hints.=20Example=20output:=0A+=0A+=20=20=20=20date:=20=
error:=20invalid=20date/time=20value:=0A+=20=20=20=20date:=20=20=20=20=20=
user=20provided=20time:=20'(Y-M-D)=202006-04-02=2002:45:00'=0A+=20=20=20=20=
date:=20=20=20=20=20=20=20=20normalized=20time:=20'(Y-M-D)=202006-04-02=20=
03:45:00'=0A+=20=20=20=20date:=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20__=0A+=20=20=20=20date:=20=20=20=20=20=20possible=20=
reasons:=0A+=20=20=20=20date:=20=20=20=20=20=20=20=20non-existing=20due=20=
to=20daylight-saving=20time;=0A+=20=20=20=20date:=20=20=20=20=20=20=20=20=
numeric=20values=20overflow;=0A+=20=20=20=20date:=20=20=20=20=20=20=20=20=
missing=20timezone;=0A+=20*/=0A+static=20void=0A+debug_mktime_not_ok=20=
(struct=20tm=20const=20*tm0,=20struct=20tm=20const=20*tm1,=0A+=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20const=20=
parser_control=20*pc,=20=20bool=20time_zone_seen)=0A+{=0A+=20=20/*=20=
TODO:=20handle=20t=3D=3D-1=20(as=20in=20'mktime_ok')=20*/=0A+=20=20char=20=
tmp[DBGBUFSIZE];=0A+=0A+=20=20const=20bool=20eq_sec=20=20=20=3D=20=
(tm0->tm_sec=20=20=3D=3D=20tm1->tm_sec);=0A+=20=20const=20bool=20eq_min=20=
=20=20=3D=20(tm0->tm_min=20=20=3D=3D=20tm1->tm_min);=0A+=20=20const=20=
bool=20eq_hour=20=20=3D=20(tm0->tm_hour=20=3D=3D=20tm1->tm_hour);=0A+=20=20=
const=20bool=20eq_mday=20=20=3D=20(tm0->tm_mday=20=3D=3D=20=
tm1->tm_mday);=0A+=20=20const=20bool=20eq_month=20=3D=20(tm0->tm_mon=20=20=
=3D=3D=20tm1->tm_mon);=0A+=20=20const=20bool=20eq_year=20=20=3D=20=
(tm0->tm_year=20=3D=3D=20tm1->tm_year);=0A+=0A+=20=20const=20bool=20=
dst_shift=20=3D=20eq_sec=20&&=20eq_min=20&&=20!eq_hour=0A+=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20&&=20eq_mday=20=
&&=20eq_month=20&&=20eq_year;=0A+=0A+=20=20DEBUG0=20("error:=20invalid=20=
date/time=20value:\n");=0A+=20=20DEBUG=20(_("=20=20=20=20user=20provided=20=
time:=20'%s'\n"),=0A+=20=20=20=20=20=20=20=20debug_strfdatetime=20(tm0,=20=
pc,=20tmp,=20sizeof=20(tmp)));=0A+=20=20DEBUG=20(_("=20=20=20=20=20=20=20=
normalized=20time:=20'%s'\n"),=0A+=20=20=20=20=20=20=20=20=
debug_strfdatetime=20(tm1,=20pc,=20tmp,=20sizeof=20(tmp)));=0A+=20=20/*=20=
NOTEs:=20the=20format=20must=20be=20aligned=20with=20=20=
debug_strfdatetime().=0A+=20=20=20=20=20=20=20=20=20=20=20=20this=20=
string=20is=20not=20translated.=20*/=0A+=20=20DEBUG=20("=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20%4s=20%2s=20%2s=20%2s=20%2s=20%2s\n",=0A+=20=20=20=20=20=20=20=20=20=
eq_year?"":"----",=20eq_month?"":"--",=20eq_mday?"":"--",=0A+=20=20=20=20=
=20=20=20=20=20eq_hour?"":"--",=20eq_min?"":"--",=20eq_sec?"":"--");=0A+=0A=
+=20=20DEBUG0=20(_("=20=20=20=20=20possible=20reasons:\n"));=0A+=20=20if=20=
(dst_shift)=0A+=20=20=20=20DEBUG0=20(_("=20=20=20=20=20=20=20=
non-existing=20due=20to=20daylight-saving=20time;\n"));=0A+=20=20if=20=
(!eq_mday=20&&=20!eq_month)=0A+=20=20=20=20DEBUG0=20(_("=20=20=20=20=20=20=
=20invalid=20day/month=20combination;\n"));=0A+=20=20DEBUG0=20(_("=20=20=20=
=20=20=20=20numeric=20values=20overflow;\n"));=0A+=20=20DEBUG=20("=20=20=20=
=20=20=20=20%s\n",time_zone_seen?_("incorrect=20timezone")=0A+=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20:_("missing=20timezone"));=0A+}=0A+=0A+=0A+/*=20=
Returns=20the=20effective=20local=20timezone,=20in=20minutes.=20*/=0A=
+static=20long=20int=0A+get_effective_timezone=20(void)=0A+{=0A+=20=20/*=20=
TODO:=20check=20for=20failures=20*/=0A+=20=20const=20time_t=20z=20=3D=20=
0;=0A+=20=20time_t=20lz=20;=0A+=20=20struct=20tm=20*ltm;=0A+=20=20ltm=20=
=3D=20localtime=20(&z);=0A+=20=20lz=20=3D=20timegm=20(ltm)/60;=0A+=20=20=
return=20(long=20int)lz;=0A+}=0A+=0A+=0A=20/*=20Parse=20a=20date/time=20=
string,=20storing=20the=20resulting=20time=20value=20into=20*RESULT.=0A=20=
=20=20=20The=20string=20itself=20is=20pointed=20to=20by=20P.=20=20Return=20=
true=20if=20successful.=0A=20=20=20=20P=20can=20be=20an=20incomplete=20=
or=20relative=20time=20specification;=20if=20so,=20use=0A@@=20-1266,6=20=
+1684,8=20@@=20parse_datetime=20(struct=20timespec=20*result,=20char=20=
const=20*p,=0A=20=20=20char=20*tz0=20=3D=20NULL;=0A=20=20=20char=20=
tz0buf[TZBUFSIZE];=0A=20=20=20bool=20ok=20=3D=20true;=0A+=20=20char=20=
dbg_ord[DBGBUFSIZE];=0A+=20=20char=20dbg_tm[DBGBUFSIZE];=0A=20=0A=20=20=20=
if=20(!=20now)=0A=20=20=20=20=20{=0A@@=20-1351,6=20+1771,14=20@@=20=
parse_datetime=20(struct=20timespec=20*result,=20char=20const=20*p,=0A=20=
=20=20pc.local_zones_seen=20=3D=200;=0A=20=20=20pc.dsts_seen=20=3D=200;=0A=
=20=20=20pc.zones_seen=20=3D=200;=0A+=20=20pc.debug_dates_seen=20=3D=20=
0;=0A+=20=20pc.debug_days_seen=20=3D=200;=0A+=20=20pc.debug_times_seen=20=
=3D=200;=0A+=20=20pc.debug_local_zones_seen=20=3D=200;=0A+=20=20=
pc.debug_dsts_seen=20=3D=200;=0A+=20=20pc.debug_zones_seen=20=3D=200;=0A=
+=20=20pc.debug_ordinal_day_seen=20=3D=20false;=0A+=20=20=
pc.debug_default_input_timezone=20=3D=200;=0A=20=0A=20#if=20=
HAVE_STRUCT_TM_TM_ZONE=0A=20=20=20pc.local_time_zone_table[0].name=20=3D=20=
tmp->tm_zone;=0A@@=20-1410,8=20+1838,60=20@@=20parse_datetime=20(struct=20=
timespec=20*result,=20char=20const=20*p,=0A=20=20=20=20=20=20=20=
pc.local_time_zone_table[1].name=20=3D=20NULL;=0A=20=20=20=20=20}=0A=20=0A=
+=20=20pc.debug_default_input_timezone=20=3D=20get_effective_timezone=20=
();=0A+=0A=20=20=20if=20(yyparse=20(&pc)=20!=3D=200)=0A-=20=20=20=20goto=20=
fail;=0A+=20=20=20=20{=0A+=20=20=20=20=20=20DEBUG=20(_("error:=20parsing=20=
failed,=20stopped=20at=20'%s'\n"),=20pc.input);=0A+=20=20=20=20=20=20=
goto=20fail;=0A+=20=20=20=20}=0A+=0A+=20=20/*=20determine=20effective=20=
timezone=20source=20*/=0A+=20=20if=20(parse_datetime_debug)=0A+=20=20=20=20=
{=0A+=20=20=20=20=20=20long=20int=20tz=20=3D=20=
pc.debug_default_input_timezone;=0A+=20=20=20=20=20=20const=20char*=20=
tz_env;=0A+=20=20=20=20=20=20const=20char*=20tz_src;=0A+=0A+=20=20=20=20=20=
=20if=20(pc.timespec_seen)=0A+=20=20=20=20=20=20=20=20{=0A+=20=20=20=20=20=
=20=20=20=20=20tz=20=3D=200=20;=0A+=20=20=20=20=20=20=20=20=20=20tz_src=20=
=3D=20_("'@timespec'=20-=20always=20UTC0");=0A+=20=20=20=20=20=20=20=20}=0A=
+=20=20=20=20=20=20else=20if=20(pc.local_zones_seen=20||=20=
pc.zones_seen)=0A+=20=20=20=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=20=20=
=20tz=20=3D=20pc.time_zone;=0A+=20=20=20=20=20=20=20=20=20=20tz_src=20=3D=20=
_("parsed=20date/time=20string");=0A+=20=20=20=20=20=20=20=20}=0A+=20=20=20=
=20=20=20else=20if=20((tz_env=20=3D=20getenv("TZ")))=0A+=20=20=20=20=20=20=
=20=20{=0A+=20=20=20=20=20=20=20=20=20=20if=20(tz_was_altered)=0A+=20=20=20=
=20=20=20=20=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
snprintf=20(dbg_tm,=20sizeof(dbg_tm),=20_("TZ=3D\"%s\"=20in=20date=20=
string"),=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20tz_env);=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20tz_src=20=
=3D=20dbg_tm;=0A+=20=20=20=20=20=20=20=20=20=20=20=20}=0A+=20=20=20=20=20=
=20=20=20=20=20else=20if=20(STREQ(tz_env,"UTC0"))=0A+=20=20=20=20=20=20=20=
=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20/*=20=
Special=20case:=20using=20'date=20-u'=20simply=20set=20TZ=3DUTC0=20*/=0A=
+=20=20=20=20=20=20=20=20=20=20=20=20=20=20tz_src=20=3D=20_("TZ=3DUTC0=20=
environment=20value=20or=20-u");=0A+=20=20=20=20=20=20=20=20=20=20=20=20=
}=0A+=20=20=20=20=20=20=20=20=20=20else=0A+=20=20=20=20=20=20=20=20=20=20=
=20=20{=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20snprintf=20(dbg_tm,=20=
sizeof(dbg_tm),=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20_("TZ=3D\"%s\"=20environment=20value"),=20tz_env);=0A+=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20tz_src=20=3D=20dbg_tm;=0A+=20=20=20=
=20=20=20=20=20=20=20=20=20}=0A+=20=20=20=20=20=20=20=20}=0A+=20=20=20=20=
=20=20else=0A+=20=20=20=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=20=20=20=
tz_src=20=3D=20_("system=20default");=0A+=20=20=20=20=20=20=20=20}=0A+=0A=
+=20=20=20=20=20=20PROGRESS=20(_("input=20timezone:=20%+03d:%02d=20(set=20=
from=20%s)\n"),=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
(int)(tz/60),=20abs=20((int)tz)%60,=20tz_src);=0A+=0A+=20=20=20=20}=0A=20=
=0A=20=20=20if=20(pc.timespec_seen)=0A=20=20=20=20=20*result=20=3D=20=
pc.seconds;=0A@@=20-1419,7=20+1899,22=20@@=20parse_datetime=20(struct=20=
timespec=20*result,=20char=20const=20*p,=0A=20=20=20=20=20{=0A=20=20=20=20=
=20=20=20if=20(1=20<=20(pc.times_seen=20|=20pc.dates_seen=20|=20=
pc.days_seen=20|=20pc.dsts_seen=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20|=20(pc.local_zones_seen=20+=20pc.zones_seen)))=0A-=20=20=20=20=20=
=20=20=20goto=20fail;=0A+=20=20=20=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=
=20=20=20if=20(parse_datetime_debug)=0A+=20=20=20=20=20=20=20=20=20=20=20=
=20{=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20if=20(pc.times_seen=20=
>=201)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20DEBUG0=20=
("error:=20seen=20multiple=20time=20parts\n");=0A+=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20if=20(pc.dates_seen=20>=201)=0A+=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20DEBUG0=20("error:=20seen=20multiple=20date=20=
parts\n");=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20if=20=
(pc.days_seen=20>=201)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
DEBUG0=20("error:=20seen=20multiple=20days=20parts\n");=0A+=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20if=20(pc.dsts_seen=20>=201)=0A+=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20DEBUG0=20("error:=20seen=20multiple=20=
daylight-saving=20parts\n");=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
if=20(=20(pc.local_zones_seen=20+=20pc.zones_seen)=20>=201)=0A+=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20DEBUG0=20("error:=20seen=20multiple=20=
time-zone=20parts\n");=0A+=20=20=20=20=20=20=20=20=20=20=20=20}=0A+=20=20=
=20=20=20=20=20=20=20=20goto=20fail;=0A+=20=20=20=20=20=20=20=20}=0A=20=0A=
=20=20=20=20=20=20=20tm.tm_year=20=3D=20to_year=20(pc.year)=20-=20=
TM_YEAR_BASE;=0A=20=20=20=20=20=20=20tm.tm_mon=20=3D=20pc.month=20-=201;=0A=
@@=20-1428,14=20+1923,24=20@@=20parse_datetime=20(struct=20timespec=20=
*result,=20char=20const=20*p,=0A=20=20=20=20=20=20=20=20=20{=0A=20=20=20=20=
=20=20=20=20=20=20=20tm.tm_hour=20=3D=20to_hour=20(pc.hour,=20=
pc.meridian);=0A=20=20=20=20=20=20=20=20=20=20=20if=20(tm.tm_hour=20<=20=
0)=0A-=20=20=20=20=20=20=20=20=20=20=20=20goto=20fail;=0A+=20=20=20=20=20=
=20=20=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
const=20char*=20mrd=20=3D=20(pc.meridian=3D=3DMERam)?"am":=0A+=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20(pc.meridian=3D=3DMERpm)?"pm":"";=0A+=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20DEBUG=20(_("error:=20invalid=20hour=20%ld%s\n"),=20=
pc.hour,=20mrd);=0A+=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20goto=20=
fail;=0A+=20=20=20=20=20=20=20=20=20=20=20=20}=0A=20=20=20=20=20=20=20=20=
=20=20=20tm.tm_min=20=3D=20pc.minutes;=0A=20=20=20=20=20=20=20=20=20=20=20=
tm.tm_sec=20=3D=20pc.seconds.tv_sec;=0A+=20=20=20=20=20=20=20=20=20=20=
PROGRESS=20(_("using=20%s=20time=20as=20starting=20value:=20'%s'\n"),=0A=
+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
(pc.times_seen)?_("specified"):_("current"),=0A+=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20debug_strftime=20(&tm,dbg_tm,sizeof=20=
(dbg_tm)));=0A=20=20=20=20=20=20=20=20=20}=0A=20=20=20=20=20=20=20else=0A=
=20=20=20=20=20=20=20=20=20{=0A=20=20=20=20=20=20=20=20=20=20=20=
tm.tm_hour=20=3D=20tm.tm_min=20=3D=20tm.tm_sec=20=3D=200;=0A=20=20=20=20=20=
=20=20=20=20=20=20pc.seconds.tv_nsec=20=3D=200;=0A+=20=20=20=20=20=20=20=20=
=20=20DEBUG0=20("warning:=20using=20midnight=20as=20starting=20time:=20=
00:00:00\n");=0A=20=20=20=20=20=20=20=20=20}=0A=20=0A=20=20=20=20=20=20=20=
/*=20Let=20mktime=20deduce=20tm_isdst=20if=20we=20have=20an=20absolute=20=
time=20stamp.=20=20*/=0A@@=20-1454,7=20+1959,11=20@@=20parse_datetime=20=
(struct=20timespec=20*result,=20char=20const=20*p,=0A=20=20=20=20=20=20=20=
if=20(!=20mktime_ok=20(&tm0,=20&tm,=20Start))=0A=20=20=20=20=20=20=20=20=20=
{=0A=20=20=20=20=20=20=20=20=20=20=20if=20(!=20pc.zones_seen)=0A-=20=20=20=
=20=20=20=20=20=20=20=20=20goto=20fail;=0A+=20=20=20=20=20=20=20=20=20=20=
=20=20{=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20DEBUG_MKTIME_NOT_OK=20=
(&tm0,=20&tm,=20&pc,=20pc.zones_seen);=0A+=0A+=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20goto=20fail;=0A+=20=20=20=20=20=20=20=20=20=20=20=20}=0A=20=
=20=20=20=20=20=20=20=20=20=20else=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20{=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20/*=20Guard=20against=20=
falsely=20reporting=20errors=20near=20the=20time_t=0A@@=20-1478,12=20=
+1987,21=20@@=20parse_datetime=20(struct=20timespec=20*result,=20char=20=
const=20*p,=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20sprintf=20=
(tz1buf,=20"XXX%s%ld:%02d",=20&"-"[time_zone=20<=200],=0A=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
abs_time_zone_hour,=20abs_time_zone_min);=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20if=20(setenv=20("TZ",=20tz1buf,=201)=20!=3D=200)=0A-=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20goto=20fail;=0A+=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20/*=20TODO:=20was=20warn=20()=20+=20print=20errno?=20*/=0A=
+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20DEBUG=20=
(_("error:=20setenv('TZ','%s')=20failed\n"),=20tz1buf);=0A+=0A+=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20goto=20fail;=0A+=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20}=0A=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20tz_was_altered=20=3D=20true;=0A=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20tm=20=3D=20tm0;=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
Start=20=3D=20mktime=20(&tm);=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20if=20(!=20mktime_ok=20(&tm0,=20&tm,=20Start))=0A-=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20goto=20fail;=0A+=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20DEBUG_MKTIME_NOT_OK=20(&tm0,=20&tm,=20&pc,=20pc.zones_seen);=0A+=0A+=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20goto=20fail;=0A+=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20}=0A=20=20=20=20=20=20=20=20=20=
=20=20=20=20}=0A=20=20=20=20=20=20=20=20=20}=0A=20=0A@@=20-1496,19=20=
+2014,58=20@@=20parse_datetime=20(struct=20timespec=20*result,=20char=20=
const=20*p,=0A=20=20=20=20=20=20=20=20=20=20=20tm.tm_isdst=20=3D=20-1;=0A=
=20=20=20=20=20=20=20=20=20=20=20Start=20=3D=20mktime=20(&tm);=0A=20=20=20=
=20=20=20=20=20=20=20=20if=20(Start=20=3D=3D=20(time_t)=20-1)=0A-=20=20=20=
=20=20=20=20=20=20=20=20=20goto=20fail;=0A+=20=20=20=20=20=20=20=20=20=20=
=20=20{=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20DEBUG=20(_("error:=20=
day=20'%s'=20(day=20ordinal=3D%ld=20number=3D%d)=20"=20\=0A+=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20"resulted=20in=20=
an=20invalid=20date:=20'%s'\n"),=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20str_days=20(&pc,dbg_ord,sizeof=20(dbg_ord)),=0A+=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
pc.day_ordinal,pc.day_number,=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20debug_strfdatetime=20(&tm,=20&pc,=20dbg_tm,sizeof=20=
(dbg_tm)));=0A+=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20goto=20=
fail;=0A+=20=20=20=20=20=20=20=20=20=20=20=20}=0A+=0A+=20=20=20=20=20=20=20=
=20=20=20PROGRESS=20(_("new=20start=20date:=20'%s'=20is=20'%s'\n"),=0A+=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20str_days=20=
(&pc,dbg_ord,sizeof=20(dbg_ord)),=0A+=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20debug_strfdatetime=20(&tm,=20&pc,=20=
dbg_tm,sizeof=20(dbg_tm)));=0A+=0A=20=20=20=20=20=20=20=20=20}=0A=20=0A+=20=
=20=20=20=20=20if=20(!pc.dates_seen=20&&=20!pc.days_seen)=0A+=20=20=20=20=
=20=20=20=20PROGRESS=20(_("using=20current=20date=20as=20starting=20=
value:=20'%s'\n"),=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20debug_strfdate=20(&tm,dbg_tm,sizeof=20(dbg_tm)));=0A+=0A+=20=20=20=20=20=
=20if=20(pc.days_seen=20&&=20pc.dates_seen)=0A+=20=20=20=20=20=20=20=20=
DEBUG=20(_("warning:=20day=20(%s)=20ignored=20when=20explicit=20dates=20=
are=20given\n"),=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
str_days=20(&pc,dbg_ord,sizeof=20(dbg_ord)));=0A+=0A+=20=20=20=20=20=20=
PROGRESS=20(_("starting=20date/time:=20'%s'\n"),=0A+=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20debug_strfdatetime=20(&tm,=20&pc,=20=
dbg_tm,sizeof=20(dbg_tm)));=0A+=0A+=0A=20=20=20=20=20=20=20/*=20Add=20=
relative=20date.=20=20*/=0A=20=20=20=20=20=20=20if=20(pc.rel.year=20|=20=
pc.rel.month=20|=20pc.rel.day)=0A=20=20=20=20=20=20=20=20=20{=0A+=20=20=20=
=20=20=20=20=20=20=20if=20((pc.rel.year=20!=3D=200=20||=20pc.rel.month=20=
!=3D0)=20&&=20tm.tm_mday=3D=3D1)=0A+=20=20=20=20=20=20=20=20=20=20=20=20=
DEBUG0=20("warning:=20when=20adding=20relative=20months/years,=20"=20=20=
\=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20"it=20=
is=20recommended=20to=20specify=20the=2015th=20of=20the=20months\n");=0A=
+=0A+=0A+=20=20=20=20=20=20=20=20=20=20if=20(pc.rel.day=20!=3D=200=20&&=20=
tm.tm_hour=3D=3D0)=0A+=20=20=20=20=20=20=20=20=20=20=20=20DEBUG0=20=
("warning:=20when=20adding=20relative=20days,=20"=20=20\=0A+=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20"it=20is=20recommended=20to=20=
specify=2012:00pm\n");=0A+=0A=20=20=20=20=20=20=20=20=20=20=20int=20year=20=
=3D=20tm.tm_year=20+=20pc.rel.year;=0A=20=20=20=20=20=20=20=20=20=20=20=
int=20month=20=3D=20tm.tm_mon=20+=20pc.rel.month;=0A=20=20=20=20=20=20=20=
=20=20=20=20int=20day=20=3D=20tm.tm_mday=20+=20pc.rel.day;=0A=20=20=20=20=
=20=20=20=20=20=20=20if=20(((year=20<=20tm.tm_year)=20^=20(pc.rel.year=20=
<=200))=0A=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20|=20((month=20<=20=
tm.tm_mon)=20^=20(pc.rel.month=20<=200))=0A=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20|=20((day=20<=20tm.tm_mday)=20^=20(pc.rel.day=20<=200)))=0A=
-=20=20=20=20=20=20=20=20=20=20=20=20goto=20fail;=0A+=20=20=20=20=20=20=20=
=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20/*=20TODO:=20=
what=20is=20the=20actual=20error?=20int-value=20wrap-around?=20*/=0A+=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20DEBUG=20(_("error:=20%s:%d\n"),=20=
__FILE__,__LINE__);=0A+=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
goto=20fail;=0A+=20=20=20=20=20=20=20=20=20=20=20=20}=0A=20=20=20=20=20=20=
=20=20=20=20=20tm.tm_year=20=3D=20year;=0A=20=20=20=20=20=20=20=20=20=20=20=
tm.tm_mon=20=3D=20month;=0A=20=20=20=20=20=20=20=20=20=20=20tm.tm_mday=20=
=3D=20day;=0A@@=20-1518,7=20+2075,20=20@@=20parse_datetime=20(struct=20=
timespec=20*result,=20char=20const=20*p,=0A=20=20=20=20=20=20=20=20=20=20=
=20tm.tm_isdst=20=3D=20tm0.tm_isdst;=0A=20=20=20=20=20=20=20=20=20=20=20=
Start=20=3D=20mktime=20(&tm);=0A=20=20=20=20=20=20=20=20=20=20=20if=20=
(Start=20=3D=3D=20(time_t)=20-1)=0A-=20=20=20=20=20=20=20=20=20=20=20=20=
goto=20fail;=0A+=20=20=20=20=20=20=20=20=20=20=20=20{=0A+=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20DEBUG=20(_("error:=20adding=20relative=20date=20=
resulted=20"=20=20\=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20"in=20an=20invalid=20date:=20'%s'\n"),=0A+=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20debug_strfdatetime=20=
(&tm,=20&pc,=20dbg_tm,=20sizeof=20(dbg_tm)));=0A+=0A+=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20goto=20fail;=0A+=20=20=20=20=20=20=20=20=20=20=20=20=
}=0A+=0A+=20=20=20=20=20=20=20=20=20=20PROGRESS=20(_("after=20date=20=
adjustment=20"\=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20"(%+ld=20years,=20%+ld=20months,=20%+ld=20days),\n"),=0A+=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20pc.rel.year,=20=
pc.rel.month,=20pc.rel.day);=0A+=20=20=20=20=20=20=20=20=20=20PROGRESS=20=
(_("=20=20=20=20new=20date/time=20=3D=20'%s'\n"),=0A+=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20debug_strfdatetime=20(&tm,=20&pc,=20=
dbg_tm,=20sizeof=20(dbg_tm)));=0A+=0A=20=20=20=20=20=20=20=20=20}=0A=20=0A=
=20=20=20=20=20=20=20/*=20The=20only=20"output"=20of=20this=20if-block=20=
is=20an=20updated=20Start=20value,=0A@@=20-1533,15=20+2103,29=20@@=20=
parse_datetime=20(struct=20timespec=20*result,=20char=20const=20*p,=0A=20=
=20=20=20=20=20=20=20=20=20=20time_t=20t=20=3D=20Start;=0A=20=20=20=20=20=
=20=20=20=20=20=20struct=20tm=20const=20*gmt=20=3D=20gmtime=20(&t);=0A=20=
=20=20=20=20=20=20=20=20=20=20if=20(!=20gmt)=0A-=20=20=20=20=20=20=20=20=20=
=20=20=20goto=20fail;=0A+=20=20=20=20=20=20=20=20=20=20=20=20{=0A+=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20/*=20TODO:=20use=20'warn(3)'=20+=20=
print=20errno=20?=20*/=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
DEBUG=20(_("error:=20gmtime=20failed=20for=20t=3D%ld\n"),t);=0A+=0A+=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20goto=20fail;=0A+=20=20=20=20=20=20=20=
=20=20=20=20=20}=0A=20=20=20=20=20=20=20=20=20=20=20delta=20-=3D=20=
tm_diff=20(&tm,=20gmt);=0A=20#endif=0A=20=20=20=20=20=20=20=20=20=20=20=
t1=20=3D=20Start=20-=20delta;=0A=20=20=20=20=20=20=20=20=20=20=20if=20=
((Start=20<=20t1)=20!=3D=20(delta=20<=200))=0A-=20=20=20=20=20=20=20=20=20=
=20=20=20goto=20fail;=20=20/*=20time_t=20overflow=20*/=0A+=20=20=20=20=20=
=20=20=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
DEBUG=20(_("error:=20timezone=20%ld=20caused=20time_t=20overflow\n"),=0A=
+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
pc.time_zone);=0A+=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20goto=20=
fail;=20=20/*=20time_t=20overflow=20*/=0A+=20=20=20=20=20=20=20=20=20=20=20=
=20}=0A=20=20=20=20=20=20=20=20=20=20=20Start=20=3D=20t1;=0A=20=20=20=20=20=
=20=20=20=20}=0A=20=0A+=20=20=20=20=20=20PROGRESS=20(_("'%s'=20=3D=20%ld=20=
epoch-seconds\n"),=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
debug_strfdatetime=20(&tm,=20&pc,=20dbg_tm,=20sizeof=20(dbg_tm)),=0A+=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20Start);=0A+=0A=20=20=20=20=20=20=
=20/*=20Add=20relative=20hours,=20minutes,=20and=20seconds.=20=20On=20=
hosts=20that=20support=0A=20=20=20=20=20=20=20=20=20=20leap=20seconds,=20=
ignore=20the=20possibility=20of=20leap=20seconds;=20e.g.,=0A=20=20=20=20=20=
=20=20=20=20=20"+=2010=20minutes"=20adds=20600=20seconds,=20even=20if=20=
one=20of=20them=20is=20a=0A@@=20-1570,7=20+2154,19=20@@=20parse_datetime=20=
(struct=20timespec=20*result,=20char=20const=20*p,=0A=20=20=20=20=20=20=20=
=20=20=20=20=20=20|=20((t3=20<=20t2)=20^=20(d3=20<=200))=0A=20=20=20=20=20=
=20=20=20=20=20=20=20=20|=20((t4=20<=20t3)=20^=20(d4=20<=200))=0A=20=20=20=
=20=20=20=20=20=20=20=20=20=20|=20(t5=20!=3D=20t4))=0A-=20=20=20=20=20=20=
=20=20=20=20goto=20fail;=0A+=20=20=20=20=20=20=20=20=20=20=20=20{=0A+=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20DEBUG0=20("=20error:=20adding=20=
relative=20time=20caused=20an=20overflow\n");=0A+=0A+=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20goto=20fail;=0A+=20=20=20=20=20=20=20=20=20=20=20=20=
}=0A+=0A+=20=20=20=20=20=20=20=20=20=20if=20(pc.rel.hour=20|=20=
pc.rel.minutes=20|=20pc.rel.seconds=20|=20pc.rel.ns=20)=0A+=20=20=20=20=20=
=20=20=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
PROGRESS=20(_("after=20time=20adjustment=20"=20=20=20=20=20\=0A+=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20"(%+ld=20hours,=20=
%+ld=20minutes,=20%+ld=20seconds,=20%+ld=20ns),\n"),=0A+=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
pc.rel.hour,pc.rel.minutes,pc.rel.seconds,pc.rel.ns);=0A+=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20PROGRESS=20(_("=20=20=20=20new=20time=20=3D=20=
%ld=20epoch-seconds\n"),t5);=0A+=20=20=20=20=20=20=20=20=20=20=20=20}=0A=20=
=0A=20=20=20=20=20=20=20=20=20result->tv_sec=20=3D=20t5;=0A=20=20=20=20=20=
=20=20=20=20result->tv_nsec=20=3D=20normalized_ns;=0A@@=20-1586,6=20=
+2182,49=20@@=20parse_datetime=20(struct=20timespec=20*result,=20char=20=
const=20*p,=0A=20=20=20=20=20ok=20&=3D=20(tz0=20?=20setenv=20("TZ",=20=
tz0,=201)=20:=20unsetenv=20("TZ"))=20=3D=3D=200;=0A=20=20=20if=20(tz0=20=
!=3D=20tz0buf)=0A=20=20=20=20=20free=20(tz0);=0A+=0A+=20=20if=20(ok=20&&=20=
parse_datetime_debug)=0A+=20=20=20=20{=0A+=20=20=20=20=20=20/*=20print=20=
local=20timezone=20AFTER=20restoring=20TZ=20(if=20tz_was_altered)*/=0A+=20=
=20=20=20=20=20const=20long=20int=20otz=20=3D=20get_effective_timezone=20=
();=0A+=20=20=20=20=20=20const=20char*=20tz_src;=0A+=20=20=20=20=20=20=
const=20char*=20tz_env;=0A+=0A+=20=20=20=20=20=20if=20((tz_env=20=3D=20=
getenv("TZ")))=0A+=20=20=20=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=20=20=
=20/*=20Special=20case:=20using=20'date=20-u'=20simply=20set=20TZ=3DUTC0=20=
*/=0A+=20=20=20=20=20=20=20=20=20=20if=20(STREQ(tz_env,"UTC0"))=0A+=20=20=
=20=20=20=20=20=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20tz_src=20=3D=20_("TZ=3DUTC0=20envionment=20value=20or=20-u");=0A+=20=20=
=20=20=20=20=20=20=20=20=20=20}=0A+=20=20=20=20=20=20=20=20=20=20else=0A=
+=20=20=20=20=20=20=20=20=20=20=20=20{=0A+=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20snprintf=20(dbg_tm,=20sizeof(dbg_tm),=0A+=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20_("TZ=3D\"%s\"=20=
environment=20value"),=20tz_env);=0A+=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20tz_src=20=3D=20dbg_tm;=0A+=20=20=20=20=20=20=20=20=20=20=20=20}=0A=
+=20=20=20=20=20=20=20=20}=0A+=20=20=20=20=20=20else=0A+=20=20=20=20=20=20=
=20=20{=0A+=20=20=20=20=20=20=20=20=20=20tz_src=20=3D=20_("system=20=
default");=0A+=20=20=20=20=20=20=20=20}=0A+=0A+=20=20=20=20=20=20=
PROGRESS=20(_("output=20timezone:=20%+03d:%02d=20(set=20from=20%s)\n"),=0A=
+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20(int)(otz/60),=20abs=20=
((int)otz)%60,=20tz_src);=0A+=0A+=0A+=20=20=20=20=20=20PROGRESS=20=
(_("final:=20%ld.%09ld=20(epoch-seconds)\n"),=0A+=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20result->tv_sec,result->tv_nsec);=0A+=0A+=20=20=20=
=20=20=20struct=20tm=20const=20*gmt=20=3D=20gmtime=20(&result->tv_sec);=0A=
+=20=20=20=20=20=20PROGRESS=20(_("final:=20%s=20(UTC0)\n"),=0A+=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20debug_strfdatetime=20(gmt,=20NULL,=20=
dbg_tm,=20sizeof=20(dbg_tm)));=0A+=20=20=20=20=20=20struct=20tm=20const=20=
*lmt=20=3D=20localtime=20(&result->tv_sec);=0A+=20=20=20=20=20=20=
PROGRESS=20(_("final:=20%s=20(output=20timezone=20TZ=3D%+03d:%02d)\n"),=0A=
+=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20debug_strfdatetime=20=
(lmt,=20NULL,=20dbg_tm,=20sizeof=20(dbg_tm)),=0A+=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20(int)(otz/60),=20abs=20((int)otz)%60);=0A+=20=20=20=
=20}=0A+=0A=20=20=20return=20ok;=0A=20}=0A=20=0Adiff=20--git=20=
a/modules/parse-datetime=20b/modules/parse-datetime=0Aindex=20=
fb48136..72b41dd=20100644=0A---=20a/modules/parse-datetime=0A+++=20=
b/modules/parse-datetime=0A@@=20-13,11=20+13,13=20@@=20Depends-on:=0A=20=
c-ctype=0A=20stdbool=0A=20gettime=0A+gettext-h=0A=20intprops=0A=20mktime=0A=
=20setenv=0A=20unsetenv=0A=20time=0A+timegm=0A=20verify=0A=20xalloc=0A=20=
=0A--=20=0A2.7.0=0A=0A=

--Apple-Mail=_486DBABB-CE1F-49CB-BAD3-3BAB93443723
Content-Disposition: attachment;
	filename=coreutils-0001-date-add-debug-option.patch
Content-Type: application/octet-stream;
	name="coreutils-0001-date-add-debug-option.patch"
Content-Transfer-Encoding: quoted-printable

=46rom=20bbeaaa332d6be7c6cca991eb0a12feaf03b70962=20Mon=20Sep=2017=20=
00:00:00=202001=0AFrom:=20Assaf=20Gordon=20<assafgordon@gmail.com>=0A=
Date:=20Thu,=2011=20Feb=202016=2020:00:09=20-0500=0ASubject:=20[PATCH]=20=
date:=20add=20'--debug'=20option=0A=0A*=20src/date.c:=20(main):=20add=20=
'--debug'=20option,=20enable=20debugging=0A=20=20=20in=20gnulib's=20=
parse-datetime.y=20module.=0A*=20tests/misc/date.pl:=20repeat=20tests=20=
with=20'--debug'=20enable,=20ensure=0A=20=20=20no=20regression.=0A*=20=
tests/misc/date-debug.sh:=20test=20output=20of=20'--debug'=20option.=0A*=20=
tests/local.mk:=20add=20above=20test.=0A*=20NEWS:=20mention=20new=20=
option.=0A*=20doc/coreutils.texi:=20likewise.=0A---=0A=20NEWS=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20|=20=20=205=20+++=0A=20=
doc/coreutils.texi=20=20=20=20=20=20=20|=20=20=208=20+++-=0A=20=
src/date.c=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20|=20=2013=20=
+++++-=0A=20tests/local.mk=20=20=20=20=20=20=20=20=20=20=20|=20=20=201=20=
+=0A=20tests/misc/date-debug.sh=20|=20102=20=
+++++++++++++++++++++++++++++++++++++++++++++++=0A=20tests/misc/date.pl=20=
=20=20=20=20=20=20|=20=2029=20++++++++++++++=0A=206=20files=20changed,=20=
155=20insertions(+),=203=20deletions(-)=0A=20create=20mode=20100755=20=
tests/misc/date-debug.sh=0A=0Adiff=20--git=20a/NEWS=20b/NEWS=0Aindex=20=
6018aa9..d9f7292=20100644=0A---=20a/NEWS=0A+++=20b/NEWS=0A@@=20-38,6=20=
+38,11=20@@=20GNU=20coreutils=20NEWS=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20-*-=20=
outline=20-*-=0A=20=20=20=20stat=20-f=20--format=3D%T=20now=20reports=20=
the=20file=20system=20type,=20and=20tail=20-f=20uses=0A=20=20=20=20=
polling=20for=20"prl_fs",=20inotify=20for=20"m1fs",=20and=20attempts=20=
inotify=20for=20"wslfs".=0A=20=0A+**=20New=20Features=0A+=0A+=20=20=20=
date=20now=20accepts=20the=20--debug=20option,=20to=20annotate=20the=20=
parsed=20date=20string,=0A+=20=20=20display=20timezone=20information,=20=
and=20warn=20about=20potential=20misuse.=0A+=0A=20=0A=20*=20Noteworthy=20=
changes=20in=20release=208.25=20(2016-01-20)=20[stable]=0A=20=0Adiff=20=
--git=20a/doc/coreutils.texi=20b/doc/coreutils.texi=0Aindex=20=
5630201..a9029df=20100644=0A---=20a/doc/coreutils.texi=0A+++=20=
b/doc/coreutils.texi=0A@@=20-521,8=20+521,8=20@@=20Include=20the=20=
version=20number,=20machine=20architecture,=20input=20files,=20and=0A=20=
any=20other=20information=20needed=20to=20reproduce=20the=20bug:=20your=20=
input,=20what=20you=0A=20expected,=20what=20you=20got,=20and=20why=20it=20=
is=20wrong.=0A=20=0A-If=20you=20have=20a=20problem=20with=20=
@command{sort},=20try=20running=20@samp{sort=0A---debug},=20as=20it=20=
can=20can=20often=20help=20find=20and=20fix=20problems=20without=0A+If=20=
you=20have=20a=20problem=20with=20@command{sort}=20or=20@command{date},=20=
try=20using=20the=0A+@option{--debug}=20option,=20as=20it=20can=20can=20=
often=20help=20find=20and=20fix=20problems=20without=0A=20having=20to=20=
wait=20for=20an=20answer=20to=20a=20bug=20report.=20=20If=20the=20debug=20=
output=0A=20does=20not=20suffice=20to=20fix=20the=20problem=20on=20your=20=
own,=20please=20compress=20and=0A=20attach=20it=20to=20the=20rest=20of=20=
your=20bug=20report.=0A@@=20-15385,6=20+15385,10=20@@=20date=20-d=20=
"$(LC_TIME=3DC=20date)"=0A=20@end=20example=0A=20@xref{Date=20input=20=
formats}.=0A=20=0A+@item=20--debug=0A+annotate=20the=20parsed=20date,=20=
display=20the=20effective=20time=20zone,=20and=20warn=20about=0A=
+potential=20misuse.=0A+=0A=20@item=20-f=20@var{datefile}=0A=20@itemx=20=
--file=3D@var{datefile}=0A=20@opindex=20-f=0Adiff=20--git=20a/src/date.c=20=
b/src/date.c=0Aindex=20e73196b..8819432=20100644=0A---=20a/src/date.c=0A=
+++=20b/src/date.c=0A@@=20-78,7=20+78,8=20@@=20static=20char=20const=20=
rfc_2822_format[]=20=3D=20"%a,=20%d=20%b=20%Y=20%H:%M:%S=20%z";=0A=20=20=20=
=20non-character=20as=20a=20pseudo=20short=20option,=20starting=20with=20=
CHAR_MAX=20+=201.=20=20*/=0A=20enum=0A=20{=0A-=20=20RFC_3339_OPTION=20=3D=20=
CHAR_MAX=20+=201=0A+=20=20RFC_3339_OPTION=20=3D=20CHAR_MAX=20+=201,=0A+=20=
=20DEBUG_DATE_PARSING=0A=20};=0A=20=0A=20static=20char=20const=20=
short_options[]=20=3D=20"d:f:I::r:Rs:u";=0A@@=20-86,6=20+87,7=20@@=20=
static=20char=20const=20short_options[]=20=3D=20"d:f:I::r:Rs:u";=0A=20=
static=20struct=20option=20const=20long_options[]=20=3D=0A=20{=0A=20=20=20=
{"date",=20required_argument,=20NULL,=20'd'},=0A+=20=20{"debug",=20=
no_argument,=20NULL,=20DEBUG_DATE_PARSING},=0A=20=20=20{"file",=20=
required_argument,=20NULL,=20'f'},=0A=20=20=20{"iso-8601",=20=
optional_argument,=20NULL,=20'I'},=0A=20=20=20{"reference",=20=
required_argument,=20NULL,=20'r'},=0A@@=20-133,6=20+135,12=20@@=20=
Display=20the=20current=20time=20in=20the=20given=20FORMAT,=20or=20set=20=
the=20system=20date.\n\=0A=20=0A=20=20=20=20=20=20=20fputs=20(_("\=0A=20=20=
=20-d,=20--date=3DSTRING=20=20=20=20=20=20=20=20=20=20display=20time=20=
described=20by=20STRING,=20not=20'now'\n\=0A+"),=20stdout);=0A+=20=20=20=20=
=20=20fputs=20(_("\=0A+=20=20=20=20=20=20--debug=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20annotate=20the=20parsed=20date,\n\=0A+=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
and=20warn=20about=20questionable=20usage=20to=20stderr\n\=0A+"),=20=
stdout);=0A+=20=20=20=20=20=20fputs=20(_("\=0A=20=20=20-f,=20=
--file=3DDATEFILE=20=20=20=20=20=20=20=20like=20--date;=20once=20for=20=
each=20line=20of=20DATEFILE\n\=0A=20"),=20stdout);=0A=20=20=20=20=20=20=20=
fputs=20(_("\=0A@@=20-360,6=20+368,9=20@@=20main=20(int=20argc,=20char=20=
**argv)=0A=20=20=20=20=20=20=20=20=20case=20'd':=0A=20=20=20=20=20=20=20=20=
=20=20=20datestr=20=3D=20optarg;=0A=20=20=20=20=20=20=20=20=20=20=20=
break;=0A+=20=20=20=20=20=20=20=20case=20DEBUG_DATE_PARSING:=0A+=20=20=20=
=20=20=20=20=20=20=20parse_datetime_debug=20=3D=20true;=0A+=20=20=20=20=20=
=20=20=20=20=20break;=0A=20=20=20=20=20=20=20=20=20case=20'f':=0A=20=20=20=
=20=20=20=20=20=20=20=20batch_file=20=3D=20optarg;=0A=20=20=20=20=20=20=20=
=20=20=20=20break;=0Adiff=20--git=20a/tests/local.mk=20b/tests/local.mk=0A=
index=20d3afb6e..43f121c=20100644=0A---=20a/tests/local.mk=0A+++=20=
b/tests/local.mk=0A@@=20-278,6=20+278,7=20@@=20all_tests=20=3D=09=09=09=09=
=09\=0A=20=20=20tests/misc/csplit-heap.sh=09=09=09\=0A=20=20=20=
tests/misc/csplit-io-err.sh=09=09=09\=0A=20=20=20=
tests/misc/csplit-suppress-matched.pl=09=09\=0A+=20=20=
tests/misc/date-debug.sh=09=09=09\=0A=20=20=20tests/misc/date-sec.sh=09=09=
=09\=0A=20=20=20tests/misc/dircolors.pl=09=09=09\=0A=20=20=20=
tests/misc/dirname.pl=09=09=09=09\=0Adiff=20--git=20=
a/tests/misc/date-debug.sh=20b/tests/misc/date-debug.sh=0Anew=20file=20=
mode=20100755=0Aindex=200000000..1f58479=0A---=20/dev/null=0A+++=20=
b/tests/misc/date-debug.sh=0A@@=20-0,0=20+1,102=20@@=0A+#!/bin/sh=0A+#=20=
Test=20'date=20--debug'=20option=0A+=0A+#=20Copyright=20(C)=202004-2016=20=
Free=20Software=20Foundation,=20Inc.=0A+=0A+#=20This=20program=20is=20=
free=20software:=20you=20can=20redistribute=20it=20and/or=20modify=0A+#=20=
it=20under=20the=20terms=20of=20the=20GNU=20General=20Public=20License=20=
as=20published=20by=0A+#=20the=20Free=20Software=20Foundation,=20either=20=
version=203=20of=20the=20License,=20or=0A+#=20(at=20your=20option)=20any=20=
later=20version.=0A+=0A+#=20This=20program=20is=20distributed=20in=20the=20=
hope=20that=20it=20will=20be=20useful,=0A+#=20but=20WITHOUT=20ANY=20=
WARRANTY;=20without=20even=20the=20implied=20warranty=20of=0A+#=20=
MERCHANTABILITY=20or=20FITNESS=20FOR=20A=20PARTICULAR=20PURPOSE.=20=20=
See=20the=0A+#=20GNU=20General=20Public=20License=20for=20more=20=
details.=0A+=0A+#=20You=20should=20have=20received=20a=20copy=20of=20the=20=
GNU=20General=20Public=20License=0A+#=20along=20with=20this=20program.=20=
=20If=20not,=20see=20<http://www.gnu.org/licenses/>.=0A+=0A+.=20=
"${srcdir=3D.}/tests/init.sh";=20path_prepend_=20./src=0A+print_ver_=20=
date=0A+=0A+export=20LC_ALL=3DC=0A+=0A+remove_trailing_spaces()=20{=20=
sed=20's/=20*$//';=20}=0A+=0A+##=0A+##=20Test=201:=20complex=20date=20=
string=0A+##=0A+in1=3D'TZ=3D"Asia/Tokyo"=20Sun,=2090-12-11=20+=203=20=
days=20-=2090=20minutes'=0A+=0A+cat<<EOF>exp1=0A+date:=20parsed=20day=20=
part:=20Sun=20(day=20ordinal=3D0=20number=3D0)=0A+date:=20parsed=20date=20=
part:=20(Y-M-D)=200090-12-11=0A+date:=20parsed=20relative=20part:=20+3=20=
day(s)=0A+date:=20parsed=20relative=20part:=20+3=20day(s)=20-90=20=
minutes=0A+date:=20input=20timezone:=20+09:00=20(set=20from=20=
TZ=3D"Asia/Tokyo"=20in=20date=20string)=0A+date:=20warning:=20adjusting=20=
year=20value=2090=20to=201990=0A+date:=20warning:=20using=20midnight=20=
as=20starting=20time:=2000:00:00=0A+date:=20warning:=20day=20(Sun)=20=
ignored=20when=20explicit=20dates=20are=20given=0A+date:=20starting=20=
date/time:=20'(Y-M-D)=201990-12-11=2000:00:00=20TZ=3D+09:00'=0A+date:=20=
warning:=20when=20adding=20relative=20days,=20it=20is=20recommended=20to=20=
specify=2012:00pm=0A+date:=20after=20date=20adjustment=20(+0=20years,=20=
+0=20months,=20+3=20days),=0A+date:=20=20=20=20=20new=20date/time=20=3D=20=
'(Y-M-D)=201990-12-14=2000:00:00=20TZ=3D+09:00'=0A+date:=20'(Y-M-D)=20=
1990-12-14=2000:00:00=20TZ=3D+09:00'=20=3D=20661100400=20epoch-seconds=0A=
+date:=20after=20time=20adjustment=20(+0=20hours,=20-90=20minutes,=20+0=20=
seconds,=20+0=20ns),=0A+date:=20=20=20=20=20new=20time=20=3D=20661095000=20=
epoch-seconds=0A+date:=20output=20timezone:=20-06:00=20(set=20from=20=
TZ=3D"America/Belize"=20environment=20value)=0A+date:=20final:=20=
661095000.000000000=20(epoch-seconds)=0A+date:=20final:=20(Y-M-D)=20=
1990-12-13=2013:30:00=20(UTC0)=0A+date:=20final:=20(Y-M-D)=201990-12-13=20=
07:30:00=20(output=20timezone=20TZ=3D-06:00)=0A+Thu=20Dec=2013=20=
07:30:00=20CST=201990=0A+EOF=0A+=0A+TZ=3DAmerica/Belize=20date=20--debug=20=
-d=20"$in1"=20>out1s=202>&1=20||=20framework_failure_=0A=
+remove_trailing_spaces=20<=20out1s=20>=20out1=20||=20framework_failure_=0A=
+=0A+compare=20exp1=20out1=20||=20fail=3D1=0A+=0A+##=0A+##=20Test=202:=20=
Invalid=20date=20from=20Coreutils'=20FAQ=0A+##=20=20=20=20=20=20=20=20=20=
(with=20explicit=20timezone=20added)=0A+in2=3D'TZ=3D"America/Edmonton"=20=
2006-04-02=2002:30:00'=0A+cat<<EOF>exp2=0A+date:=20parsed=20date=20part:=20=
(Y-M-D)=202006-04-02=0A+date:=20parsed=20time=20part:=2002:30:00=0A=
+date:=20input=20timezone:=20-07:00=20(set=20from=20=
TZ=3D"America/Edmonton"=20in=20date=20string)=0A+date:=20using=20=
specified=20time=20as=20starting=20value:=20'02:30:00'=0A+date:=20error:=20=
invalid=20date/time=20value:=0A+date:=20=20=20=20=20user=20provided=20=
time:=20'(Y-M-D)=202006-04-02=2002:30:00=20TZ=3D-07:00'=0A+date:=20=20=20=
=20=20=20=20=20normalized=20time:=20'(Y-M-D)=202006-04-02=2003:30:00=20=
TZ=3D-07:00'=0A+date:=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=
=20=20--=0A+date:=20=20=20=20=20=20possible=20reasons:=0A+date:=20=20=20=20=
=20=20=20=20non-existing=20due=20to=20daylight-saving=20time;=0A+date:=20=
=20=20=20=20=20=20=20numeric=20values=20overflow;=0A+date:=20=20=20=20=20=
=20=20=20missing=20timezone=0A+date:=20invalid=20date=20=
'TZ=3D"America/Edmonton"=202006-04-02=2002:30:00'=0A+EOF=0A+=0A+#=20date=20=
should=20return=201=20(error)=20for=20invalid=20date=0A+returns_=201=20=
date=20--debug=20-d=20"$in2"=20>out2s=202>&1=20||=20framework_failure_=0A=
+remove_trailing_spaces=20<=20out2s=20>=20out2=20||=20framework_failure_=0A=
+compare=20exp2=20out2=20||=20fail=3D1=0A+=0A+##=0A+##=20Test=203:=20=
timespec=20(input=20always=20UTC,=20output=20is=20TZ-dependent)=0A+##=0A=
+in3=3D'@1'=0A+cat<<EOF>exp3=0A+date:=20parsed=20number=20of=20seconds=20=
part:=20number=20of=20seconds:=201=0A+date:=20input=20timezone:=20+00:00=20=
(set=20from=20'@timespec'=20-=20always=20UTC0)=0A+date:=20output=20=
timezone:=20-05:00=20(set=20from=20TZ=3D"America/Lima"=20environment=20=
value)=0A+date:=20final:=201.000000000=20(epoch-seconds)=0A+date:=20=
final:=20(Y-M-D)=201970-01-01=2000:00:01=20(UTC0)=0A+date:=20final:=20=
(Y-M-D)=201969-12-31=2019:00:01=20(output=20timezone=20TZ=3D-05:00)=0A=
+Wed=20Dec=2031=2019:00:01=20PET=201969=0A+EOF=0A+=0A+TZ=3DAmerica/Lima=20=
date=20--debug=20-d=20"$in3"=20>out3s=202>&1=20||=20framework_failure_=0A=
+remove_trailing_spaces=20<=20out3s=20>=20out3=20||=20framework_failure_=0A=
+compare=20exp3=20out3=20||=20fail=3D1=0A+=0A+Exit=20$fail=0Adiff=20=
--git=20a/tests/misc/date.pl=20b/tests/misc/date.pl=0Aindex=20=
3454dcc..4449a48=20100755=0A---=20a/tests/misc/date.pl=0A+++=20=
b/tests/misc/date.pl=0A@@=20-314,6=20+314,35=20@@=20foreach=20my=20$t=20=
(@Tests)=0A=20=20=20=20=20=20=20}=0A=20=20=20}=0A=20=0A+#=20Repeat=20all=20=
tests=20with=20--debug=20option,=20ensure=20it=20does=20not=20cause=20=
any=20regression=0A+my=20@debug_tests;=0A+foreach=20my=20$t=20(@Tests)=0A=
+=20=20{=0A+=20=20=20=20#=20Skip=20tests=20with=20EXIT!=3D0=20or=20=
ERR_SUBST=20part=0A+=20=20=20=20#=20(as=20'--debug'=20requires=20its=20=
own=20ERR_SUBST).=0A+=20=20=20=20my=20$exit_val;=0A+=20=20=20=20my=20=
$have_err_subst;=0A+=20=20=20=20foreach=20my=20$e=20(@$t)=0A+=20=20=20=20=
=20=20{=0A+=20=20=20=20=20=20=20=20next=20unless=20ref=20$e=20&&=20ref=20=
$e=20eq=20'HASH';=0A+=20=20=20=20=20=20=20=20$exit_val=20=3D=20=
$e->{EXIT}=20if=20defined=20$e->{EXIT};=0A+=20=20=20=20=20=20=20=20=
$have_err_subst=20=3D=201=20if=20defined=20$e->{ERR_SUBST};=0A+=20=20=20=20=
=20=20}=0A+=20=20=20=20next=20if=20$exit_val=20||=20$have_err_subst;=0A+=0A=
+=20=20=20=20#=20Duplicate=20the=20test,=20add=20'--debug'=20argument=0A=
+=20=20=20=20my=20@newt=20=3D=20@$t;=0A+=20=20=20=20$newt[0]=20=3D=20=
'dbg_'=20.=20$newt[0];=0A+=20=20=20=20$newt[1]=20=3D=20'--debug=20'=20.=20=
$newt[1];=0A+=0A+=20=20=20=20#=20Discard=20all=20debug=20printouts=20=
before=20comparing=20output=0A+=20=20=20=20push=20@newt,=20{ERR_SUBST=20=
=3D>=20q!s/^date:=20.*\n//m!};=0A+=0A+=20=20=20=20push=20@debug_tests,=20=
\@newt;=0A+=20=20}=0A+push=20@Tests,=20@debug_tests;=0A+=0A+=0A=20my=20=
$save_temps=20=3D=20$ENV{DEBUG};=0A=20my=20$verbose=20=3D=20=
$ENV{VERBOSE};=0A=20=0A--=20=0A2.7.0=0A=0A=

--Apple-Mail=_486DBABB-CE1F-49CB-BAD3-3BAB93443723--


From MAILER-DAEMON Sun Apr 24 19:16:09 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1auTG5-0006Tr-PI
	for mharc-coreutils@gnu.org; Sun, 24 Apr 2016 19:16:09 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:60174)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1auTG3-0006RO-Sr
	for coreutils@gnu.org; Sun, 24 Apr 2016 19:16:08 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1auTFz-00052V-Sn
	for coreutils@gnu.org; Sun, 24 Apr 2016 19:16:07 -0400
Received: from mail-qk0-x235.google.com ([2607:f8b0:400d:c09::235]:34054)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1auTFz-00052P-Kt
	for coreutils@gnu.org; Sun, 24 Apr 2016 19:16:03 -0400
Received: by mail-qk0-x235.google.com with SMTP id r184so56479053qkc.1
	for <coreutils@gnu.org>; Sun, 24 Apr 2016 16:16:03 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=from:subject:message-id:date:to:mime-version;
	bh=1l0ODWYcXoxcy8tvwRRqxPirUlEOkuTzttKwfBlPtgo=;
	b=Bl3tpfilWmnab7lpBPF4AEn1VR0d87N3lF9dhKJ6rw71TKRfxqd4WrmNwfif5GbV+3
	2RjcCirdrQZEEyjJ1EdjurFT/p7QJ9VXed/EoYR8ojwsQvOL5hLacmWf8byTOmoWQe/h
	0BGVacTpSBOrZf0HYZNpu1IKHn69KjK4g2XmP9c5JepBkls886tY+lZa9rDXeUYLj0be
	HwwMnCjlVHZggrH28a1IWh5nfmzrgYDUoWf85y/CshA42b4q58OsX3B+mYXr7UiByue6
	Xj2pJe1Je12OBF/73JjbA8UrxWvN8R5ZJgYx6b3UwpdambUkK4/TllVrYC7GuOQ9A9EY
	3q0A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:from:subject:message-id:date:to:mime-version;
	bh=1l0ODWYcXoxcy8tvwRRqxPirUlEOkuTzttKwfBlPtgo=;
	b=mHxgCxm2IljT9CFT1D4ynfdf8XLqOefwnQFkfvyjilOe/5HaCyV0AeG+Gy8tdFFUeO
	boY71AP+9+1JoBffqOiWmHOngxUhgsutooKQkBoTys5yuKKqlPk9HXEaekZsSCfh6w2z
	AMljJ8oLJvqjSnrbZULoqzhxaSkZMDxaGf9AF7/hdWdBTb4hLWQ+sZbjUxbsWjjUmKnN
	92VySEkqULgb6D4fLKQ75WHAnnn/QzW8P+aWkyite0bFxNbFovlfSlAVK4ViEpmjDEmI
	C6jeaRkhFc+zGLfH7DvIePQjvnScDtqVFOOi6/bGqO181VjxRnm1CJplpwV27eTT+MQA
	pU8g==
X-Gm-Message-State: AOPr4FXVRO2gGYEVUvrfuDwOTxw7ZokFhYXiC8IZa2sMY3Stym5k5oo3a9cbPtEQHPEebg==
X-Received: by 10.55.74.9 with SMTP id x9mr35361108qka.81.1461539763309;
	Sun, 24 Apr 2016 16:16:03 -0700 (PDT)
Received: from ix.home (pool-100-38-105-55.nycmny.fios.verizon.net.
	[100.38.105.55]) by smtp.gmail.com with ESMTPSA id
	y129sm6232554qka.33.2016.04.24.16.16.01 for <coreutils@gnu.org>
	(version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
	Sun, 24 Apr 2016 16:16:02 -0700 (PDT)
From: Assaf Gordon <assafgordon@gmail.com>
Content-Type: multipart/mixed;
	boundary="Apple-Mail=_EA3C0D8D-5060-4F6B-A241-729C8EC5E1CC"
Subject: sort/uniq/join: key-comparison code consolidation
Message-Id: <66052E31-947D-42CF-AD08-69B522D58B52@gmail.com>
Date: Sun, 24 Apr 2016 19:15:59 -0400
To: Coreutils <coreutils@gnu.org>
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\))
X-Mailer: Apple Mail (2.2102)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2607:f8b0:400d:c09::235
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 24 Apr 2016 23:16:08 -0000


--Apple-Mail=_EA3C0D8D-5060-4F6B-A241-729C8EC5E1CC
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=us-ascii

Hello all,

continuing an old thread (join/uniq with advanced sorting options)...
  http://lists.gnu.org/archive/html/coreutils/2013-02/msg00082.html

Attached is an updated patch rebased against the latest 'master'.

regards,
 - assaf

P.S.
Just keeping this patch up-to-date, as the previous one did not apply =
any more.
no need for comments unless/until we're ready to include it.



--Apple-Mail=_EA3C0D8D-5060-4F6B-A241-729C8EC5E1CC
Content-Disposition: attachment;
	filename=key-compare-2016-04-24.patch.xz
Content-Type: application/octet-stream;
	name="key-compare-2016-04-24.patch.xz"
Content-Transfer-Encoding: base64

/Td6WFoAAATm1rRGAgAhARYAAAB0L+Wj4lKRdAhdACMcieb23xlCs/29nsUHJCGsvIoDhI8crOcL
e6LQld0aIYg268rrSLblwMPu1Ku4saFIAqWoyLABl59yyqM4k1ToLyp6tzfxS2egC87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tfIwX9Rt5hGegrXqUtKL+Sdi6tWehTIMWx8Lg8tWuR3a7W4YLTUXlteQQIJrcFYFtgNANeoe
iuitTi5gF6cd9N2fuKOgAknqufytIrf/Dv8LcLMnk7I3qpF5swBjWKQfJ7HL2t7g9FLFw1WDstkv
CC+1esOe9dELfexILUd9GjZKSB9l9QYE2JLQ7//VtfVpaWsefesAjFfYNsib4/oAAaToAZKlCcjw
+7WxxGf7AgAAAAAEWVo=
--Apple-Mail=_EA3C0D8D-5060-4F6B-A241-729C8EC5E1CC--


From MAILER-DAEMON Mon Apr 25 02:28:13 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1aua0D-0007cj-Ka
	for mharc-coreutils@gnu.org; Mon, 25 Apr 2016 02:28:13 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:46059)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1aua0A-0007ZO-RC
	for coreutils@gnu.org; Mon, 25 Apr 2016 02:28:12 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1aua05-0008Qb-QJ
	for coreutils@gnu.org; Mon, 25 Apr 2016 02:28:10 -0400
Received: from mout.kundenserver.de ([212.227.126.135]:57049)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1aua05-0008Q5-GY
	for coreutils@gnu.org; Mon, 25 Apr 2016 02:28:05 -0400
Received: from [10.0.2.15] ([217.86.64.216]) by mrelayeu.kundenserver.de
	(mreue003) with ESMTPSA (Nemesis) id 0MCdVO-1b3tef2XmE-009Oth;
	Mon, 25 Apr 2016 08:27:59 +0200
Subject: Re: suggested feautre: "date --debug" - print date parsing diagnostics
To: Assaf Gordon <assafgordon@gmail.com>, =?UTF-8?Q?P=c3=a1draig_Brady?=
	<P@draigBrady.com>
References: <AC91BFB5-9A51-412B-BFA1-4356C885E77F@gmail.com>
	<CE5F75AD-E67E-4C60-9D9B-F3C114C85790@gmail.com>
	<42B22D28-29E9-4D2B-90A1-D8C6B1BC4E09@gmail.com>
	<56A45C6E.2050509@draigBrady.com>
	<D71B7552-36C1-4959-987D-9D9E90E78897@gmail.com>
	<56B43310.8060703@draigBrady.com>
	<2F3B51BA-A5A3-4E19-9640-DFEB0C9E68ED@gmail.com>
	<56BD5FCC.8050607@draigBrady.com>
	<B7528601-1583-44C8-8286-ABAC076DD104@gmail.com>
Cc: Coreutils <coreutils@gnu.org>
From: Bernhard Voelker <mail@bernhard-voelker.de>
Message-ID: <571DB6BF.9050204@bernhard-voelker.de>
Date: Mon, 25 Apr 2016 08:18:39 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.7.1
MIME-Version: 1.0
In-Reply-To: <B7528601-1583-44C8-8286-ABAC076DD104@gmail.com>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:b5VWZLZYpHT6Ng6GdK1dd+VLsMoacxoeW8KWao5g1ThwQVaHaRG
	2OvpgYuU0sMOkSkreLXK6dDaHe12BPbdKIKBMZWQsfiKy0bCzTkv8fEInINHUsy5XSd6fpC
	lxHj7APnO5lAE5gHM9VEPfgfmzASFhz1Y3oYyHiNKIcdikhKFGtTI5quw78dCMdA18vMIWn
	aYuDXBcVFsE9722+E/qTw==
X-UI-Out-Filterresults: notjunk:1;V01:K0:hnUFjusU/8E=:eKWGu80PoQYuCnCrTvRjGp
	4tCwabeAjniPrtAsJHDK9e2sNLFNKONNyDypbjYvMNIY6XY0CLyxNYhfQrC89no+CDHniyZoT
	1oo4PZN+2y/dFgoXohkGfjLDPUBD7wRLp56AcYIMM1NBQp8tMDdsWImvQeMtrHAj1IcGeoaYH
	c7VZKFuP3zQAwnTMjyxn+tOVuui6yOCZ0+fIQ1es5XVLgDhI11O0e8jdY8hEaZ79kozIAyq2z
	BKKQO02b7QCcQiUzCuBTVb7+uOQciRRxOVcV14SsUVJ/O4D5le4lsoLrW2pDDBR7HK4+Q7jy+
	nMy9ExHkkIq6BJ2cgBSpbSxjgliuiX5aL7WGTkIUI4ys7V04xJqlpguaxayIr5ILyBW5bomnu
	5DsxT1D4m32bDEx1x51FNjcvV6l6HOaduIGsPNkSvfC0R5O7p3KH4yrTQhy3LdIdJcGPzmZ2R
	+CvaMJKq4Ufk0V6mO8BIvfHu6BFg2iouSY0NMTc5fPd4K+AvW/aV4MepBzLOAMxMjnJ8hyUVn
	VRa1dbeKRtDOOre5HpRJFzWBrxARWZQnIbg8LiH3b0TrEGiuUdHAuRGhOeaX5/fnMKeBey68+
	t5lMYGOV2zHipKWXqU1FrVsgTPXnNwWewWyXwdOONdqiD5eRaPFsyRyj0628o4zVNOKSi/B1w
	nQzfNx6jQxSDEmxxwHqjKEHF39jIR2Kj/4Cw3K+UiSLqMwD2fTTRZw0mOoe6ppc2Jy64NVXmp
	VUtL7y5KUB1KfgBS
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 212.227.126.135
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Apr 2016 06:28:12 -0000

On 04/25/2016 12:56 AM, Assaf Gordon wrote:
 > From bbeaaa332d6be7c6cca991eb0a12feaf03b70962 Mon Sep 17 00:00:00 2001
 > From: Assaf Gordon <assafgordon@gmail.com>
 > Date: Thu, 11 Feb 2016 20:00:09 -0500
 > Subject: [PATCH] date: add '--debug' option

Awesome work, thanks.

 > * src/date.c: (main): add '--debug' option, enable debugging
 >    in gnulib's parse-datetime.y module.

s/^[ ]*//
There's no need to indent consecutive lines in the commit message.

 > * tests/misc/date.pl: repeat tests with '--debug' enable, ensure
 >    no regression.

Likewise.

 > * tests/misc/date-debug.sh: test output of '--debug' option.
 > * tests/local.mk: add above test.
 > * NEWS: mention new option.
 > * doc/coreutils.texi: likewise.

It's not visible here that this change relies on new gnulib
functionality ... which is not yet committed and therefore
not yet pulled in into coreutils' copy of gnulib.  As passing
over that flag into parse_datetime is quite loose (via a variable
instead of a parameter), that relation/dependency should be
mentioned I suppose.

 > diff --git a/doc/coreutils.texi b/doc/coreutils.texi
 > index 5630201..a9029df 100644
 > --- a/doc/coreutils.texi
 > +++ b/doc/coreutils.texi
 > @@ -15385,6 +15385,10 @@ date -d "$(LC_TIME=C date)"
 >  @end example
 >  @xref{Date input formats}.
 >
 > +@item --debug
 > +annotate the parsed date, display the effective time zone, and warn about
 > +potential misuse.
 > +

Please add "@opindex --debug".

Now just skimming through the test:

> diff --git a/tests/misc/date-debug.sh b/tests/misc/date-debug.sh
> new file mode 100755
> index 0000000..1f58479
> --- /dev/null
> +++ b/tests/misc/date-debug.sh
> @@ -0,0 +1,102 @@
> +#!/bin/sh
> +# Test 'date --debug' option

s/$/.$/

> +
> +# Copyright (C) 2004-2016 Free Software Foundation, Inc.
> +
> +# This program is free software: you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation, either version 3 of the License, or
> +# (at your option) any later version.
> +
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +
> +# You should have received a copy of the GNU General Public License
> +# along with this program.  If not, see<http://www.gnu.org/licenses/>.
> +
> +. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
> +print_ver_ date
> +
> +export LC_ALL=C
> +
> +remove_trailing_spaces() { sed 's/ *$//'; }

It would be better to avoid trailing spaces in the --debug output.
Do you think it's possible?

> +
> +##
> +## Test 1: complex date string
> +##
> +in1='TZ="Asia/Tokyo" Sun, 90-12-11 + 3 days - 90 minutes'
> +
> +cat<<EOF>exp1
> +date: parsed day part: Sun (day ordinal=0 number=0)
> +date: parsed date part: (Y-M-D) 0090-12-11
> +date: parsed relative part: +3 day(s)
> +date: parsed relative part: +3 day(s) -90 minutes
> +date: input timezone: +09:00 (set from TZ="Asia/Tokyo" in date string)
> +date: warning: adjusting year value 90 to 1990
> +date: warning: using midnight as starting time: 00:00:00
> +date: warning: day (Sun) ignored when explicit dates are given
> +date: starting date/time: '(Y-M-D) 1990-12-11 00:00:00 TZ=+09:00'
> +date: warning: when adding relative days, it is recommended to specify 12:00pm
> +date: after date adjustment (+0 years, +0 months, +3 days),
> +date:     new date/time = '(Y-M-D) 1990-12-14 00:00:00 TZ=+09:00'
> +date: '(Y-M-D) 1990-12-14 00:00:00 TZ=+09:00' = 661100400 epoch-seconds
> +date: after time adjustment (+0 hours, -90 minutes, +0 seconds, +0 ns),
> +date:     new time = 661095000 epoch-seconds
> +date: output timezone: -06:00 (set from TZ="America/Belize" environment value)
> +date: final: 661095000.000000000 (epoch-seconds)
> +date: final: (Y-M-D) 1990-12-13 13:30:00 (UTC0)
> +date: final: (Y-M-D) 1990-12-13 07:30:00 (output timezone TZ=-06:00)
> +Thu Dec 13 07:30:00 CST 1990
> +EOF
> +
> +TZ=America/Belize date --debug -d "$in1" >out1s 2>&1 || framework_failure_

... || fail=1

We only use framework_failure_ for unexpected results of commands
not being the subject of the test ... like compare, preparation, etc.

> +remove_trailing_spaces < out1s > out1 || framework_failure_
> +
> +compare exp1 out1 || fail=1
> +
> +##
> +## Test 2: Invalid date from Coreutils' FAQ
> +##         (with explicit timezone added)
> +in2='TZ="America/Edmonton" 2006-04-02 02:30:00'
> +cat<<EOF>exp2
> +date: parsed date part: (Y-M-D) 2006-04-02
> +date: parsed time part: 02:30:00
> +date: input timezone: -07:00 (set from TZ="America/Edmonton" in date string)
> +date: using specified time as starting value: '02:30:00'
> +date: error: invalid date/time value:
> +date:     user provided time: '(Y-M-D) 2006-04-02 02:30:00 TZ=-07:00'
> +date:        normalized time: '(Y-M-D) 2006-04-02 03:30:00 TZ=-07:00'
> +date:                                             --
> +date:      possible reasons:
> +date:        non-existing due to daylight-saving time;
> +date:        numeric values overflow;
> +date:        missing timezone
> +date: invalid date 'TZ="America/Edmonton" 2006-04-02 02:30:00'
> +EOF
> +
> +# date should return 1 (error) for invalid date
> +returns_ 1 date --debug -d "$in2" >out2s 2>&1 || framework_failure_

Likewise:
    ... || fail=1

> +remove_trailing_spaces < out2s > out2 || framework_failure_
> +compare exp2 out2 || fail=1
> +
> +##
> +## Test 3: timespec (input always UTC, output is TZ-dependent)
> +##
> +in3='@1'
> +cat<<EOF>exp3
> +date: parsed number of seconds part: number of seconds: 1
> +date: input timezone: +00:00 (set from '@timespec' - always UTC0)
> +date: output timezone: -05:00 (set from TZ="America/Lima" environment value)
> +date: final: 1.000000000 (epoch-seconds)
> +date: final: (Y-M-D) 1970-01-01 00:00:01 (UTC0)
> +date: final: (Y-M-D) 1969-12-31 19:00:01 (output timezone TZ=-05:00)
> +Wed Dec 31 19:00:01 PET 1969
> +EOF
> +
> +TZ=America/Lima date --debug -d "$in3" >out3s 2>&1 || framework_failure_
> +remove_trailing_spaces < out3s > out3 || framework_failure_
> +compare exp3 out3 || fail=1
> +
> +Exit $fail

Thanks & have a nice day,
Berny


From MAILER-DAEMON Mon Apr 25 05:33:55 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1auctv-0002i6-9q
	for mharc-coreutils@gnu.org; Mon, 25 Apr 2016 05:33:55 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:37015)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1auctp-0002Zn-0s
	for coreutils@gnu.org; Mon, 25 Apr 2016 05:33:53 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1auctl-00073y-0y
	for coreutils@gnu.org; Mon, 25 Apr 2016 05:33:48 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:46481)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1auctk-00073p-S9
	for coreutils@gnu.org; Mon, 25 Apr 2016 05:33:44 -0400
Received: from [192.168.1.80] (unknown [109.76.138.108])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id C5037222;
	Mon, 25 Apr 2016 10:33:42 +0100 (IST)
Subject: Re: suggested feautre: "date --debug" - print date parsing diagnostics
To: Assaf Gordon <assafgordon@gmail.com>
References: <AC91BFB5-9A51-412B-BFA1-4356C885E77F@gmail.com>
	<CE5F75AD-E67E-4C60-9D9B-F3C114C85790@gmail.com>
	<42B22D28-29E9-4D2B-90A1-D8C6B1BC4E09@gmail.com>
	<56A45C6E.2050509@draigBrady.com>
	<D71B7552-36C1-4959-987D-9D9E90E78897@gmail.com>
	<56B43310.8060703@draigBrady.com>
	<2F3B51BA-A5A3-4E19-9640-DFEB0C9E68ED@gmail.com>
	<56BD5FCC.8050607@draigBrady.com>
	<B7528601-1583-44C8-8286-ABAC076DD104@gmail.com>
Cc: Coreutils <coreutils@gnu.org>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <571DE476.4040806@draigBrady.com>
Date: Mon, 25 Apr 2016 10:33:42 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <B7528601-1583-44C8-8286-ABAC076DD104@gmail.com>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 82.195.144.49
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Apr 2016 09:33:53 -0000

On 24/04/16 23:56, Assaf Gordon wrote:
> +# Test 'date --debug' option
> +
> +# Copyright (C) 2004-2016 Free Software Foundation, Inc.

s/2004-//

Also this test may be run on systems without the timezone database?
Do we need to check/skip with something like:

   test "$(TZ=3DAmerica/Belize date +%z)" !=3D '+0000' ||
     skip_ 'Timezone not found'

Great work on this.
It will be a very useful feature.

cheers,
P=E1draig


From MAILER-DAEMON Mon Apr 25 18:21:13 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1auosT-0006Qs-MX
	for mharc-coreutils@gnu.org; Mon, 25 Apr 2016 18:21:13 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:58100)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigbrady.com>) id 1auosR-0006NQ-Fr
	for coreutils@gnu.org; Mon, 25 Apr 2016 18:21:12 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigbrady.com>) id 1auosM-0004h8-Fd
	for coreutils@gnu.org; Mon, 25 Apr 2016 18:21:11 -0400
Received: from mail1.vodafone.ie ([213.233.128.43]:38195)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigbrady.com>) id 1auosM-0004gm-A3
	for coreutils@gnu.org; Mon, 25 Apr 2016 18:21:06 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: ArsFAOiXHldtTIps/2dsb2JhbABegzgeBDF9t2qEERcHhXCBPUwBAQEBAQFmJ4REFmcogUuIDKdJm32FKYpOgXwLQIJDBZgPhXyIHIlOhT4Cjy9igTYBAQiCLDswiQABAQE
Received: from unknown (HELO lt.localdomain) ([109.76.138.108])
	by mail1.vodafone.ie with ESMTP; 25 Apr 2016 23:20:50 +0100
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
To: coreutils@gnu.org
Subject: [PATCH] tests: avoid false failure when df lists no root file system
Date: Mon, 25 Apr 2016 23:20:46 +0100
Message-Id: <1461622846-22913-1-git-send-email-P@draigBrady.com>
X-Mailer: git-send-email 2.5.5
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 213.233.128.43
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 25 Apr 2016 22:21:12 -0000

* tests/df/skip-duplicates.sh: Skip the test when there is no
'/' entry listed by df, which was seen in certain chroot setups.
---
 tests/df/skip-duplicates.sh | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/tests/df/skip-duplicates.sh b/tests/df/skip-duplicates.sh
index 1b980b6..b308234 100755
--- a/tests/df/skip-duplicates.sh
+++ b/tests/df/skip-duplicates.sh
@@ -23,11 +23,12 @@ require_gcc_shared_
 
 # We use --local here so as to not activate
 # potentially very many remote mounts.
-df --local || skip_ 'df fails'
+LOCAL_FS=$(df --local --output=target 2>&1) || skip_ 'df fails'
+echo "$LOCAL_FS" | grep '^/$' || skip_ 'no root file system found'
 
-export CU_NONROOT_FS=$(df --local --output=target 2>&1 | grep /. | head -n1)
-export CU_REMOTE_FS=$(df --local --output=target 2>&1 | grep /. |
-                      tail -n+2 | head -n1)
+# Get real targets to substitute for /NONROOT and /REMOTE below.
+export CU_NONROOT_FS=$(echo "$LOCAL_FS" | grep /. | head -n1)
+export CU_REMOTE_FS=$(echo "$LOCAL_FS" | grep /. | tail -n+2 | head -n1)
 
 unique_entries=1
 test -z "$CU_NONROOT_FS" || unique_entries=$(expr $unique_entries + 1)
-- 
2.5.5



From MAILER-DAEMON Mon Apr 25 22:39:08 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1ausu4-0002w5-C7
	for mharc-coreutils@gnu.org; Mon, 25 Apr 2016 22:39:08 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:50039)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1ausu1-0002rV-SP
	for coreutils@gnu.org; Mon, 25 Apr 2016 22:39:06 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1austx-0002JW-RQ
	for coreutils@gnu.org; Mon, 25 Apr 2016 22:39:05 -0400
Received: from mail-qg0-x233.google.com ([2607:f8b0:400d:c04::233]:34878)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1austx-0002JR-Ma
	for coreutils@gnu.org; Mon, 25 Apr 2016 22:39:01 -0400
Received: by mail-qg0-x233.google.com with SMTP id f74so549296qge.2
	for <coreutils@gnu.org>; Mon, 25 Apr 2016 19:39:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:subject:from:in-reply-to:date:cc:message-id:references
	:to; bh=8/O8Aan04nR+WfFOTd894rxx/pS3t3W2bZH7k2Da7gg=;
	b=KhFuKtIOc+Af5CZ6wPG++cOJZjD4kAx1rfGughJqOQzL5xaw6ESgh+VQT+TQ3bdCs7
	9+GchFfmeGKshn7oAAm5p2q4INdYFxvjmajQ9OLIoYjOgiuYgmaRRDHLHkGHWBBk0V4u
	Xq46g7qgYWb+vJnU0DqjqPAFg3KWYMMjeADktcmOgEAoap5OKmPcfSnj94DmVkLTyb9E
	rU3z6N6njFbgY6SaM8s0FrtB4sHZVnd04TpgvCk+QguiLMTVCaIfJoofG38kcVZ+Ynm7
	SUEkXUft30R+I1PxRQZn/xMT41cGumzFzr36w4Ai4iIPypr/gvkxPc8vXD1pnMNAMeT/
	wvWw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc
	:message-id:references:to;
	bh=8/O8Aan04nR+WfFOTd894rxx/pS3t3W2bZH7k2Da7gg=;
	b=W2M8OszWRone9dLQU5SB4h4GdSrgSERz5c61QDHP9KrdkQwW3tan0DbrhHkJiRh44J
	rqS9ivq/efT2bVLgpAho/cw8GrqRxyvhWXmfS7q6XTY1pFWnlDeEqMpQ9O/P+bHSS+tq
	uvbtWrhsFmYHoau8ZSL4XJLF61gOrzWjWfi/l4t00MbsU2EYLE/OacyBmMJn2cWlS5nc
	EXhg6als2mGE6GHQPPdMqXKFwcqyEkjx14CxyoM7qTxa/DdpDn5zzX/oP41gIvXPuWiQ
	R1j1YbEXshxHGrOq2nTrqoJjfcZkbA9lLLxupmoWCymvrysXv4vtXA92mk3mx8H/4Uen
	FgYA==
X-Gm-Message-State: AOPr4FVv6a32Qv+njhMXfOUG3YxyVvAxgDC+ewAHp/sLwfg840optXdX6HuT43mqLOItyA==
X-Received: by 10.141.46.71 with SMTP id x68mr95134qhe.70.1461638341005;
	Mon, 25 Apr 2016 19:39:01 -0700 (PDT)
Received: from ix.home (pool-100-38-105-55.nycmny.fios.verizon.net.
	[100.38.105.55])
	by smtp.gmail.com with ESMTPSA id p38sm92679qgd.6.2016.04.25.19.38.59
	(version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
	Mon, 25 Apr 2016 19:39:00 -0700 (PDT)
Content-Type: multipart/mixed;
	boundary="Apple-Mail=_E1BB72C3-72B0-44B7-B137-96BDD46C21A0"
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\))
Subject: Re: prevent seq from inflow inflow on I/O errors
From: Assaf Gordon <assafgordon@gmail.com>
In-Reply-To: <3534D2B6-109B-45E2-95A3-8AEB8566F588@gmail.com>
Date: Mon, 25 Apr 2016 22:38:58 -0400
Cc: Coreutils <coreutils@gnu.org>
Message-Id: <6883FEEC-7D8E-4D06-9568-29BCDACA68A3@gmail.com>
References: <788E7E16-EFE1-47D0-96CD-A35FB080BBA6@gmail.com>
	<570256BD.7010302@draigBrady.com>
	<57037EDD.2020604@bernhard-voelker.de>
	<1BC925DA-15D0-4E54-BE80-92AD9D64C0E7@gmail.com>
	<57136AE1.6070007@draigBrady.com>
	<3534D2B6-109B-45E2-95A3-8AEB8566F588@gmail.com>
To: =?utf-8?Q?P=C3=A1draig_Brady?= <P@draigBrady.com>,
	Bernhard Voelker <mail@bernhard-voelker.de>
X-Mailer: Apple Mail (2.2102)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2607:f8b0:400d:c04::233
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 26 Apr 2016 02:39:06 -0000


--Apple-Mail=_E1BB72C3-72B0-44B7-B137-96BDD46C21A0
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=windows-1252

Hello,

> On Apr 24, 2016, at 18:36, Assaf Gordon <assafgordon@gmail.com> wrote:
>=20
> thank you, pushed in:
> =
http://git.savannah.gnu.org/cgit/coreutils.git/commit/?id=3Dc92585b10b29ce=
2c31c69cea52e69ef053c9679f

In the above commit I've neglected to integrate suggestions from =
Bernhard.
Attached an improved patch - comments welcomed.

Sorry for the incomplete commit.

 - assaf


--Apple-Mail=_E1BB72C3-72B0-44B7-B137-96BDD46C21A0
Content-Disposition: attachment;
	filename=0001-seq-improve-epipe-test.patch
Content-Type: application/octet-stream;
	name="0001-seq-improve-epipe-test.patch"
Content-Transfer-Encoding: quoted-printable

=46rom=209e5a95150e0b499d08697f7f6a93ff46cee8a849=20Mon=20Sep=2017=20=
00:00:00=202001=0AFrom:=20Assaf=20Gordon=20<assafgordon@gmail.com>=0A=
Date:=20Mon,=2025=20Apr=202016=2022:14:33=20-0400=0ASubject:=20[PATCH]=20=
seq:=20improve=20epipe=20test=0A=0AFollow-up=20to=20commit=20c92585b1:=20=
improve=20epipe=20test=20script,=20with=0Asuggestions=20from=20Bernhard=20=
Voelker.=0A=0A*=20tests/misc/seq-epipe.sh:=20avoid=20too=20many=20=
subshells,=0A=20=20stricter=20validation=20of=20errors=20and=20output=20=
from=20seq.=0A---=0A=20tests/misc/seq-epipe.sh=20|=2026=20=
+++++++++-----------------=0A=201=20file=20changed,=209=20insertions(+),=20=
17=20deletions(-)=0A=0Adiff=20--git=20a/tests/misc/seq-epipe.sh=20=
b/tests/misc/seq-epipe.sh=0Aindex=2021e9322..5c42c46=20100755=0A---=20=
a/tests/misc/seq-epipe.sh=0A+++=20b/tests/misc/seq-epipe.sh=0A@@=20=
-20,27=20+20,19=20@@=0A=20print_ver_=20seq=0A=20=0A=20#=20upon=20EPIPE=20=
with=20signals=20ignored,=20'seq'=20should=20exit=20with=20an=20error.=0A=
-(trap=20''=20PIPE;=0A-=20timeout=2010=20sh=20-c=20'(=20(seq=20inf=20=
2>err=20;=20echo=20$?>code)=20|=20head=20-n1)'>/dev/null)=0A+timeout=20=
10=20sh=20-c=20\=0A+=20=20'trap=20""=20PIPE=20&&=20{=20seq=20inf=20=
2>err;=20echo=20$?=20>code;=20}=20|=20head=20-n1'=20>out=0A=20=0A=20#=20=
Exit-code=20must=20be=201,=20indicating=20'write=20error'=0A-cat=20<<=20=
\EOF=20>=20exp=20||=20framework_failure_=0A-1=0A-EOF=0A-if=20test=20-e=20=
code=20;=20then=0A-=20=20compare=20exp=20code=20||=20fail=3D1=0A-else=0A=
-=20=20#=20'exitcode'=20file=20was=20not=20created=0A-=20=20warn_=20=
"missing=20exit=20code=20file=20(seq=20failed=20to=20detect=20EPIPE?)"=0A=
-=20=20fail=3D1=0A-fi=0A+echo=201=20>=20exp=20||=20framework_failure_=0A=
+compare=20exp=20out=20||=20fail=3D1=0A+compare=20exp=20code=20||=20=
fail=3D1=0A=20=0A=20#=20The=20error=20message=20must=20begin=20with=20=
"standard=20output:"=0A=20#=20(but=20don't=20hard-code=20the=20strerror=20=
text)=0A-compare_dev_null_=20/dev/null=20err=0A-if=20!=20grep=20-qE=20=
'^seq:=20standard=20output:=20.+$'=20err=20;=20then=0A-=20=20warn_=20=
"seq=20emitted=20incorrect=20error=20on=20EPIPE"=0A-=20=20fail=3D1=0A-fi=0A=
+grep=20'^seq:=20standard=20output:=20'=20err=20\=0A+=20=20||=20{=20=
warn_=20"seq=20emitted=20incorrect=20error=20on=20EPIPE";=20\=0A+=20=20=20=
=20=20=20=20cat=20err;\=0A+=20=20=20=20=20=20=20fail=3D1;=20}=0A=20=0A=20=
Exit=20$fail=0A--=20=0A1.9.0=0A=0A=

--Apple-Mail=_E1BB72C3-72B0-44B7-B137-96BDD46C21A0
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
	charset=windows-1252


 
--Apple-Mail=_E1BB72C3-72B0-44B7-B137-96BDD46C21A0--


From MAILER-DAEMON Tue Apr 26 02:14:52 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1auwGq-0001af-4M
	for mharc-coreutils@gnu.org; Tue, 26 Apr 2016 02:14:52 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:37539)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1auwGo-0001XH-3U
	for coreutils@gnu.org; Tue, 26 Apr 2016 02:14:51 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1auwGk-0006yF-SV
	for coreutils@gnu.org; Tue, 26 Apr 2016 02:14:50 -0400
Received: from mout.kundenserver.de ([212.227.126.134]:52578)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1auwGk-0006y3-Iq
	for coreutils@gnu.org; Tue, 26 Apr 2016 02:14:46 -0400
Received: from [192.168.101.10] ([217.86.64.216]) by mrelayeu.kundenserver.de
	(mreue004) with ESMTPSA (Nemesis) id 0MLkF5-1au6vH3Eix-000qDA;
	Tue, 26 Apr 2016 08:14:44 +0200
Subject: Re: [PATCH] tests: avoid false failure when df lists no root file
	system
To: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>, coreutils@gnu.org
References: <1461622846-22913-1-git-send-email-P@draigBrady.com>
From: Bernhard Voelker <mail@bernhard-voelker.de>
Message-ID: <571F0753.1080107@bernhard-voelker.de>
Date: Tue, 26 Apr 2016 08:14:43 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.6.0
MIME-Version: 1.0
In-Reply-To: <1461622846-22913-1-git-send-email-P@draigBrady.com>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7b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ected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 212.227.126.134
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 26 Apr 2016 06:14:51 -0000

+1

Thanks & have a nice day,
Berny


From MAILER-DAEMON Tue Apr 26 05:33:06 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1auzMg-00048l-N6
	for mharc-coreutils@gnu.org; Tue, 26 Apr 2016 05:33:06 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:36502)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1auzMe-00046g-Ox
	for coreutils@gnu.org; Tue, 26 Apr 2016 05:33:05 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1auzMb-00060P-He
	for coreutils@gnu.org; Tue, 26 Apr 2016 05:33:04 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:48498)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1auzMb-00060A-Cq
	for coreutils@gnu.org; Tue, 26 Apr 2016 05:33:01 -0400
Received: from [192.168.1.80] (unknown [109.79.98.168])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id CA713219;
	Tue, 26 Apr 2016 10:32:59 +0100 (IST)
Subject: Re: prevent seq from inflow inflow on I/O errors
To: Assaf Gordon <assafgordon@gmail.com>,
	Bernhard Voelker <mail@bernhard-voelker.de>
References: <788E7E16-EFE1-47D0-96CD-A35FB080BBA6@gmail.com>
	<570256BD.7010302@draigBrady.com>
	<57037EDD.2020604@bernhard-voelker.de>
	<1BC925DA-15D0-4E54-BE80-92AD9D64C0E7@gmail.com>
	<57136AE1.6070007@draigBrady.com>
	<3534D2B6-109B-45E2-95A3-8AEB8566F588@gmail.com>
	<6883FEEC-7D8E-4D06-9568-29BCDACA68A3@gmail.com>
Cc: Coreutils <coreutils@gnu.org>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <571F35CB.7020103@draigBrady.com>
Date: Tue, 26 Apr 2016 10:32:59 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <6883FEEC-7D8E-4D06-9568-29BCDACA68A3@gmail.com>
Content-Type: text/plain; charset=windows-1252; format=flowed
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 82.195.144.49
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 26 Apr 2016 09:33:05 -0000

On 26/04/16 03:38, Assaf Gordon wrote:
> Subject: [PATCH] seq: improve epipe test

The subject should start with "tests:". Something like:

   tests: improve recent seq EPIPE test

Otherwise +1

thanks,
P=E1draig


From MAILER-DAEMON Thu Apr 28 09:42:13 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1avmCr-0003xp-Ei
	for mharc-coreutils@gnu.org; Thu, 28 Apr 2016 09:42:13 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:44189)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1avmCj-0003gF-Pt
	for coreutils@gnu.org; Thu, 28 Apr 2016 09:42:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1avmCe-0003wQ-7H
	for coreutils@gnu.org; Thu, 28 Apr 2016 09:42:05 -0400
Received: from mail-oi0-x235.google.com ([2607:f8b0:4003:c06::235]:35125)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1avmCd-0003wJ-VU
	for coreutils@gnu.org; Thu, 28 Apr 2016 09:42:00 -0400
Received: by mail-oi0-x235.google.com with SMTP id x19so83559723oix.2
	for <coreutils@gnu.org>; Thu, 28 Apr 2016 06:41:59 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc; bh=G3Ek4p+JtW7B1Krq91pdBPNiaMYRXXKNIbypVTbqy3Y=;
	b=j6BTC/tSSkpNxSbiN8k4LyhEyNW47RYBUAGIKkEkQ+14eiZ25qJkTKbFTYADUuNHYK
	Gwy5DkChMNl88L10eFseExQT0EjSGHI2f2pfujjcNcvqP8pyuRu9kZ0WNhkyqumoxMLX
	qjSLqpud6vbielvi0dSLVU+wUg4KOeKl6bAuqCXPGNGejd92hHYBhD7bdi5UOjmRdKMf
	YDXeWkxXfh294nvXGYjcCHZhVrKb/LYBMVSTZ253I3qWl+Mu06/fQMEMUI6l1JGimUdx
	zeZ6XylKj7yGZx3+00U6e2q3krEoK0N9Q3yKJdMd/9Z8szSwk1UijSCmB4zcG9AwPfeF
	1Vyg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20130820;
	h=x-gm-message-state:mime-version:in-reply-to:references:date
	:message-id:subject:from:to:cc;
	bh=G3Ek4p+JtW7B1Krq91pdBPNiaMYRXXKNIbypVTbqy3Y=;
	b=h5hlUk+EAYN5PKkWCGowqCzQCwpAKZN4F2xHomSt1cRhXMmkQ3mbJDV3dxNFtf8jTI
	occ3jK23zglCjaPKeQhe9KNtL0S+iJOAbic8IJOXfyf1IvhUYdiEfWomgLPeiGgtUSMD
	E2Q3Sl/SGMPQ1/QLWb62uSK10ZeDxzn6TsALpRIdCpc4m0ilRoMMRP2E9DyexX+fFCMH
	OOpnSckF0e+HlYCy6WW3EDsN8mJZJd5TN2ipiW537hN+Pse2qikMQr6C0X1jDkKo/dXk
	Re3jW94TI04KQdDX+L1fDLK7MeF6JLT9OGhzQVQQ5waYU2C0JIYHmiJw+DrXv67vAUYn
	9WDg==
X-Gm-Message-State: AOPr4FU+vJ2z6+mdOR+gb5tM+HjxfMVSpx6wdTs3xSZnm435Cx4A3I7ODfJ5qQA5KITblRYI4pRhMvyonmxf1A==
MIME-Version: 1.0
X-Received: by 10.157.40.70 with SMTP id h6mr1305429otd.186.1461850919267;
	Thu, 28 Apr 2016 06:41:59 -0700 (PDT)
Received: by 10.202.201.67 with HTTP; Thu, 28 Apr 2016 06:41:59 -0700 (PDT)
In-Reply-To: <571F35CB.7020103@draigBrady.com>
References: <788E7E16-EFE1-47D0-96CD-A35FB080BBA6@gmail.com>
	<570256BD.7010302@draigBrady.com>
	<57037EDD.2020604@bernhard-voelker.de>
	<1BC925DA-15D0-4E54-BE80-92AD9D64C0E7@gmail.com>
	<57136AE1.6070007@draigBrady.com>
	<3534D2B6-109B-45E2-95A3-8AEB8566F588@gmail.com>
	<6883FEEC-7D8E-4D06-9568-29BCDACA68A3@gmail.com>
	<571F35CB.7020103@draigBrady.com>
Date: Thu, 28 Apr 2016 09:41:59 -0400
Message-ID: <CAHN-Gmx33iNRK1h1Jn2cNMoFfkENLrWpTqebEJoDjh_f8d=zWA@mail.gmail.com>
Subject: Re: prevent seq from inflow inflow on I/O errors
From: Assaf Gordon <assafgordon@gmail.com>
To: =?UTF-8?Q?P=C3=A1draig_Brady?= <P@draigbrady.com>
Cc: Bernhard Voelker <mail@bernhard-voelker.de>, Coreutils <coreutils@gnu.org>
Content-Type: multipart/mixed; boundary=001a1142f258c2183a05318bb07c
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 2607:f8b0:4003:c06::235
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Apr 2016 13:42:11 -0000

--001a1142f258c2183a05318bb07c
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hello,

On Tue, Apr 26, 2016 at 5:32 AM, P=C3=A1draig Brady <P@draigbrady.com> wrot=
e:
> The subject should start with "tests:". Something like:
>
>   tests: improve recent seq EPIPE test

Updated patch attached.

regards,
 - assaf

--001a1142f258c2183a05318bb07c
Content-Type: application/octet-stream; 
	name="0001-tests-improve-recent-seq-EPIPE-test.patch"
Content-Disposition: attachment; 
	filename="0001-tests-improve-recent-seq-EPIPE-test.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_inkc9fxt0

RnJvbSA1MDdiM2EwMjAxNWI1MjlkOThjNTdjYThj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2dyZXAgJ15zZXE6
IHN0YW5kYXJkIG91dHB1dDogJyBlcnIgXAorICB8fCB7IHdhcm5fICJzZXEgZW1pdHRlZCBpbmNv
cnJlY3QgZXJyb3Igb24gRVBJUEUiOyBcCisgICAgICAgY2F0IGVycjtcCisgICAgICAgZmFpbD0x
OyB9CiAKIEV4aXQgJGZhaWwKLS0gCjEuOS4xCgo=
--001a1142f258c2183a05318bb07c--


From MAILER-DAEMON Thu Apr 28 11:14:14 2016
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1avndu-0001ku-Mz
	for mharc-coreutils@gnu.org; Thu, 28 Apr 2016 11:14:14 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:37772)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1avnds-0001h8-L3
	for coreutils@gnu.org; Thu, 28 Apr 2016 11:14:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1avndn-0003BU-Fs
	for coreutils@gnu.org; Thu, 28 Apr 2016 11:14:12 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:53153)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1avndn-0003An-AT
	for coreutils@gnu.org; Thu, 28 Apr 2016 11:14:07 -0400
Received: from [192.168.1.80] (unknown [109.79.199.79])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id F4058214;
	Thu, 28 Apr 2016 16:14:04 +0100 (IST)
Subject: Re: prevent seq from inflow inflow on I/O errors
To: Assaf Gordon <assafgordon@gmail.com>
References: <788E7E16-EFE1-47D0-96CD-A35FB080BBA6@gmail.com>
	<570256BD.7010302@draigBrady.com>
	<57037EDD.2020604@bernhard-voelker.de>
	<1BC925DA-15D0-4E54-BE80-92AD9D64C0E7@gmail.com>
	<57136AE1.6070007@draigBrady.com>
	<3534D2B6-109B-45E2-95A3-8AEB8566F588@gmail.com>
	<6883FEEC-7D8E-4D06-9568-29BCDACA68A3@gmail.com>
	<571F35CB.7020103@draigBrady.com>
	<CAHN-Gmx33iNRK1h1Jn2cNMoFfkENLrWpTqebEJoDjh_f8d=zWA@mail.gmail.com>
Cc: Bernhard Voelker <mail@bernhard-voelker.de>, Coreutils <coreutils@gnu.org>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <572228BC.3070506@draigBrady.com>
Date: Thu, 28 Apr 2016 16:14:04 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
	Thunderbird/38.3.0
MIME-Version: 1.0
In-Reply-To: <CAHN-Gmx33iNRK1h1Jn2cNMoFfkENLrWpTqebEJoDjh_f8d=zWA@mail.gmail.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
X-Received-From: 82.195.144.49
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.21
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils/>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 28 Apr 2016 15:14:13 -0000

On 28/04/16 14:41, Assaf Gordon wrote:
> Hello,
>
> On Tue, Apr 26, 2016 at 5:32 AM, P=C3=A1draig Brady <P@draigbrady.com> =
wrote:
>> The subject should start with "tests:". Something like:
>>
>>    tests: improve recent seq EPIPE test
>
> Updated patch attached.

Note SIGPIPE may not be supported, so I'd also suggest a guard like:

(trap '' PIPE && yes | :) 2>&1 | grep -qF 'Broken pipe' ||
   skip_ 'trapping SIGPIPE is not supported'

cheers,
P=C3=A1draig.

p.s. For my own reference, programs that fail on EPIPE preclude
themselves for use with 'pipefail' setting in bash for example.
Though changing only coreutils to fail on EPIPE would be inconsistent.


