From MAILER-DAEMON Thu Jun 01 00:38:12 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dGHsC-0000xc-Qd
	for mharc-coreutils@gnu.org; Thu, 01 Jun 2017 00:38:12 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:48201)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <rain1@openmailbox.org>) id 1dGC2e-0004ub-BM
	for coreutils@gnu.org; Wed, 31 May 2017 18:24:37 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <rain1@openmailbox.org>) id 1dGC2Z-0007gy-J4
	for coreutils@gnu.org; Wed, 31 May 2017 18:24:36 -0400
Received: from lb1.openmailbox.org ([5.79.108.160]:58449
	helo=mail.openmailbox.org)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <rain1@openmailbox.org>)
	id 1dGC2Z-0007fg-BY
	for coreutils@gnu.org; Wed, 31 May 2017 18:24:31 -0400
Received: by mail.openmailbox.org (Postfix, from userid 20002)
	id 409F8501210; Thu,  1 Jun 2017 00:24:28 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=openmailbox.org;
	s=openmailbox; t=1496269469;
	bh=EpCf/POdVcIJxIRwZfh7ViivR0ZdX3VWWA989CgTfN8=;
	h=Date:From:To:Subject:From;
	b=X0P+zNuWixGkuak0fCcBzOZA/G9BzKBXyBPSaVWcTLg+KNg31PFQQELRqyS51ByST
	eNpUSU0e+g05lA5h25QXZE3Fm8A7CQcx/jjm5gyBWztABEK4JV1UU34K+rP7rEEBW2
	Pub9HC6Tk6zE1EA78hyzKjybsovkzigNBIFPMWtQ=
Received: from www.openmailbox.org (unknown [10.0.0.3])
	by mail.openmailbox.org (Postfix) with ESMTP id CBE4850E6CE
	for <coreutils@gnu.org>; Thu,  1 Jun 2017 00:24:27 +0200 (CEST)
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII;
 format=flowed
Content-Transfer-Encoding: 7bit
Date: Wed, 31 May 2017 22:24:27 +0000
From: rain1@openmailbox.org
To: coreutils@gnu.org
Subject: null separated ls output option
Message-ID: <ab33759f2f081fb3c67b72752f6698e0@openmailbox.org>
X-Sender: rain1@openmailbox.org
User-Agent: Roundcube Webmail/1.0.6
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 5.79.108.160
X-Mailman-Approved-At: Thu, 01 Jun 2017 00:38:11 -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, 31 May 2017 22:24:37 -0000

Hello

Please consider accepting this patch I wrote which adds a new -0 feature 
to ls.

This emits the entries separated by null bytes (similar to 
/proc/$PID/cmdline) which creates a completely unambiguous and simple 
output format that doesn't involve any quotation or escaping (like ls -1 
and ls -Q1) by using a separator which cannot occur inside a filename 
(\0). Inside emacs eshell for example, the output is nicely human 
readable with the null separator displayed as ^@.

diff -Naur '--exclude=*~' coreutils-8.27/src/ls.c 
coreutils-8.27-ls-0-patch/src/ls.c
--- coreutils-8.27/src/ls.c	2017-01-21 14:53:43.000000000 +0000
+++ coreutils-8.27-ls-0-patch/src/ls.c	2017-05-31 22:05:43.782177300 
+0000
@@ -410,6 +410,7 @@
    {
      long_format,		/* -l and other options that imply -l */
      one_per_line,		/* -1 */
+    null_separated,		/* -0 */
      many_per_line,		/* -C */
      horizontal,			/* -x */
      with_commas			/* -m */
@@ -875,12 +876,12 @@
  static char const *const format_args[] =
  {
    "verbose", "long", "commas", "horizontal", "across",
-  "vertical", "single-column", NULL
+  "vertical", "single-column", "null-separated", NULL
  };
  static enum format const format_types[] =
  {
    long_format, long_format, with_commas, horizontal, horizontal,
-  many_per_line, one_per_line
+  many_per_line, one_per_line, null_separated
  };
  ARGMATCH_VERIFY (format_args, format_types);

@@ -1753,7 +1754,7 @@
      {
        int oi = -1;
        int c = getopt_long (argc, argv,
-                           
"abcdfghiklmnopqrstuvw:xABCDFGHI:LNQRST:UXZ1",
+                           
"abcdfghiklmnopqrstuvw:xABCDFGHI:LNQRST:UXZ10",
                             long_options, &oi);
        if (c == -1)
          break;
@@ -1949,6 +1950,10 @@
              format = one_per_line;
            break;

+        case '0':
+          format = null_separated;
+          break;
+
          case AUTHOR_OPTION:
            print_author = true;
            break;
@@ -2763,7 +2768,8 @@
                   ls uses constant memory while processing the entries 
of
                   this directory.  Useful when there are many (millions)
                   of entries in a directory.  */
-              if (format == one_per_line && sort_type == sort_none
+              if ((format == one_per_line || format == null_separated)
+		      && sort_type == sort_none
                        && !print_block_size && !recursive)
                  {
                    /* We must call sort_files in spite of
@@ -3770,6 +3776,14 @@
          }
        break;

+    case null_separated:
+      for (i = 0; i < cwd_n_used; i++)
+        {
+          print_file_name_and_frills (sorted_file[i], 0);
+          putchar ('\0');
+        }
+      break;
+
      case many_per_line:
        if (! line_length)
          print_with_separator (' ');
@@ -5150,7 +5164,8 @@
    -x                         list entries by lines instead of by 
columns\n\
    -X                         sort alphabetically by entry extension\n\
    -Z, --context              print any security context of each file\n\
-  -1                         list one file per line.  Avoid '\\n' with 
-q or -b\
+  -1                         list one file per line.  Avoid '\\n' with 
-q or -b\n\
+  -0                         separate entries by a null byte.\n\
  \n\
  "), stdout);
        fputs (HELP_OPTION_DESCRIPTION, stdout);



From MAILER-DAEMON Thu Jun 01 00:45:20 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dGHz6-0002TP-Qc
	for mharc-coreutils@gnu.org; Thu, 01 Jun 2017 00:45:20 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:53067)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dGHz4-0002TJ-Me
	for coreutils@gnu.org; Thu, 01 Jun 2017 00:45:19 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dGHz1-00042C-K0
	for coreutils@gnu.org; Thu, 01 Jun 2017 00:45:18 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:34756)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dGHz1-0003zr-Cr
	for coreutils@gnu.org; Thu, 01 Jun 2017 00:45:15 -0400
Received: from localhost.localdomain (mobile-166-137-176-151.mycingular.net
	[166.137.176.151])
	(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 5CEDA997F;
	Thu,  1 Jun 2017 05:45:12 +0100 (IST)
Subject: Re: null separated ls output option
To: rain1@openmailbox.org, coreutils@gnu.org
References: <ab33759f2f081fb3c67b72752f6698e0@openmailbox.org>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <e3098ec8-7a10-5eb5-69b4-2af2f3b54be6@draigBrady.com>
Date: Wed, 31 May 2017 21:45:08 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <ab33759f2f081fb3c67b72752f6698e0@openmailbox.org>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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, 01 Jun 2017 04:45:19 -0000

On 31/05/17 15:24, rain1@openmailbox.org wrote:
> Hello
>=20
> Please consider accepting this patch I wrote which adds a new -0 featur=
e=20
> to ls.
>=20
> This emits the entries separated by null bytes (similar to=20
> /proc/$PID/cmdline) which creates a completely unambiguous and simple=20
> output format that doesn't involve any quotation or escaping (like ls -=
1=20
> and ls -Q1) by using a separator which cannot occur inside a filename=20
> (\0). Inside emacs eshell for example, the output is nicely human=20
> readable with the null separator displayed as ^@.

Thanks for the patch.
This was previously discussed as referenced at:
https://www.gnu.org/software/coreutils/rejected_requests.html#ls

cheers,
P=E1draig.


From MAILER-DAEMON Fri Jun 02 09:42:43 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dGmqh-0007pf-Sc
	for mharc-coreutils@gnu.org; Fri, 02 Jun 2017 09:42:43 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:44805)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <t0ny.fr33man@gmail.com>) id 1dGiwO-0007kx-BQ
	for coreutils@gnu.org; Fri, 02 Jun 2017 05:32:21 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <t0ny.fr33man@gmail.com>) id 1dGiwN-0001RD-GF
	for coreutils@gnu.org; Fri, 02 Jun 2017 05:32:20 -0400
Received: from mail-wm0-x22f.google.com ([2a00:1450:400c:c09::22f]:36991)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <t0ny.fr33man@gmail.com>)
	id 1dGiwN-0001Q0-8j
	for coreutils@gnu.org; Fri, 02 Jun 2017 05:32:19 -0400
Received: by mail-wm0-x22f.google.com with SMTP id d127so19768172wmf.0
	for <coreutils@gnu.org>; Fri, 02 Jun 2017 02:32:17 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:from:date:message-id:subject:to;
	bh=XDiG2k2WAEYEVOrCEnPJfJ3scFdcC3Fw95gBiFHMbSY=;
	b=ddq83s9sr2meBB9xhuQp2E++dodcZptvSGca55CyijD4jGOiZzq8gY6GxqG8Z26k6u
	QzVZXDA1i5b4KKthXY8jHOWcy8V/OCLcCs5KBX6K1sHPjkjMNLxqxagYxPd6cpU00M9M
	h89UDROdxZAChU5qCE37iXHEGSopEa2UTRfXRLw5IJjOX8PHLnYTmvsOM/FvuMK7FAEw
	ks6X/4r0yXlnCyUeQnqfnnkb5m8Y69zJs8nFewQcLRC2nsfAfrtvjBqViC4EEBFaClpk
	pyrsGvYKxIJmi3sYKVu9I9g1EY4CTsMIWxnAu0gDdA12NPSB1ELQzJamQmVftwzI4lzu
	WmRA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
	bh=XDiG2k2WAEYEVOrCEnPJfJ3scFdcC3Fw95gBiFHMbSY=;
	b=s/weP5KbVANiZvyt07q+H2siqJuy/8w0SUVm2nIM15z2kn91BTFHTGuov7QOpzjty2
	21fZBjsZkt7MF9Sd9dbVTFYMYK5TvUfX2hn4GavoYxeXOHQpBY+U8vw/k2Ot5q0g0UOq
	CrPyP8gDivjhgEK+Mhx/saewxPAfmOiTJuEhiPx4AfLlNBJjKort7zSEg0YcwC7ZeAPW
	gIoagFPUOjBiEJmXlt5BCFuSdWP3EiBAmW7jSul3qQESzOaaauZMyOo6HP1CMxFYFVEE
	hO0v5ovvcMvQeTDTnWZnZopUVBpQEghRh86Krd4DFucarR9YEnhCN/k484++9MlB+bwO
	OoLg==
X-Gm-Message-State: AODbwcDg94tHnkKgWYVpz8o9LB5BToppRN7e8yYuBEVoAzq4SgMODsJ8
	K14XkG2nFhq2+NyMzNVNNiSZIk6teYz6
X-Received: by 10.80.215.155 with SMTP id w27mr5348064edi.70.1496395936227;
	Fri, 02 Jun 2017 02:32:16 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.80.153.103 with HTTP; Fri, 2 Jun 2017 02:32:15 -0700 (PDT)
From: Tony Freeman <t0ny.fr33man@gmail.com>
Date: Fri, 2 Jun 2017 04:32:15 -0500
Message-ID: <CAPvxS7hHc9Tv4EORSmJSJNp=v=f6AU=RwTDqzFoV+H1Gq+Y-Vg@mail.gmail.com>
Subject: Utility of new program for coreutils?
To: coreutils@gnu.org
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2a00:1450:400c:c09::22f
X-Mailman-Approved-At: Fri, 02 Jun 2017 09:42:42 -0400
Content-Type: text/plain; charset="UTF-8"
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: Fri, 02 Jun 2017 09:32:21 -0000

I'm trying to find a project to work on to improve coding skills and
contribute to the community. So I thought that possibly a command line
program would be useful that does similar things as Perl's trim function
and PHP's trim function.

So .. Would it be worth creating a new program, let's call it 'trim', that
would: 1) remove whitespace from the beginning and end of stdin; and 2)
remove newlines from beginning and end of a file?

Example usage:

echo "        test      test test     test      " | trim

Would output:

test      test test     test

Example usage:

trim myfile.txt
cat myfile.txt | trim

Would output:

   This is line one of two
from a test file.

    This is line two of two
from a test file.

Where myfile.txt contains this:

\n
\n
   This is line one of two
from a test file.

    This is line two of two
from a test file.
\n
\n

From MAILER-DAEMON Fri Jun 02 10:12:52 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dGnJr-0007Fk-TQ
	for mharc-coreutils@gnu.org; Fri, 02 Jun 2017 10:12:51 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:50771)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <dualbus@gmail.com>) id 1dGnJp-0007E1-Lm
	for coreutils@gnu.org; Fri, 02 Jun 2017 10:12:50 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <dualbus@gmail.com>) id 1dGnJm-00036m-E5
	for coreutils@gnu.org; Fri, 02 Jun 2017 10:12:49 -0400
Received: from mail-oi0-x22f.google.com ([2607:f8b0:4003:c06::22f]:33256)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <dualbus@gmail.com>) id 1dGnJm-00036B-8j
	for coreutils@gnu.org; Fri, 02 Jun 2017 10:12:46 -0400
Received: by mail-oi0-x22f.google.com with SMTP id s3so2785274oia.0
	for <coreutils@gnu.org>; Fri, 02 Jun 2017 07:12:46 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=date:from:to:cc:subject:message-id:references:mime-version
	:content-disposition:content-transfer-encoding:in-reply-to
	:user-agent; bh=q0ZSQf/65KKXx9eovvTYAUORBLFmxW06ZPfKthLZxlQ=;
	b=jPNq1Rlz6T6flW/cS0JSi4sYr5DYwkvtshFuadir2MC6EOG/7NT8hL0Dd9dxRxa/z0
	A1FAHQCLWbptc/lTDu8J4/EFITeW3yLzyflm7dPXntPD1yqOpSYxpbwqVSZGxmCVKuic
	5+NXOhFw7SNUCuj1EAxpYJ9Disznq0I4uKOLQ7yT7hPLlD6OHxkM0UW9jt7h4kenK6vO
	mKspX4AL8F3g7TIv4JUvktudx8Uc7hZ0loQNeOCUjHw0U6zNLwwEJsYU/oR9WlaU8zbh
	y30U+VX3+Id5jaAJE2T0I9AtR+wwFtdyV519rvPoei86t4Z2ImRgWyfg9tFUT8AjNadv
	9T/A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:date:from:to:cc:subject:message-id:references
	:mime-version:content-disposition:content-transfer-encoding
	:in-reply-to:user-agent;
	bh=q0ZSQf/65KKXx9eovvTYAUORBLFmxW06ZPfKthLZxlQ=;
	b=SDBKsPRm0wFLJlDVasAjrPjVtzwEcah/ShU20fLjZDpxKxe4QVpYMB9NnlgMlVNVFf
	xiAr6bZuSsikA/m6ya+r7wWq5nBcmNGSi+VZs0IM9Fxz9D8rtSwLH46KoFmHz4s1BAJj
	NZuLhm7mp+iPkKtAgFypzWwa4EAKd/Pg2s1fA1g+IbN8X+vE4C+tCJ/fOtwPG51jGMP7
	U3+CZsK8w/VWT0EN4r50RhHe2/sML0q6TwOu9bUHBA0cEmg1is1ULUM/cVpCtXScLnU6
	vowTGR+uLyIhL22w/0xGIVX4LW57zyzTR9JHW+TFFhbK86Fi9THEAZkxf+1pFw18Qscz
	+wFA==
X-Gm-Message-State: AKS2vOyYtaT3cLWl2WjNSkU8Np0AnzknSGCLJpyWWejfHIoTtR2uVDqc
	ELc/FdZARxQHJg==
X-Received: by 10.157.83.5 with SMTP id g5mr5162201oth.169.1496412765347;
	Fri, 02 Jun 2017 07:12:45 -0700 (PDT)
Received: from localhost ([201.157.173.180])
	by smtp.gmail.com with ESMTPSA id 2sm957654otr.44.2017.06.02.07.12.44
	(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
	Fri, 02 Jun 2017 07:12:44 -0700 (PDT)
Date: Fri, 2 Jun 2017 09:12:43 -0500
From: dualbus <dualbus@gmail.com>
To: Tony Freeman <t0ny.fr33man@gmail.com>
Cc: coreutils@gnu.org
Subject: Re: Utility of new program for coreutils?
Message-ID: <20170602141243.5pz3hnrl67d4zi6k@debian>
References: <CAPvxS7hHc9Tv4EORSmJSJNp=v=f6AU=RwTDqzFoV+H1Gq+Y-Vg@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <CAPvxS7hHc9Tv4EORSmJSJNp=v=f6AU=RwTDqzFoV+H1Gq+Y-Vg@mail.gmail.com>
User-Agent: NeoMutt/20170113 (1.7.2)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4003:c06::22f
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, 02 Jun 2017 14:12:50 -0000

On Fri, Jun 02, 2017 at 04:32:15AM -0500, Tony Freeman wrote:
[...]
> So .. Would it be worth creating a new program, let's call it 'trim', that
> would: 1) remove whitespace from the beginning and end of stdin; and 2)
> remove newlines from beginning and end of a file?

Disclaimer: I'm not a coreutils maintainer, I'm just suscribed to the
list :-)


I suggest reviewing
https://www.gnu.org/software/coreutils/rejected_requests.html (specially
the section on new commands).

In my opinion, it's not very valuable to add a new command to Coreutils
to accomplish this specific problem, given that you can solve it with a
sed one-liner.

A similar topic was recently brought up in the mailing list, and Pádraig
provided a few suggestions on problems for new contributors:
https://lists.gnu.org/archive/html/coreutils/2017-05/msg00003.html

Perhaps you might want to review these?

> Example usage:
> 
> echo "        test      test test     test      " | trim

$ trim(){ sed -e 's/^[[:blank:]]*//' -e 's/[[:blank:]]*$//' -- "$@"; }
$ echo "        test      test test     test      " | trim
test      test test     test

-- 
Eduardo Bustamante
https://dualbus.me/


From MAILER-DAEMON Fri Jun 02 12:29:13 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dGpRp-0005Zv-B5
	for mharc-coreutils@gnu.org; Fri, 02 Jun 2017 12:29:13 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:54244)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jminter@redhat.com>) id 1dGp7P-0005JI-8I
	for coreutils@gnu.org; Fri, 02 Jun 2017 12:08:08 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jminter@redhat.com>) id 1dGp7L-0004iv-Va
	for coreutils@gnu.org; Fri, 02 Jun 2017 12:08:07 -0400
Received: from mail-wm0-f53.google.com ([74.125.82.53]:33100)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <jminter@redhat.com>) id 1dGp7L-0004go-Oj
	for coreutils@gnu.org; Fri, 02 Jun 2017 12:08:03 -0400
Received: by mail-wm0-f53.google.com with SMTP id m7so13006433wmg.0
	for <coreutils@gnu.org>; Fri, 02 Jun 2017 09:08:03 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:from:subject:to:message-id:date:user-agent
	:mime-version:content-transfer-encoding;
	bh=wzWQxHO4Y83SpUkGULXOEpgwvnRQ0kfW50YGhnv5vkI=;
	b=Xh29DusrCekxI8ZJgElZPpM6hI0ia3rgrYRQ9KdJcKEUI4CZg3lkZRnmwveesFbKjH
	WtW3ma1ULzwHx73PHpx7DlEjtQ3LldwCDlHvrRRYqXjzpd4YaQKG3TxLZ6VxqebBoewG
	QBzACW1BeYzkGtUaWyf6kLGC0NXXZ+ldjbl3vj8itT2nEjWgXIxySYDfHsBlu0Kv8eDj
	IPgN8Bd7eBGz3WD+fJH0i/MbjTPq021Oa1DTpKSrd1Myr0WcH+y9KwKSaMnFWa1u/NrY
	eUBYzjU1pnDD8jTnwd152vXOgLSZWkyyLiMGtNxBs1iJmUm8lW/RNrUti3hY66Z6wZga
	tA5w==
X-Gm-Message-State: AODbwcDCxRrx93JjISo7AqD/EUJQ9WQroq2QcS3quKGHoFR4K47iCq3o
	Rcq6MjV75I83IYuIEmSfUA==
X-Received: by 10.28.17.143 with SMTP id 137mr54465wmr.52.1496419681524;
	Fri, 02 Jun 2017 09:08:01 -0700 (PDT)
Received: from [192.168.1.173] ([195.147.221.153])
	by smtp.gmail.com with ESMTPSA id
	l93sm11338693wrc.46.2017.06.02.09.08.00 for <coreutils@gnu.org>
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Fri, 02 Jun 2017 09:08:00 -0700 (PDT)
From: Jim Minter <jminter@redhat.com>
Subject: "Failed to preserve ownership" exit(1) bug in mv?
To: coreutils@gnu.org
Message-ID: <a03147d3-94b6-2351-974b-163232477a9e@redhat.com>
Date: Fri, 2 Jun 2017 17:07:59 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
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]
	[fuzzy]
X-Received-From: 74.125.82.53
X-Mailman-Approved-At: Fri, 02 Jun 2017 12:29:12 -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: Fri, 02 Jun 2017 16:08:08 -0000

Hello,

A behaviour that surprised me with mv, moving files to an NFS-mounted 
filesystem with all_squash set (in a Vagrant box running Fedora 25, 
coreutils 8.25).

(/vagrant is NFS-mounted as described in the example below).

==== 8< ====
[vagrant@default ~]$ sudo -i
[root@default ~]# ln -s thing symlink
[root@default /]# mv symlink /vagrant
mv: failed to preserve ownership for /vagrant/symlink: Operation not 
permitted
[root@default /]# echo $?
1
[root@default /]# ls . /vagrant
.:
symlink

/vagrant:
symlink
==== 8< ====

The surprise to me is that mv exits early in this case (after copying 
the symlink across volumes, before removing the source symlink).

Doing the same operation as root but with a regular file, I get the same 
warning message, but the move completes as expected, and mv returns exit 
status 0.  I had expected the same behaviour when moving a symlink.

(As non-root, mv works as expected both for a file and for a symlink - 
object moved, chown syscall fails, no warning message).

The knock-on effect I've seen which is particularly problematic, is that 
this issue causes mv to fail when moving an entire directory tree as 
root to an NFS-mounted filesystem, if that directory tree contains a 
symlink anywhere within it.  Can the exit(1) in this case be considered 
a bug?

Best regards,

Jim


From MAILER-DAEMON Sat Jun 03 00:57:17 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dH17l-00015v-D5
	for mharc-coreutils@gnu.org; Sat, 03 Jun 2017 00:57:17 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:49711)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dH17i-00014c-Ma
	for coreutils@gnu.org; Sat, 03 Jun 2017 00:57:15 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dH17e-0005pI-N9
	for coreutils@gnu.org; Sat, 03 Jun 2017 00:57:14 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:51248)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dH17e-0005na-FW
	for coreutils@gnu.org; Sat, 03 Jun 2017 00:57:10 -0400
Received: from localhost.localdomain (mobile-166-171-251-89.mycingular.net
	[166.171.251.89])
	(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 2632C9BDA;
	Sat,  3 Jun 2017 05:57:05 +0100 (IST)
Subject: Re: "Failed to preserve ownership" exit(1) bug in mv?
To: Jim Minter <jminter@redhat.com>, coreutils@gnu.org
References: <a03147d3-94b6-2351-974b-163232477a9e@redhat.com>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <57280735-d5cf-d6e5-85c6-ccd6858a6cdf@draigBrady.com>
Date: Fri, 2 Jun 2017 21:56:59 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <a03147d3-94b6-2351-974b-163232477a9e@redhat.com>
Content-Type: multipart/mixed; boundary="------------A493F059F0230857970AB354"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Sat, 03 Jun 2017 04:57:15 -0000

This is a multi-part message in MIME format.
--------------A493F059F0230857970AB354
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 02/06/17 09:07, Jim Minter wrote:
> Hello,
>=20
> A behaviour that surprised me with mv, moving files to an NFS-mounted=20
> filesystem with all_squash set (in a Vagrant box running Fedora 25,=20
> coreutils 8.25).
>=20
> (/vagrant is NFS-mounted as described in the example below).
>=20
> =3D=3D=3D=3D 8< =3D=3D=3D=3D
> [vagrant@default ~]$ sudo -i
> [root@default ~]# ln -s thing symlink
> [root@default /]# mv symlink /vagrant
> mv: failed to preserve ownership for /vagrant/symlink: Operation not=20
> permitted
> [root@default /]# echo $?
> 1
> [root@default /]# ls . /vagrant
> .:
> symlink
>=20
> /vagrant:
> symlink
> =3D=3D=3D=3D 8< =3D=3D=3D=3D
>=20
> The surprise to me is that mv exits early in this case (after copying=20
> the symlink across volumes, before removing the source symlink).
>=20
> Doing the same operation as root but with a regular file, I get the sam=
e=20
> warning message, but the move completes as expected, and mv returns exi=
t=20
> status 0.  I had expected the same behaviour when moving a symlink.
>=20
> (As non-root, mv works as expected both for a file and for a symlink -=20
> object moved, chown syscall fails, no warning message).
>=20
> The knock-on effect I've seen which is particularly problematic, is tha=
t=20
> this issue causes mv to fail when moving an entire directory tree as=20
> root to an NFS-mounted filesystem, if that directory tree contains a=20
> symlink anywhere within it.  Can the exit(1) in this case be considered=
=20
> a bug?

That indeed looks like a bug that has been present since the initial impl=
ementation!
The attached should fix it up.

thanks!
P=C3=A1draig


--------------A493F059F0230857970AB354
Content-Type: text/x-patch;
 name="chown-symlink-warn-only.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="chown-symlink-warn-only.patch"

>From f1de9740e663181ef6a303118364545ced043c13 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
Date: Fri, 2 Jun 2017 21:50:04 -0700
Subject: [PATCH] copy: don't fail when unable to chown symlinks

* src/copy.c (copy_internal): Honor the x->require_preserve flag
for symlinks as we do for ordinary files, so we don't exit with
failure upon failure to chown a symbolic link.
* NEWS: Mention the bug fix.
---
 NEWS       | 5 +++++
 src/copy.c | 3 ++-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/NEWS b/NEWS
index 7c4429d..c811dbc 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,11 @@ GNU coreutils NEWS                                    -*- outline -*-
 
 ** Bug fixes
 
+  cp and mv now only warn about failure to preserve ownership of symlinks.
+  cp (without -p) will no longer exit with a failure status, and mv will
+  also no longer leave such symlinks remaining in the source file system.
+  [the bug dates back to the initial implementation]
+
   date and touch no longer overwrite the heap with large
   user specified TZ values (CVE-2017-7476).
   [bug introduced in coreutils-8.27]
diff --git a/src/copy.c b/src/copy.c
index e96ecdd..965e819 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -2714,7 +2714,8 @@ copy_internal (char const *src_name, char const *dst_name,
             {
               error (0, errno, _("failed to preserve ownership for %s"),
                      dst_name);
-              goto un_backup;
+              if (x->require_preserve)
+                goto un_backup;
             }
           else
             {
-- 
2.9.3


--------------A493F059F0230857970AB354--


From MAILER-DAEMON Sat Jun 03 06:19:43 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dH69n-0008Jc-Rt
	for mharc-coreutils@gnu.org; Sat, 03 Jun 2017 06:19:43 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:39265)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jminter@redhat.com>) id 1dH69l-0008J8-Nj
	for coreutils@gnu.org; Sat, 03 Jun 2017 06:19:42 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jminter@redhat.com>) id 1dH69i-0008JS-G8
	for coreutils@gnu.org; Sat, 03 Jun 2017 06:19:41 -0400
Received: from mail-wr0-f182.google.com ([209.85.128.182]:35943)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <jminter@redhat.com>) id 1dH69i-0008J7-8s
	for coreutils@gnu.org; Sat, 03 Jun 2017 06:19:38 -0400
Received: by mail-wr0-f182.google.com with SMTP id v111so10708047wrc.3
	for <coreutils@gnu.org>; Sat, 03 Jun 2017 03:19:38 -0700 (PDT)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:subject:to:references:from:message-id:date
	:user-agent:mime-version:in-reply-to:content-transfer-encoding;
	bh=m8Itq9oP/XKlH7WgCDu+VOgECffveWAgXDEWL4YLJrI=;
	b=KHhQFsj9zjazCbHuEv9WNyKHU5q/GzgW8WSOwIn4s9uKMfpBRjcDPi2QT1pRbHvmq5
	NgWHJeYzgFdY6dyWe4IKjFMEiC0ML8Wbg22T2iHbXBNwq18eEx4XzDON8y71IU37f+L3
	zoxgd6sLdVgNPajyS7wblud9yM2C7K7rsc0HbJjfsn8k1hiQektykc/rke0C4cExxssK
	iDanTxtzMXq0eF7pF37hcZg2NQcfKFPAIy4TeXysWsJNI07dYENUfdgN8or5OUjRB9vc
	wRaWq24oEluGv+8kO9dMg1MIina9ZMVrakXITN9tlMsiLejTjFASoqSLqOg9ByjjkqDp
	GUWQ==
X-Gm-Message-State: AODbwcDrCTTeCOJx0j8A9T4GhHeRkheToEAfnnEWzLP8vNkrd7COAm8b
	fqg3rBnjUKcVqqjT7VulxQ==
X-Received: by 10.223.138.188 with SMTP id y57mr7707367wry.93.1496485176799;
	Sat, 03 Jun 2017 03:19:36 -0700 (PDT)
Received: from [192.168.1.173] ([195.147.221.153])
	by smtp.gmail.com with ESMTPSA id
	z32sm29352711wrc.12.2017.06.03.03.19.34
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Sat, 03 Jun 2017 03:19:35 -0700 (PDT)
Subject: Re: "Failed to preserve ownership" exit(1) bug in mv?
To: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>, coreutils@gnu.org
References: <a03147d3-94b6-2351-974b-163232477a9e@redhat.com>
	<57280735-d5cf-d6e5-85c6-ccd6858a6cdf@draigBrady.com>
From: Jim Minter <jminter@redhat.com>
Message-ID: <0a3b3392-dbfc-02ea-ad9a-b86aa9b5d415@redhat.com>
Date: Sat, 3 Jun 2017 11:19:34 +0100
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <57280735-d5cf-d6e5-85c6-ccd6858a6cdf@draigBrady.com>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 209.85.128.182
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: Sat, 03 Jun 2017 10:19:42 -0000

On 03/06/17 05:56, Pádraig Brady wrote:
> On 02/06/17 09:07, Jim Minter wrote:
>> Hello,
>>
>> A behaviour that surprised me with mv, moving files to an NFS-mounted
>> filesystem with all_squash set (in a Vagrant box running Fedora 25,
>> coreutils 8.25).
>>
>> (/vagrant is NFS-mounted as described in the example below).
>>
>> ==== 8< ====
>> [vagrant@default ~]$ sudo -i
>> [root@default ~]# ln -s thing symlink
>> [root@default /]# mv symlink /vagrant
>> mv: failed to preserve ownership for /vagrant/symlink: Operation not
>> permitted
>> [root@default /]# echo $?
>> 1
>> [root@default /]# ls . /vagrant
>> .:
>> symlink
>>
>> /vagrant:
>> symlink
>> ==== 8< ====
>>
>> The surprise to me is that mv exits early in this case (after copying
>> the symlink across volumes, before removing the source symlink).
>>
>> Doing the same operation as root but with a regular file, I get the same
>> warning message, but the move completes as expected, and mv returns exit
>> status 0.  I had expected the same behaviour when moving a symlink.
>>
>> (As non-root, mv works as expected both for a file and for a symlink -
>> object moved, chown syscall fails, no warning message).
>>
>> The knock-on effect I've seen which is particularly problematic, is that
>> this issue causes mv to fail when moving an entire directory tree as
>> root to an NFS-mounted filesystem, if that directory tree contains a
>> symlink anywhere within it.  Can the exit(1) in this case be considered
>> a bug?
>
> That indeed looks like a bug that has been present since the initial implementation!
> The attached should fix it up.
>
> thanks!
> Pádraig

Hi Pádraig,

Many thanks for the quick reply.  I've checked and confirm that your 
patch resolves the problem for me.

Cheers,

Jim



From MAILER-DAEMON Sun Jun 04 01:08:28 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dHNm8-0007wJ-OG
	for mharc-coreutils@gnu.org; Sun, 04 Jun 2017 01:08:28 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:58279)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dHNm6-0007vl-UQ
	for coreutils@gnu.org; Sun, 04 Jun 2017 01:08:27 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dHNm5-0004ka-VA
	for coreutils@gnu.org; Sun, 04 Jun 2017 01:08:26 -0400
Received: from mail-vk0-x22f.google.com ([2607:f8b0:400c:c05::22f]:34137)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <meyering@gmail.com>) id 1dHNm5-0004in-Pv
	for coreutils@gnu.org; Sun, 04 Jun 2017 01:08:25 -0400
Received: by mail-vk0-x22f.google.com with SMTP id y190so55051063vkc.1
	for <coreutils@gnu.org>; Sat, 03 Jun 2017 22:08:24 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:sender:in-reply-to:references:from:date:message-id
	:subject:to:cc:content-transfer-encoding;
	bh=ceohMPEUoSzSeZes/rAZ1el+PFVJLwl+hsFvEyXo/Z4=;
	b=l8nm3qWUevdAj731FwRcrr2JoK9LjsqlYnMpNP7pSKAZmTrStGHCgZI62HIMd5eg/J
	hZInTljzIeAPOCSGLfkFBR93ak58o2thJqjudg+O8POgqxPXwcU4TzLn0IuaMDeYKBWX
	aC0TsevIWogFtHlDzIyVom64sWESavpsJ24htFBZFCV5EHivuch5LhaCLUVJ/zITcQKf
	46CE2qi0bVBOB2ot0CieYDzJkyQefJ/cSyNQ3rQxWrctbytHRsjTtT7Bt/R/fMA5mNV7
	ZV7eK5NNUDcJVZYBQDf6abFJsGEaA557ZC968A75IKu0iZlsnIin4FIe4MxmnOynYO2S
	1LRA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
	:date:message-id:subject:to:cc:content-transfer-encoding;
	bh=ceohMPEUoSzSeZes/rAZ1el+PFVJLwl+hsFvEyXo/Z4=;
	b=HRWUN4o9+Cim8PPCCze19wBK0YdwsuhTuHNcQMZEnf+DfFif7CBzUdEbtKySIKDW45
	mixohxFfzoTUuJrF7qaO84NggSM1Ys41MA4kHy01uXWGFJH6z25qno2RbTprUILCAMEE
	2aH3wrbySeu05RPAR1otbidqF8O+4S2mEFWDbmoBK23hYnLRx0GmCyA8N/6Q0prHP7hH
	+Bqi8oA5UoC4NY7GzX0x81qnudE/4cCnmaZqEAFAcDqy8xRoOFNQiVrejgPMjp2/FLjA
	Y+AKdn5W2TVrKBSfCKSV0VU+nvqdtkIiWEUTRp/gA11xgtHfCu0e6KJCqe58RkGxJ3PT
	5Bdw==
X-Gm-Message-State: AODbwcAVfx1NDdAU+LTXgpMmmIAZs0C2OqH9o8lWhbWCPE42n0CsPVDc
	R48dJ91hfrABzNqdF70dTm1G4ojZJg==
X-Received: by 10.31.136.14 with SMTP id k14mr7069246vkd.50.1496552903514;
	Sat, 03 Jun 2017 22:08:23 -0700 (PDT)
MIME-Version: 1.0
Sender: meyering@gmail.com
Received: by 10.176.70.83 with HTTP; Sat, 3 Jun 2017 22:08:02 -0700 (PDT)
In-Reply-To: <57280735-d5cf-d6e5-85c6-ccd6858a6cdf@draigBrady.com>
References: <a03147d3-94b6-2351-974b-163232477a9e@redhat.com>
	<57280735-d5cf-d6e5-85c6-ccd6858a6cdf@draigBrady.com>
From: Jim Meyering <jim@meyering.net>
Date: Sat, 3 Jun 2017 22:08:02 -0700
X-Google-Sender-Auth: hYYqv8-HJiU0KC3TrdMsknmkZ9s
Message-ID: <CA+8g5KEYzUu4KJeYnUwK8mj=1+L9a8UiYMn1ZhaY7ROE_UuAyA@mail.gmail.com>
Subject: Re: "Failed to preserve ownership" exit(1) bug in mv?
To: =?UTF-8?Q?P=C3=A1draig_Brady?= <P@draigbrady.com>
Cc: Jim Minter <jminter@redhat.com>, Coreutils <coreutils@gnu.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:400c:c05::22f
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, 04 Jun 2017 05:08:27 -0000

On Fri, Jun 2, 2017 at 9:56 PM, P=C3=A1draig Brady <P@draigbrady.com> wrote=
:
> That indeed looks like a bug that has been present since the initial impl=
ementation!
> The attached should fix it up.
>
> thanks!

Thanks, indeed! It's not often we see bugs in tools like these that
date back a quarter of a century or more.

Minor suggested adjustments for NEWS:

  cp and mv now merely warn about any failure to preserve symlink ownership=
.
  Before, cp (without -p) would exit with a failure status, and a cross-dev=
ice
  mv would leave such symlinks remaining in the source file system.
  [the bug dates back to the initial implementation]


From MAILER-DAEMON Wed Jun 07 03:23:26 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dIVJO-0008H1-9p
	for mharc-coreutils@gnu.org; Wed, 07 Jun 2017 03:23:26 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:52047)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dIVJM-0008Gm-3M
	for coreutils@gnu.org; Wed, 07 Jun 2017 03:23:25 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dIVJI-0004cc-VL
	for coreutils@gnu.org; Wed, 07 Jun 2017 03:23:24 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:46710)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dIVJI-0004bm-NA
	for coreutils@gnu.org; Wed, 07 Jun 2017 03:23:20 -0400
Received: from localhost.localdomain (mobile-166-177-251-139.mycingular.net
	[166.177.251.139])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 8E2569A55;
	Wed,  7 Jun 2017 08:23:14 +0100 (IST)
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
To: coreutils@gnu.org
Subject: [PATCH] tests: fix issues with recently added tail test
Date: Wed,  7 Jun 2017 00:22:57 -0700
Message-Id: <20170607072257.23310-1-P@draigBrady.com>
X-Mailer: git-send-email 2.9.3
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Wed, 07 Jun 2017 07:23:25 -0000

* tests/tail-2/inotify-dir-recreate.sh: Skip when
inotify is not usable.  Also remove a bash specific &> construct.
---
 tests/tail-2/inotify-dir-recreate.sh | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tests/tail-2/inotify-dir-recreate.sh b/tests/tail-2/inotify-dir-recreate.sh
index eaa8422..02ddf96 100755
--- a/tests/tail-2/inotify-dir-recreate.sh
+++ b/tests/tail-2/inotify-dir-recreate.sh
@@ -3,7 +3,7 @@
 # of the watched file was removed and recreated.
 # (...instead of getting stuck forever)
 
-# Copyright (C) 2006-2017 Free Software Foundation, Inc.
+# Copyright (C) 2017 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
@@ -21,6 +21,8 @@
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ tail
 
+grep '^#define HAVE_INOTIFY 1' "$CONFIG_HEADER" >/dev/null && is_local_dir_ . \
+  || skip_ 'inotify is not supported'
 
 # Terminate any background tail process
 cleanup_() { kill $pid 2>/dev/null && wait $pid; }
@@ -52,10 +54,14 @@ grep_timeout_ ()
 mkdir dir && echo 'inotify' > dir/file || framework_failure_
 
 #tail must print content of the file to stdout, verify
-timeout 60 tail -F dir/file &>out & pid=$!
+timeout 60 tail -F dir/file >out 2>&1 & pid=$!
 grep_timeout_ 'inotify' 'out' ||
 { cleanup_fail_ 'file to be tailed does not exist'; }
 
+inotify_failed_re='inotify (resources exhausted|cannot be used)'
+grep -E "$inotify_failed_re" out &&
+  skip_ "inotify can't be used"
+
 # Remove the directory, should get the message about the deletion
 rm -r dir || framework_failure_
 grep_timeout_ 'polling' 'out' ||
-- 
2.9.3



From MAILER-DAEMON Wed Jun 07 03:24:10 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dIVK6-0000Fl-Ne
	for mharc-coreutils@gnu.org; Wed, 07 Jun 2017 03:24:10 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:52253)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dIVK4-0000EG-Nw
	for coreutils@gnu.org; Wed, 07 Jun 2017 03:24:09 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dIVK1-0004zy-Jk
	for coreutils@gnu.org; Wed, 07 Jun 2017 03:24:08 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:46712)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dIVK1-0004y4-D9
	for coreutils@gnu.org; Wed, 07 Jun 2017 03:24:05 -0400
Received: from localhost.localdomain (mobile-166-177-251-139.mycingular.net
	[166.177.251.139])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by mail.magicbluesmoke.com (Postfix) with ESMTPSA id 340439A55;
	Wed,  7 Jun 2017 08:24:02 +0100 (IST)
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
To: coreutils@gnu.org
Subject: [PATCH] tail: with --pid, ensure all inotify events are processed
Date: Wed,  7 Jun 2017 00:23:51 -0700
Message-Id: <20170607072352.23574-1-P@draigBrady.com>
X-Mailer: git-send-email 2.9.3
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Wed, 07 Jun 2017 07:24:09 -0000

* NEWS: Mention the bug fix.
* src/tail.c (tail_forever_inotify): With --pid, avoid waiting
for new events if there are still events to process.
* tests/tail-2/inotify-dir-recreate.sh: Adjust to trigger.
---
 NEWS                                 | 3 +++
 src/tail.c                           | 2 +-
 tests/tail-2/inotify-dir-recreate.sh | 2 +-
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index c811dbc..3330370 100644
--- a/NEWS
+++ b/NEWS
@@ -31,6 +31,9 @@ GNU coreutils NEWS                                    -*- outline -*-
   tail -F 'dir/file' is now monitored even when 'dir' is replaced.
   [bug introduced with inotify support added in coreutils-7.5]
 
+  tail -f with --pid no longer ignores some inotify events.
+  [bug introduced with inotify support added in coreutils-7.5]
+
   uptime no longer outputs the AM/PM component of the current time,
   as that's inconsistent with the 24 hour time format used.
   [bug introduced in coreutils-7.0]
diff --git a/src/tail.c b/src/tail.c
index 6328fe0..3582321 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -1577,7 +1577,7 @@ tail_forever_inotify (int wd, struct File_spec *f, size_t n_files,
 
       /* When watching a PID, ensure that a read from WD will not block
          indefinitely.  */
-      if (pid)
+      if (pid && (len <= evbuf_off))
         {
           if (writer_is_dead)
             exit (EXIT_SUCCESS);
diff --git a/tests/tail-2/inotify-dir-recreate.sh b/tests/tail-2/inotify-dir-recreate.sh
index 02ddf96..5c74c1d 100755
--- a/tests/tail-2/inotify-dir-recreate.sh
+++ b/tests/tail-2/inotify-dir-recreate.sh
@@ -54,7 +54,7 @@ grep_timeout_ ()
 mkdir dir && echo 'inotify' > dir/file || framework_failure_
 
 #tail must print content of the file to stdout, verify
-timeout 60 tail -F dir/file >out 2>&1 & pid=$!
+timeout 60 tail --pid=$$ -F dir/file >out 2>&1 & pid=$!
 grep_timeout_ 'inotify' 'out' ||
 { cleanup_fail_ 'file to be tailed does not exist'; }
 
-- 
2.9.3



From MAILER-DAEMON Wed Jun 07 04:00:26 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dIVtC-0005O6-Ns
	for mharc-coreutils@gnu.org; Wed, 07 Jun 2017 04:00:26 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:60401)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dIVtA-0005Nz-Kc
	for coreutils@gnu.org; Wed, 07 Jun 2017 04:00:25 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dIVt6-0003Mn-Pb
	for coreutils@gnu.org; Wed, 07 Jun 2017 04:00:24 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:46780)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dIVt6-0003M7-J6
	for coreutils@gnu.org; Wed, 07 Jun 2017 04:00:20 -0400
Received: from localhost.localdomain (mobile-166-177-251-139.mycingular.net
	[166.177.251.139])
	(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 6F9279B4B
	for <coreutils@gnu.org>; Wed,  7 Jun 2017 09:00:17 +0100 (IST)
To: Coreutils <coreutils@gnu.org>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Subject: [RFC] have tail always detect broken pipes
Message-ID: <ce845f35-2453-1393-6700-c712cc408fd5@draigBrady.com>
Date: Wed, 7 Jun 2017 01:00:13 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.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 2.2.x-3.x [generic]
	[fuzzy]
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: Wed, 07 Jun 2017 08:00:25 -0000

The following will hang indefinitely, due to no further data
being written through the pipe, and thus no SIGPIPE generated:

  $ tail -f /etc/hosts | sleep 1

A more practical use case might be:

  tail -f file.log | grep -q trigger &&
  process_immediately

Another case where one might notice this is that sometimes
(depending on how slow the reader is) the following will hang,
and you may not notice the issue until data arrives

  tail -f file.log | grep_typo filter

Below is a quick hack to support this,
and tail now terminates promptly for the above cases.

The implementation is a proof on concept done in a few minutes
(and may change from poll() to select() if possible).
A disadvantage is the extra syscalls to do the polling.
Actually I may be able to combine the existing select()
with this new poll(), and thus wait for changes in the
output as well as the inotify descriptor.

cheers,
P=C3=A1draig.


diff --git a/src/tail.c b/src/tail.c
index 3582321..7dca1d5 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -28,6 +28,7 @@
 #include <stdio.h>
 #include <assert.h>
 #include <getopt.h>
+#include <poll.h>
 #include <sys/types.h>
 #include <signal.h>

@@ -327,6 +328,16 @@ named file in a way that accommodates renaming, remo=
val and creation.\n\
   exit (status);
 }

+/* If the output has gone away, then terminate
+   as we would if we had written to this output.  */
+static void
+check_output (void)
+{
+  struct pollfd pfd =3D {.fd =3D STDOUT_FILENO, .events =3D POLLERR};
+  if (poll (&pfd, 1, 0) >=3D 0 && (pfd.revents & POLLERR))
+    raise (SIGPIPE);
+}
+
 static bool
 valid_file_spec (struct File_spec const *f)
 {
@@ -1244,6 +1255,8 @@ tail_forever (struct File_spec *f, size_t n_files, =
double sleep_interval)
       if ((!any_input || blocking) && fflush (stdout) !=3D 0)
         die (EXIT_FAILURE, errno, _("write error"));

+      check_output ();
+
       /* If nothing was read, sleep and/or check for dead writers.  */
       if (!any_input)
         {
@@ -1577,12 +1590,15 @@ tail_forever_inotify (int wd, struct File_spec *f=
, size_t n_files,

       /* When watching a PID, ensure that a read from WD will not block
          indefinitely.  */
-      if (pid && (len <=3D evbuf_off))
+      while (len <=3D evbuf_off)
         {
-          if (writer_is_dead)
-            exit (EXIT_SUCCESS);
+          if (pid)
+            {
+              if (writer_is_dead)
+                exit (EXIT_SUCCESS);

-          writer_is_dead =3D (kill (pid, 0) !=3D 0 && errno !=3D EPERM);
+              writer_is_dead =3D (kill (pid, 0) !=3D 0 && errno !=3D EPE=
RM);
+            }

           struct timeval delay; /* how long to wait for file changes.  *=
/
           if (writer_is_dead)
@@ -1600,9 +1616,14 @@ tail_forever_inotify (int wd, struct File_spec *f,=
 size_t n_files,
            int file_change =3D select (wd + 1, &rfd, NULL, NULL, &delay)=
;

            if (file_change =3D=3D 0)
-             continue;
+             {
+               check_output ();
+               continue;
+             }
            else if (file_change =3D=3D -1)
              die (EXIT_FAILURE, errno, _("error monitoring inotify event=
"));
+           else
+             break;
         }

       if (len <=3D evbuf_off)


From MAILER-DAEMON Wed Jun 07 11:04:32 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dIcVc-0007Vt-Q4
	for mharc-coreutils@gnu.org; Wed, 07 Jun 2017 11:04:32 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:34296)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dIcVa-0007Vi-NW
	for coreutils@gnu.org; Wed, 07 Jun 2017 11:04:31 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dIcVZ-0002t9-OG
	for coreutils@gnu.org; Wed, 07 Jun 2017 11:04:30 -0400
Received: from mail-vk0-x244.google.com ([2607:f8b0:400c:c05::244]:33510)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <meyering@gmail.com>) id 1dIcVZ-0002sn-Ic
	for coreutils@gnu.org; Wed, 07 Jun 2017 11:04:29 -0400
Received: by mail-vk0-x244.google.com with SMTP id c185so852947vkd.0
	for <coreutils@gnu.org>; Wed, 07 Jun 2017 08:04:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:sender:in-reply-to:references:from:date:message-id
	:subject:to:cc:content-transfer-encoding;
	bh=gZiUBe38ehjP0uxr/+Wm1CLJe0dn91yR9sV2uH5LIHk=;
	b=sNmtrMDQ9cQhR+QIFcrWIrdvEFE1SCCxg0mBgJXwtFTRyNAr61u9yJ2p1SPnWnKLvF
	eH1mIXsTPMdUzXZIREQo9xL3/8Bw8SbuSfZQN3Sq5CsiPRaOzmQ2E5H13RKq04rORhdR
	e+zCzH4T7IPL4lsJyio3TBNc+shcEWcJJcvRf2KiQ6eH+dUDCOLaD5+c6Je7Xi5m8J2n
	2MnbwJWP4snd88nJSUk7klU2m8sSkOuR12xxO9b7iHUGXqUkc5eMXUOdyU+JE+WQtXyR
	WNIGYSC9eEsEisWENmYYHVXxXkF6VG15YLicYutCiv667FYv0/sOPcLJkT4Q+DvGyglU
	hkzw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
	:date:message-id:subject:to:cc:content-transfer-encoding;
	bh=gZiUBe38ehjP0uxr/+Wm1CLJe0dn91yR9sV2uH5LIHk=;
	b=ffacjIEAtFqKFDtcqdYGOooDdeImhU5OB1uDP6VJUtdyg4QXUhAEJdBVfCRMCktOxA
	c1yKxG0JKJ9x2FSvudcJqNHSuulNylpQsQOobOA3obzho8aZukbTnenp3BvWfiTyaJIs
	OHY1plgf16rWYgWRremhtIlX5uZiTMtki/Jhf8DK+rGMT2LcALqakL18rWlWNHvUZ1lT
	XbtW9nlYRQ2Z+SmGvEEw8ZrJfnCfQOlTfU7X+ALvbI5ohA1dcP2/BLKVQ/sMyVoJlo9g
	DLzp9TEkhrJsdV8XjrlmYoqgw1BmvNP75za1U2+ZHagcsk+gH565Kk3AK5I8bTnuVVM5
	t2TA==
X-Gm-Message-State: AODbwcB3lAMIGPUeyBemu0fE5XaN8ne765ll4Fo2eNQrkFxqQCO46g/T
	ppLuGdXXsehDEOH6xMk1KXx0q3faDw==
X-Received: by 10.31.11.203 with SMTP id 194mr16421047vkl.12.1496847867401;
	Wed, 07 Jun 2017 08:04:27 -0700 (PDT)
MIME-Version: 1.0
Sender: meyering@gmail.com
Received: by 10.176.70.83 with HTTP; Wed, 7 Jun 2017 08:04:06 -0700 (PDT)
In-Reply-To: <20170607072352.23574-1-P@draigBrady.com>
References: <20170607072352.23574-1-P@draigBrady.com>
From: Jim Meyering <jim@meyering.net>
Date: Wed, 7 Jun 2017 08:04:06 -0700
X-Google-Sender-Auth: -MQbaRE2fSUcxOWdYdW4AZcrZWA
Message-ID: <CA+8g5KFdKtzpuMeuHOc2F9b7jM9XgzQFasUs-cgEXMB9aM0ALw@mail.gmail.com>
Subject: Re: [PATCH] tail: with --pid, ensure all inotify events are processed
To: =?UTF-8?Q?P=C3=A1draig_Brady?= <P@draigbrady.com>
Cc: Coreutils <coreutils@gnu.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:400c:c05::244
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, 07 Jun 2017 15:04:31 -0000

On Wed, Jun 7, 2017 at 12:23 AM, P=C3=A1draig Brady <P@draigbrady.com> wrot=
e:
> +  tail -f with --pid no longer ignores some inotify events.
> +  [bug introduced with inotify support added in coreutils-7.5]

Nice patch.
Might be worth clarifying that

  tail -f --pid=3DPID

no longer ignores events delivered just prior to PID death detection.


From MAILER-DAEMON Wed Jun 07 11:10:37 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dIcbV-0000On-7R
	for mharc-coreutils@gnu.org; Wed, 07 Jun 2017 11:10:37 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:35823)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dIcbM-0000Kx-Lo
	for coreutils@gnu.org; Wed, 07 Jun 2017 11:10:32 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dIcbL-0004N3-R9
	for coreutils@gnu.org; Wed, 07 Jun 2017 11:10:28 -0400
Received: from mail-vk0-x236.google.com ([2607:f8b0:400c:c05::236]:36485)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <meyering@gmail.com>) id 1dIcbL-0004Ms-MS
	for coreutils@gnu.org; Wed, 07 Jun 2017 11:10:27 -0400
Received: by mail-vk0-x236.google.com with SMTP id p85so6315264vkd.3
	for <coreutils@gnu.org>; Wed, 07 Jun 2017 08:10:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:sender:in-reply-to:references:from:date:message-id
	:subject:to:cc:content-transfer-encoding;
	bh=phuEXBURmr6TMO/ZUXFlwSWXK0bzGx0xYsjAZSgS4EM=;
	b=jAbVS08/GrOrfwMsFQ7tBKNzrniffyXAB7DxI+/QUGFqYJjakzQfxBt/IqOhTH2CW1
	Fd5ccPnB2teulHRB1OnzSPI6sPRhNvyaSZUM8StBpSMBwr0IQdHFs1YA76D1lW3zd+HN
	7YRFPAk8t3lGOQtKzWd3rucPnZqmNaT4yUK248zS4S2d331+VwwlPYSjXk+Fv7sHLk/J
	Cr8bN5xmUUQybR/9ZJM/ENRosXhcusZgtK7mGX9Ahhw7xZ46lnNkkoMXDFwjy/gbOWu6
	nqxhXywZtLWQ9YGTUzhDdJ3snPNz73W7S+FmrOiNT5lfTcKWljNBSlYHqlbQsR4rskJt
	1JJw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
	:date:message-id:subject:to:cc:content-transfer-encoding;
	bh=phuEXBURmr6TMO/ZUXFlwSWXK0bzGx0xYsjAZSgS4EM=;
	b=qGH+akudsnNgWO1qvHQYx0okS3NgCylf/SUnLpL2Z4frW0vvMcNFVy2a/IHlVOAEZW
	yZlE3SQTdcRQKYDOb0NHIxixnn89GKN8XC1z83s1Bm7qLkKlt4awRokhG1oSXrC7tmsJ
	MitCbWmtUUXJJKx/l3fqSSPo5XcT2NuFqMJYnmFj+W5o/B/8mssap1/rAIV4NrnHKGkK
	JCOLizhLCgdIwAfj9eOrpxr7JAaTNphYGbBshRCHpafywgtjwwl3AiuywHLzgf7CR2KX
	OQ85QnYqjGziC+fax3a/xiqJmJcZi7kKuqMa6D2ECQb7Ii4V8JqC+n0L7MkzqPCfIZ0B
	Db9w==
X-Gm-Message-State: AODbwcANwTjyIYrPFA6wND2yRBaKHF+3ytgoxr/WrTbyhN6Jyh+u4A8/
	HPzVLVLdHqM8v3YOBycqEnD9p73B0A==
X-Received: by 10.31.177.1 with SMTP id a1mr14628664vkf.1.1496848227099; Wed,
	07 Jun 2017 08:10:27 -0700 (PDT)
MIME-Version: 1.0
Sender: meyering@gmail.com
Received: by 10.176.70.83 with HTTP; Wed, 7 Jun 2017 08:10:06 -0700 (PDT)
In-Reply-To: <20170607072257.23310-1-P@draigBrady.com>
References: <20170607072257.23310-1-P@draigBrady.com>
From: Jim Meyering <jim@meyering.net>
Date: Wed, 7 Jun 2017 08:10:06 -0700
X-Google-Sender-Auth: OvFAqBp9Ul0zLgqAK9OMSLJGR_s
Message-ID: <CA+8g5KH6N9-Odc+HAQtTMR2DWYQc2kpncVdYh-ikdnSaDjUzWw@mail.gmail.com>
Subject: Re: [PATCH] tests: fix issues with recently added tail test
To: =?UTF-8?Q?P=C3=A1draig_Brady?= <P@draigbrady.com>
Cc: Coreutils <coreutils@gnu.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:400c:c05::236
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, 07 Jun 2017 15:10:32 -0000

On Wed, Jun 7, 2017 at 12:22 AM, P=C3=A1draig Brady <P@draigbrady.com> wrot=
e:
> * tests/tail-2/inotify-dir-recreate.sh: Skip when
> inotify is not usable.  Also remove a bash specific &> construct.

+1
Thanks!


From MAILER-DAEMON Wed Jun 07 13:07:25 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dIeQW-0001kv-Sy
	for mharc-coreutils@gnu.org; Wed, 07 Jun 2017 13:07:24 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:42126)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dIeQU-0001jR-RO
	for coreutils@gnu.org; Wed, 07 Jun 2017 13:07:23 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dIeQP-0002vI-NP
	for coreutils@gnu.org; Wed, 07 Jun 2017 13:07:22 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:47894)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dIeQP-0002uO-Gf
	for coreutils@gnu.org; Wed, 07 Jun 2017 13:07:17 -0400
Received: from localhost.localdomain (mobile-166-177-251-139.mycingular.net
	[166.177.251.139])
	(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 5D97DF8;
	Wed,  7 Jun 2017 18:07:14 +0100 (IST)
Subject: Re: [PATCH] tail: with --pid, ensure all inotify events are processed
To: Jim Meyering <jim@meyering.net>
References: <20170607072352.23574-1-P@draigBrady.com>
	<CA+8g5KFdKtzpuMeuHOc2F9b7jM9XgzQFasUs-cgEXMB9aM0ALw@mail.gmail.com>
Cc: Coreutils <coreutils@gnu.org>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <1b3eb52e-c53b-be9b-0cf2-743cc1d151af@draigBrady.com>
Date: Wed, 7 Jun 2017 10:07:11 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <CA+8g5KFdKtzpuMeuHOc2F9b7jM9XgzQFasUs-cgEXMB9aM0ALw@mail.gmail.com>
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]
	[fuzzy]
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: Wed, 07 Jun 2017 17:07:23 -0000

On 07/06/17 08:04, Jim Meyering wrote:
> On Wed, Jun 7, 2017 at 12:23 AM, P=C3=A1draig Brady <P@draigbrady.com> =
wrote:
>> +  tail -f with --pid no longer ignores some inotify events.
>> +  [bug introduced with inotify support added in coreutils-7.5]
>=20
> Nice patch.
> Might be worth clarifying that
>=20
>   tail -f --pid=3DPID
>=20
> no longer ignores events delivered just prior to PID death detection.

Note the events may be ignored completely upon PID death,
or be delayed until future events on the monitored files.
I'll clarify

thanks,
P=C3=A1draig


From MAILER-DAEMON Wed Jun 07 17:27:38 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dIiUM-0002Cy-Or
	for mharc-coreutils@gnu.org; Wed, 07 Jun 2017 17:27:38 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:48181)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1dIiUK-0002Cj-2T
	for coreutils@gnu.org; Wed, 07 Jun 2017 17:27:37 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1dIiUG-0008Qc-T6
	for coreutils@gnu.org; Wed, 07 Jun 2017 17:27:36 -0400
Received: from mout.kundenserver.de ([212.227.126.133]:56047)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <mail@bernhard-voelker.de>)
	id 1dIiUG-0008Pa-HW
	for coreutils@gnu.org; Wed, 07 Jun 2017 17:27:32 -0400
Received: from [192.168.101.10] ([91.12.174.113]) by mrelayeu.kundenserver.de
	(mreue004 [212.227.15.167]) with ESMTPSA (Nemesis) id
	0M3fC1-1e9r4T0V17-00rHXj; Wed, 07 Jun 2017 23:27:28 +0200
Subject: Re: [RFC] have tail always detect broken pipes
To: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>,
	Coreutils <coreutils@gnu.org>
References: <ce845f35-2453-1393-6700-c712cc408fd5@draigBrady.com>
From: Bernhard Voelker <mail@bernhard-voelker.de>
Message-ID: <8dff9824-d206-abeb-d31e-1b0bc507524f@bernhard-voelker.de>
Date: Wed, 7 Jun 2017 23:27:27 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.6.0
MIME-Version: 1.0
In-Reply-To: <ce845f35-2453-1393-6700-c712cc408fd5@draigBrady.com>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Provags-ID: V03:K0:NWFOjpjaamp0EyM8uKsCPLyLog0d/3IT6F0rUSc7wMXXzvV3pLN
	Af+PVVRTQWPr+Tzne3hk7pxBJLgljFcjo0PalIZj3lZBOFYDMic4U/xGk6hQr4ejYnNFsuO
	97L8HikOw4guZhrsjFl53spYb/Zy7oGXjQN//1na2ou4DR3E4qZMdw+KLk+M9w8Pe+aoa0L
	zOk9D7DD0jJo3JlNOXppQ==
X-UI-Out-Filterresults: notjunk:1;V01:K0:e8Af3vmLUEk=:wZFRIrCqZfKG0GPvn7w+dp
	+3dzn7S3u2yMneetYcwKI4eRd+gW/BZWgWj0NKEx6bVOQK+U+LHZ889I+NziLDkXf9b1I92CL
	Ueu7xtHm+X1VJsHM6TcdTjgSAB/R70cBDdcOfzJad1WcjfLyvKV682qEvEyHD/CpwOvm8nhGr
	V66XAinzPzFpVei/ZSRgy0bLwbLmNhwgZ4j74Tfka7wfcwDxpbU3e3d6LDI4oNZyEw+BGS4/z
	5wdH3cj36M0NbJPsvTe1dp5lOUIvZTHELnl+Voa+W3YoPeuu0c2D9nCTu1C0dWZ/SNW3G0iYF
	yjfXUCkxag+km1Af8dWUXJiDAfk9Q3M+ROUMxwV9b/EbeHpecD+KBT76QoZqccKnc9l78pfne
	Ln+aXoUXpO3jHRfjOFEbRaIswHf0IMtRu1wgDmX+CDhgW4yJ60O/WNOy76V5Vf7fl6Lio0HC0
	fgvNd+z3pqhfwIExr0jEEyhAJZdLB2RX2VKjRV6GQkQn4wqup4GRjjBq90RlmVm9FaN7fUeFC
	+qG0UFUlXVDONwBTleKACrXgams1dGWuFfqhFIYTNXrdklsB0sT/bi1EzvJHKwzCP3ffXURd0
	y4h+kCVLs6NP/KCWazfdDFw5RuWqC34tszIVL9itNgfB4xdhmEJnWKwV1myeBHNwC7hTJP/Zc
	iFiDK/9iSq0TFsp23zYK/bWc8YoFe+IjjWYrKY1Q7MwSG+grcStKN9ySYZrsNRzgUP/kWxNIz
	/94Nb32bI3vtsASd
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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, 07 Jun 2017 21:27:37 -0000

On 06/07/2017 10:00 AM, Pádraig Brady wrote:
> The following will hang indefinitely, due to no further data
> being written through the pipe, and thus no SIGPIPE generated:
> 
>   $ tail -f /etc/hosts | sleep 1
> 
> A more practical use case might be:
> 
>   tail -f file.log | grep -q trigger &&
>   process_immediately
> 
> Another case where one might notice this is that sometimes
> (depending on how slow the reader is) the following will hang,
> and you may not notice the issue until data arrives
> 
>   tail -f file.log | grep_typo filter

indeed, annoying.

> Below is a quick hack to support this,
> and tail now terminates promptly for the above cases.

I didn't have a look at the patch below (no time, sorry), but ...

> The implementation is a proof on concept done in a few minutes
> (and may change from poll() to select() if possible).
> A disadvantage is the extra syscalls to do the polling.
> Actually I may be able to combine the existing select()
> with this new poll(), and thus wait for changes in the
> output as well as the inotify descriptor.

... I think this is related to another aspect: should tail consume
more input when the reader following in the pipe terminates?

  $ seq 100000 | { tail -c +5 | sed -n '1{p;q}'; cat; } | head -n5
  3
  505
  15506
  15507
  15508

Although the above is a corner case, POSIX doesn't specify explicitly
for tail(1) what to do when the reader terminates, but it would be nice
to have a deterministic behavior, wouldn't it?

Thanks & have a nice day,
Berny


From MAILER-DAEMON Fri Jun 09 01:26:07 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dJCQx-0003O1-Ie
	for mharc-coreutils@gnu.org; Fri, 09 Jun 2017 01:26:07 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:46719)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dJCQu-0003Mb-W7
	for coreutils@gnu.org; Fri, 09 Jun 2017 01:26:05 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dJCQr-0006FP-1l
	for coreutils@gnu.org; Fri, 09 Jun 2017 01:26:05 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:47606)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dJCQq-0006Cl-Q6
	for coreutils@gnu.org; Fri, 09 Jun 2017 01:26:00 -0400
Received: from localhost.localdomain (mobile-166-177-251-160.mycingular.net
	[166.177.251.160])
	(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 3A2134ACA;
	Fri,  9 Jun 2017 06:25:54 +0100 (IST)
Subject: Re: [RFC] have tail always detect broken pipes
To: Bernhard Voelker <mail@bernhard-voelker.de>, Coreutils <coreutils@gnu.org>
References: <ce845f35-2453-1393-6700-c712cc408fd5@draigBrady.com>
	<8dff9824-d206-abeb-d31e-1b0bc507524f@bernhard-voelker.de>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <e5db03aa-d5e8-b307-6980-f04a4dcacd49@draigBrady.com>
Date: Thu, 8 Jun 2017 22:25:51 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <8dff9824-d206-abeb-d31e-1b0bc507524f@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]
	[fuzzy]
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: Fri, 09 Jun 2017 05:26:06 -0000

On 07/06/17 14:27, Bernhard Voelker wrote:
> On 06/07/2017 10:00 AM, P=C3=A1draig Brady wrote:
>> The following will hang indefinitely, due to no further data
>> being written through the pipe, and thus no SIGPIPE generated:
>>
>>   $ tail -f /etc/hosts | sleep 1
>>
>> A more practical use case might be:
>>
>>   tail -f file.log | grep -q trigger &&
>>   process_immediately
>>
>> Another case where one might notice this is that sometimes
>> (depending on how slow the reader is) the following will hang,
>> and you may not notice the issue until data arrives
>>
>>   tail -f file.log | grep_typo filter
>=20
> indeed, annoying.
>=20
>> Below is a quick hack to support this,
>> and tail now terminates promptly for the above cases.
>=20
> I didn't have a look at the patch below (no time, sorry), but ...
>=20
>> The implementation is a proof on concept done in a few minutes
>> (and may change from poll() to select() if possible).
>> A disadvantage is the extra syscalls to do the polling.
>> Actually I may be able to combine the existing select()
>> with this new poll(), and thus wait for changes in the
>> output as well as the inotify descriptor.
>=20
> ... I think this is related to another aspect: should tail consume
> more input when the reader following in the pipe terminates?
>=20
>   $ seq 100000 | { tail -c +5 | sed -n '1{p;q}'; cat; } | head -n5
>   3
>   505
>   15506
>   15507
>   15508
>=20
> Although the above is a corner case, POSIX doesn't specify explicitly
> for tail(1) what to do when the reader terminates, but it would be nice
> to have a deterministic behavior, wouldn't it?

I agree it would, but these are async processes,
so I'm not sure we can have such deterministic behavior between them.
We can (and do) flush the output, but the reader may still
be present and processing previous data.  I think the only
guarantee one can make between async processes like this
is that sources can exit in a "timely manner" when the sinks terminate.
Another way to look at it is there are various buffers in play here
and tail will not get a SIGPIPE even if sed in the example above
has only read a portion of the data that tail wrote.

To demonstrate the non-determinism of your example:

$ seq 100000 | { src/tail -c +5 | sed -n '1{p;q}'; cat; } | head -n5
3
505
15506
15507
15508

$ seq 100000 | { src/tail -c +5 | sed -n '1{p;q}'; cat; } | head -n5
3
457
13458
13459
13460

So sed processed and exited a bit more quickly in the second case.

cheers,
P=C3=A1draig


From MAILER-DAEMON Fri Jun 09 01:46:55 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dJCl5-0006jk-K9
	for mharc-coreutils@gnu.org; Fri, 09 Jun 2017 01:46:55 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:51751)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dJCl2-0006gz-SE
	for coreutils@gnu.org; Fri, 09 Jun 2017 01:46:54 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dJCkx-0004vE-SN
	for coreutils@gnu.org; Fri, 09 Jun 2017 01:46:52 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:47668)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dJCkx-0004uv-H3
	for coreutils@gnu.org; Fri, 09 Jun 2017 01:46:47 -0400
Received: from localhost.localdomain (mobile-166-177-251-160.mycingular.net
	[166.177.251.160])
	(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 814164B19
	for <coreutils@gnu.org>; Fri,  9 Jun 2017 06:46:44 +0100 (IST)
Subject: Re: [RFC] have tail always detect broken pipes
To: Coreutils <coreutils@gnu.org>
References: <ce845f35-2453-1393-6700-c712cc408fd5@draigBrady.com>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <15618948-473c-838a-ef09-8b375f778f45@draigBrady.com>
Date: Thu, 8 Jun 2017 22:46:41 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <ce845f35-2453-1393-6700-c712cc408fd5@draigBrady.com>
Content-Type: multipart/mixed; boundary="------------659D8D8CAAA8D324E4477D13"
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Fri, 09 Jun 2017 05:46:54 -0000

This is a multi-part message in MIME format.
--------------659D8D8CAAA8D324E4477D13
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

On 07/06/17 01:00, P=C3=A1draig Brady wrote:
> The following will hang indefinitely, due to no further data
> being written through the pipe, and thus no SIGPIPE generated:
>=20
>   $ tail -f /etc/hosts | sleep 1
>=20
> A more practical use case might be:
>=20
>   tail -f file.log | grep -q trigger &&
>   process_immediately
>=20
> Another case where one might notice this is that sometimes
> (depending on how slow the reader is) the following will hang,
> and you may not notice the issue until data arrives
>=20
>   tail -f file.log | grep_typo filter
>=20
> Below is a quick hack to support this,
> and tail now terminates promptly for the above cases.
>=20
> The implementation is a proof on concept done in a few minutes
> (and may change from poll() to select() if possible).
> A disadvantage is the extra syscalls to do the polling.
> Actually I may be able to combine the existing select()
> with this new poll(), and thus wait for changes in the
> output as well as the inotify descriptor.
>=20
> cheers,
> P=C3=A1draig.
>=20
>=20
> diff --git a/src/tail.c b/src/tail.c

> +/* If the output has gone away, then terminate
> +   as we would if we had written to this output.  */
> +static void
> +check_output (void)
> +{
> +  struct pollfd pfd =3D {.fd =3D STDOUT_FILENO, .events =3D POLLERR};
> +  if (poll (&pfd, 1, 0) >=3D 0 && (pfd.revents & POLLERR))
> +    raise (SIGPIPE);
> +}
> +

The attached changes from using poll() to using select(),
which was already used in tail(1), and avoids the repeated
poll() calls in the normal case.

cheers,
P=C3=A1draig

--------------659D8D8CAAA8D324E4477D13
Content-Type: text/x-patch;
 name="tail-pipe.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="tail-pipe.diff"

>From de5659a015d4e3e2d5dce65e8fb16cebf2b09d26 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
Date: Wed, 7 Jun 2017 01:00:28 -0700
Subject: [PATCH] tail: exit promptly when output no longer writable

This will support use cases like:

  tail -f file.log | grep -q trigger &&
  process_immediately

* src/tail.c (check_output_alive): A new function that
uses select on fifos or pipes to detect if they're broken.
(tail_forever): Call check_output_alive() periodically.
(tail_forever_inotify): Merge the select() call from
check_output_alive() into the select() originally present
for the --pid case, and adjust accordingly.
* tests/tail-2/pipe-f.sh: Add test cases.
* NEWS: Mention the improvement.
---
 NEWS                   |  3 ++
 src/tail.c             | 77 +++++++++++++++++++++++++++++++++++++++++---------
 tests/tail-2/pipe-f.sh | 21 +++++++++++---
 3 files changed, 84 insertions(+), 17 deletions(-)

diff --git a/NEWS b/NEWS
index 508c08f..d2672e8 100644
--- a/NEWS
+++ b/NEWS
@@ -53,6 +53,9 @@ GNU coreutils NEWS                                    -*- outline -*-
 
   mv --verbose now distinguishes rename and copy operations.
 
+  tail -f will now exit immediately if the output is piped
+  and the reader of the pipe terminates.
+
 
 * Noteworthy changes in release 8.27 (2017-03-08) [stable]
 
diff --git a/src/tail.c b/src/tail.c
index 3582321..9329145 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -175,6 +175,9 @@ static enum Follow_mode follow_mode = Follow_descriptor;
 /* If true, read from the ends of all specified files until killed.  */
 static bool forever;
 
+/* If true, monitor output so we exit if pipe reader terminates.  */
+static bool monitor_output;
+
 /* If true, count from start of file instead of end.  */
 static bool from_start;
 
@@ -327,6 +330,27 @@ named file in a way that accommodates renaming, removal and creation.\n\
   exit (status);
 }
 
+/* If the output has gone away, then terminate
+   as we would if we had written to this output.  */
+static void
+check_output_alive (void)
+{
+  if (! monitor_output)
+    return;
+
+  struct timeval delay;
+  delay.tv_sec = delay.tv_usec = 0;
+
+  fd_set rfd;
+  FD_ZERO (&rfd);
+  FD_SET (STDOUT_FILENO, &rfd);
+
+  /* readable event on STDOUT is equivalent to POLLERR,
+     and implies an error condition on output like broken pipe.  */
+  if (select (STDOUT_FILENO + 1, &rfd, NULL, NULL, &delay) == 1)
+    raise (SIGPIPE);
+}
+
 static bool
 valid_file_spec (struct File_spec const *f)
 {
@@ -1244,6 +1268,8 @@ tail_forever (struct File_spec *f, size_t n_files, double sleep_interval)
       if ((!any_input || blocking) && fflush (stdout) != 0)
         die (EXIT_FAILURE, errno, _("write error"));
 
+      check_output_alive ();
+
       /* If nothing was read, sleep and/or check for dead writers.  */
       if (!any_input)
         {
@@ -1577,32 +1603,48 @@ tail_forever_inotify (int wd, struct File_spec *f, size_t n_files,
 
       /* When watching a PID, ensure that a read from WD will not block
          indefinitely.  */
-      if (pid && (len <= evbuf_off))
+      while (len <= evbuf_off)
         {
-          if (writer_is_dead)
-            exit (EXIT_SUCCESS);
-
-          writer_is_dead = (kill (pid, 0) != 0 && errno != EPERM);
-
           struct timeval delay; /* how long to wait for file changes.  */
-          if (writer_is_dead)
-            delay.tv_sec = delay.tv_usec = 0;
-          else
+
+          if (pid)
             {
-              delay.tv_sec = (time_t) sleep_interval;
-              delay.tv_usec = 1000000 * (sleep_interval - delay.tv_sec);
+              if (writer_is_dead)
+                exit (EXIT_SUCCESS);
+
+              writer_is_dead = (kill (pid, 0) != 0 && errno != EPERM);
+
+              if (writer_is_dead)
+                delay.tv_sec = delay.tv_usec = 0;
+              else
+                {
+                  delay.tv_sec = (time_t) sleep_interval;
+                  delay.tv_usec = 1000000 * (sleep_interval - delay.tv_sec);
+                }
             }
 
            fd_set rfd;
            FD_ZERO (&rfd);
            FD_SET (wd, &rfd);
+           if (monitor_output)
+             FD_SET (STDOUT_FILENO, &rfd);
 
-           int file_change = select (wd + 1, &rfd, NULL, NULL, &delay);
+           int file_change = select (MAX (wd, STDOUT_FILENO) + 1,
+                                     &rfd, NULL, NULL, pid ? &delay: NULL);
 
            if (file_change == 0)
              continue;
            else if (file_change == -1)
-             die (EXIT_FAILURE, errno, _("error monitoring inotify event"));
+             die (EXIT_FAILURE, errno,
+                  _("error waiting for inotify and output events"));
+           else if (FD_ISSET (STDOUT_FILENO, &rfd))
+             {
+               /* readable event on STDOUT is equivalent to POLLERR,
+                  and implies an error on output like broken pipe.  */
+               raise (SIGPIPE);
+             }
+           else
+             break;
         }
 
       if (len <= evbuf_off)
@@ -2350,6 +2392,15 @@ main (int argc, char **argv)
 
   if (forever && ignore_fifo_and_pipe (F, n_files))
     {
+      /* If stdout is a fifo or pipe, then monitor it
+         so that we exit if the reader goes away.
+         Note select() on a regular file is always readable.  */
+      struct stat out_stat;
+      if (fstat (STDOUT_FILENO, &out_stat) < 0)
+        die (EXIT_FAILURE, errno, _("standard output"));
+      monitor_output = (S_ISFIFO (out_stat.st_mode)
+                        || (HAVE_FIFO_PIPES != 1 && isapipe (STDOUT_FILENO)));
+
 #if HAVE_INOTIFY
       /* tailable_stdin() checks if the user specifies stdin via  "-",
          or implicitly by providing no arguments. If so, we won't use inotify.
diff --git a/tests/tail-2/pipe-f.sh b/tests/tail-2/pipe-f.sh
index 00b99d9..b2ea506 100755
--- a/tests/tail-2/pipe-f.sh
+++ b/tests/tail-2/pipe-f.sh
@@ -1,5 +1,5 @@
 #!/bin/sh
-# ensure that :|tail -f doesn't hang, per POSIX
+# ensure that tail -f doesn't hang in various cases
 
 # Copyright (C) 2009-2017 Free Software Foundation, Inc.
 
@@ -19,15 +19,28 @@
 . "${srcdir=.}/tests/init.sh"; path_prepend_ ./src
 print_ver_ tail
 
+# Speedup the non inotify case
+fastpoll='-s.1 --max-unchanged-stats=1'
+
+for mode in '' '---disable-inotify'; do
+# Ensure :|tail -f doesn't hang, per POSIX
 echo oo > exp || framework_failure_
-echo foo | timeout 10 tail -f -c3 > out || fail=1
+echo foo | timeout 10 tail -f $mode $fastpoll -c3 > out || fail=1
 compare exp out || fail=1
-
 cat <<\EOF > exp || framework_failure_
 ==> standard input <==
 ar
 EOF
-echo bar | returns_ 1 timeout 10 tail -f -c3 - missing > out || fail=1
+echo bar | returns_ 1 \
+ timeout 10 tail -f $mode $fastpoll -c3 - missing > out || fail=1
 compare exp out || fail=1
 
+# This would wait indefinitely before v8.28 due to no EPIPE being
+# generated due to no data written after the first small amount
+timeout 10 tail -f $mode $fastpoll out | sleep .1 || fail=1
+
+# This would wait indefinitely before v8.28 (until first write)
+returns_ 1 timeout 10 tail -f $mode $fastpoll /dev/null >&- || fail=1
+done
+
 Exit $fail
-- 
2.9.3


--------------659D8D8CAAA8D324E4477D13--


From MAILER-DAEMON Sat Jun 10 16:04:59 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dJmd1-0000m6-5G
	for mharc-coreutils@gnu.org; Sat, 10 Jun 2017 16:04:59 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:34408)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dJmcy-0000lz-W6
	for coreutils@gnu.org; Sat, 10 Jun 2017 16:04:58 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dJmcx-0000NC-BL
	for coreutils@gnu.org; Sat, 10 Jun 2017 16:04:56 -0400
Received: from mail-pf0-x22d.google.com ([2607:f8b0:400e:c00::22d]:34155)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <meyering@gmail.com>) id 1dJmcx-0000N6-2i
	for coreutils@gnu.org; Sat, 10 Jun 2017 16:04:55 -0400
Received: by mail-pf0-x22d.google.com with SMTP id 15so11316596pfc.1
	for <coreutils@gnu.org>; Sat, 10 Jun 2017 13:04:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=sender:from:to:subject:date:message-id:mime-version;
	bh=8Y0V3AlDnTBvzXG4b4lro0wUmShc1umWq9lOTohjub8=;
	b=TSmRO9S4rbn8MOatyFY/Z7OH6V/FbP3QpRbAuw5JmCjVridoD05tFBVFKB/YFsdHjy
	ATLNwRZ/zIWAYtqCkgU+dCsCYN/0kWN3JoDBMgon9JGMKSNIojilJXlytUKuVFJBgkBw
	8evkZCER09OjorC62GpwBnRmcMnO2duS5X3p6rVsF0tcl+Bh9DHSsr/4Crffqpdbf02t
	ejw+gy3XS4b5s2DiVyekx9A6ycDbSexe2RJsgg5jSEV/kgEYjW1WebhGnRr0nvZFjORX
	UUl9GDWWPZVTiNXeQ3TQLuDmxToFAaLrdkSvJsXhXFn7y4E3dOhxJx1UGncmF8DCmKU0
	lggw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:sender:from:to:subject:date:message-id
	:mime-version;
	bh=8Y0V3AlDnTBvzXG4b4lro0wUmShc1umWq9lOTohjub8=;
	b=DIP36tujP8CRO/htFsPQ6uyzClQhhqtoPvcZk8KNhnMs0OkPGTNiWySlN5FgnVXtZt
	0GcUpYLm616ophpvn+y7AsyNk0iHfsowmedhsbjvEzRqcIATD/X3lAWNbeaW6h5D19PN
	3IEpf/FonX3VmgUrdFF0dK44VCAGedrcot9LAkedLo/3ZVHzUTXeS+uP2UkslgbUrasy
	uhKDznyBZUNTyTjN6czoX5G9EWY/HNR5uUhu0ZMHaDGrL7W40xGGO1vQdr2zCPw8OiM6
	xPWSFhh8qO7/4hkrFUHKLhaag3cdGtLtB2JcW+XLNF0AIaS0Ml4JBa5+mt+bITWjZ5FW
	cmXQ==
X-Gm-Message-State: AODbwcApweFQ4bFz+Eft91iVTpTFYzi5HUO3sOhZqtC6bw8SDNKfalfi
	46QbtmV3sTlTnY4X
X-Received: by 10.98.14.131 with SMTP id 3mr49186054pfo.23.1497125093558;
	Sat, 10 Jun 2017 13:04:53 -0700 (PDT)
Received: from markatto-mbp.DHCP.thefacebook.com ([2620:10d:c090:180::1:6ee9])
	by smtp.gmail.com with ESMTPSA id
	b1sm12476688pfl.70.2017.06.10.13.04.52 for <coreutils@gnu.org>
	(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
	Sat, 10 Jun 2017 13:04:52 -0700 (PDT)
Sender: Jim Meyering <meyering@gmail.com>
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH] maint: update to work with GCC7's
	-Werror=implicit-fallthrough=
Date: Sat, 10 Jun 2017 13:04:50 -0700
Message-ID: <lubpf3fuf738yl.fsf@meyering.net>
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:400e:c00::22d
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: Sat, 10 Jun 2017 20:04:58 -0000

This (with today's gnulib/lib/savewd.c change) addresses all of
coreutils' build errors due to -Werror=implicit-fallthrough= 

>From 68f9e301d1737158f8ec5455c019826431bdba93 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@fb.com>
Date: Sat, 10 Jun 2017 10:02:31 -0700
Subject: [PATCH] maint: update to work with GCC7's
 -Werror=implicit-fallthrough=

* src/system.h (FALLTHROUGH): Define.
* src/cp.c (main): Use new FALLTHROUGH macro in place of comments.
* src/basename.c (main): Likewise.
* src/dircolors.c (append_quoted): Likewise.
* src/echo.c (main): Likewise.
* src/fold.c (main): Likewise.
* src/join.c (main): Likewise.
* src/kill.c (main): Likewise.
* src/ls.c (get_funky_string, gobble_file): Likewise.
* src/sort.c (parse_field_count, main): Likewise.
* src/stat.c (print_it): Likewise.
* src/tail.c (parse_obsolete_option): Likewise.
* src/test.c (posixtest): Likewise.
* src/wc.c (wc): Likewise.
* src/who.c (main): Likewise.
---
 src/basename.c  | 2 +-
 src/cp.c        | 2 +-
 src/dircolors.c | 2 +-
 src/echo.c      | 2 +-
 src/fold.c      | 2 +-
 src/join.c      | 2 +-
 src/kill.c      | 6 +++---
 src/ls.c        | 4 ++--
 src/sort.c      | 6 +++---
 src/stat.c      | 2 +-
 src/system.h    | 8 ++++++++
 src/tail.c      | 4 ++--
 src/test.c      | 2 +-
 src/wc.c        | 8 ++++----
 src/who.c       | 2 +-
 15 files changed, 31 insertions(+), 23 deletions(-)

diff --git a/src/basename.c b/src/basename.c
index d593197e8..5c0f11d84 100644
--- a/src/basename.c
+++ b/src/basename.c
@@ -147,7 +147,7 @@ main (int argc, char **argv)
         case 's':
           suffix = optarg;
           /* -s implies -a, so...  */
-          /* fall through */
+          FALLTHROUGH;

         case 'a':
           multiple_names = true;
diff --git a/src/cp.c b/src/cp.c
index a2f67d864..ec09ed5dd 100644
--- a/src/cp.c
+++ b/src/cp.c
@@ -1045,7 +1045,7 @@ main (int argc, char **argv)
               x.require_preserve = true;
               break;
             }
-          /* fall through */
+          FALLTHROUGH;

         case 'p':
           x.preserve_ownership = true;
diff --git a/src/dircolors.c b/src/dircolors.c
index d0cfdbade..069f44872 100644
--- a/src/dircolors.c
+++ b/src/dircolors.c
@@ -216,7 +216,7 @@ append_quoted (const char *str)
         case '=':
           if (need_backslash)
             APPEND_CHAR ('\\');
-          /* Fall through */
+          FALLTHROUGH;

         default:
           need_backslash = true;
diff --git a/src/echo.c b/src/echo.c
index 0df0f25b7..852309d23 100644
--- a/src/echo.c
+++ b/src/echo.c
@@ -231,7 +231,7 @@ just_echo:
                       if (! ('0' <= *s && *s <= '7'))
                         break;
                       c = *s++;
-                      /* Fall through.  */
+                      FALLTHROUGH;
                     case '1': case '2': case '3':
                     case '4': case '5': case '6': case '7':
                       c -= '0';
diff --git a/src/fold.c b/src/fold.c
index 6c1459d42..05c05f6ba 100644
--- a/src/fold.c
+++ b/src/fold.c
@@ -278,7 +278,7 @@ main (int argc, char **argv)
               optargbuf[1] = '\0';
               optarg = optargbuf;
             }
-          /* Fall through.  */
+          FALLTHROUGH;
         case 'w':		/* Line width. */
           width = xdectoumax (optarg, 1, SIZE_MAX - TAB_WIDTH - 1, "",
                               _("invalid number of columns"), 0);
diff --git a/src/join.c b/src/join.c
index 082f50893..93570adeb 100644
--- a/src/join.c
+++ b/src/join.c
@@ -1041,7 +1041,7 @@ main (int argc, char **argv)
         {
         case 'v':
             print_pairables = false;
-            /* Fall through.  */
+            FALLTHROUGH;

         case 'a':
           {
diff --git a/src/kill.c b/src/kill.c
index fd998790d..330fa8ff4 100644
--- a/src/kill.c
+++ b/src/kill.c
@@ -246,7 +246,7 @@ main (int argc, char **argv)
             optind--;
             goto no_more_options;
           }
-        /* Fall through.  */
+        FALLTHROUGH;
       case 'A': case 'B': case 'C': case 'D': case 'E':
       case 'F': case 'G': case 'H': case 'I': case 'J':
       case 'K': /*case 'L':*/ case 'M': case 'N': case 'O':
@@ -261,7 +261,7 @@ main (int argc, char **argv)
             usage (EXIT_FAILURE);
           }
         optarg--;
-        /* Fall through.  */
+        FALLTHROUGH;
       case 'n': /* -n is not documented, but is for Bash compatibility.  */
       case 's':
         if (0 <= signum)
@@ -277,7 +277,7 @@ main (int argc, char **argv)
       case 'L': /* -L is not documented, but is for procps compatibility.  */
       case 't':
         table = true;
-        /* Fall through.  */
+        FALLTHROUGH;
       case 'l':
         if (list)
           {
diff --git a/src/ls.c b/src/ls.c
index 73498181e..9477d31be 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -2269,7 +2269,7 @@ get_funky_string (char **dest, const char **src, bool equals_end,
                   state = ST_END; /* End */
                   break;
                 }
-              /* else fall through */
+              FALLTHROUGH;
             default:
               *(q++) = *(p++);
               ++count;
@@ -3157,7 +3157,7 @@ gobble_file (char const *name, enum filetype type, ino_t inode,
                  directory, and --dereference-command-line-symlink-to-dir is
                  in effect.  Fall through so that we call lstat instead.  */
             }
-          /* fall through */
+          FALLTHROUGH;

         default: /* DEREF_NEVER */
           err = lstat (absolute_name, &f->stat);
diff --git a/src/sort.c b/src/sort.c
index e5fecf90a..d9a2edbfd 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -4086,7 +4086,7 @@ parse_field_count (char const *string, size_t *val, char const *msgid)
       *val = n;
       if (*val == n)
         break;
-      /* Fall through.  */
+      FALLTHROUGH;
     case LONGINT_OVERFLOW:
     case LONGINT_OVERFLOW | LONGINT_INVALID_SUFFIX_CHAR:
       *val = SIZE_MAX;
@@ -4386,7 +4386,7 @@ main (int argc, char **argv)

         case SORT_OPTION:
           c = XARGMATCH ("--sort", optarg, sort_args, sort_types);
-          /* Fall through. */
+          FALLTHROUGH;
         case 'b':
         case 'd':
         case 'f':
@@ -4410,7 +4410,7 @@ main (int argc, char **argv)
           c = (optarg
                ? XARGMATCH ("--check", optarg, check_args, check_types)
                : 'c');
-          /* Fall through.  */
+          FALLTHROUGH;
         case 'c':
         case 'C':
           if (checkonly && checkonly != c)
diff --git a/src/stat.c b/src/stat.c
index d085cd059..f5e930b1b 100644
--- a/src/stat.c
+++ b/src/stat.c
@@ -1252,7 +1252,7 @@ print_it (char const *format, int fd, char const *filename,
               {
               case '\0':
                 --b;
-                /* fall through */
+                FALLTHROUGH;
               case '%':
                 if (0 < len)
                   {
diff --git a/src/system.h b/src/system.h
index bbd8b13b5..71ff8419e 100644
--- a/src/system.h
+++ b/src/system.h
@@ -781,3 +781,11 @@ is_ENOTSUP (int err)
   quotearg_style (shell_escape_always_quoting_style, arg)
 #define quoteaf_n(n, arg) \
   quotearg_n_style (n, shell_escape_always_quoting_style, arg)
+
+#ifndef FALLTHROUGH
+# if __GNUC__ < 7
+#  define FALLTHROUGH ((void) 0)
+# else
+#  define FALLTHROUGH __attribute__ ((__fallthrough__))
+# endif
+#endif
diff --git a/src/tail.c b/src/tail.c
index 3582321bc..34fa25c90 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -2064,8 +2064,8 @@ parse_obsolete_option (int argc, char * const *argv, uintmax_t *n_units)

   switch (*p)
     {
-    case 'b': default_count *= 512;	/* Fall through.  */
-    case 'c': t_count_lines = false;	/* Fall through.  */
+    case 'b': default_count *= 512; FALLTHROUGH;
+    case 'c': t_count_lines = false; FALLTHROUGH;
     case 'l': p++; break;
     }

diff --git a/src/test.c b/src/test.c
index dcb83536c..05774d325 100644
--- a/src/test.c
+++ b/src/test.c
@@ -686,7 +686,7 @@ posixtest (int nargs)
             advance (false);
             break;
           }
-        /* FALLTHROUGH */
+        FALLTHROUGH;
       case 5:
       default:
         if (nargs <= 0)
diff --git a/src/wc.c b/src/wc.c
index be4f3062d..8a656c3d0 100644
--- a/src/wc.c
+++ b/src/wc.c
@@ -426,7 +426,7 @@ wc (int fd, char const *file_x, struct fstatus *fstatus, off_t current_pos)
                 {
                 case '\n':
                   lines++;
-                  /* Fall through. */
+                  FALLTHROUGH;
                 case '\r':
                 case '\f':
                   if (linepos > linelength)
@@ -438,7 +438,7 @@ wc (int fd, char const *file_x, struct fstatus *fstatus, off_t current_pos)
                   goto mb_word_separator;
                 case ' ':
                   linepos++;
-                  /* Fall through. */
+                  FALLTHROUGH;
                 case '\v':
                 mb_word_separator:
                   words += in_word;
@@ -500,7 +500,7 @@ wc (int fd, char const *file_x, struct fstatus *fstatus, off_t current_pos)
                 {
                 case '\n':
                   lines++;
-                  /* Fall through. */
+                  FALLTHROUGH;
                 case '\r':
                 case '\f':
                   if (linepos > linelength)
@@ -512,7 +512,7 @@ wc (int fd, char const *file_x, struct fstatus *fstatus, off_t current_pos)
                   goto word_separator;
                 case ' ':
                   linepos++;
-                  /* Fall through. */
+                  FALLTHROUGH;
                 case '\v':
                 word_separator:
                   words += in_word;
diff --git a/src/who.c b/src/who.c
index 497589d92..d4454f8e5 100644
--- a/src/who.c
+++ b/src/who.c
@@ -816,7 +816,7 @@ main (int argc, char **argv)
     {
     case 2:			/* who <blurf> <glop> */
       my_line_only = true;
-      /* Fall through.  */
+      FALLTHROUGH;
     case -1:
     case 0:			/* who */
       who (UTMP_FILE, READ_UTMP_CHECK_PIDS);
-- 
2.13.0



From MAILER-DAEMON Mon Jun 12 17:03:15 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dKWUV-00061D-GB
	for mharc-coreutils@gnu.org; Mon, 12 Jun 2017 17:03:15 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:43474)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bohmer@gmail.com>) id 1dKUdl-0005kt-TY
	for coreutils@gnu.org; Mon, 12 Jun 2017 15:04:42 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bohmer@gmail.com>) id 1dKUdl-0003Xj-13
	for coreutils@gnu.org; Mon, 12 Jun 2017 15:04:41 -0400
Received: from mail-yw0-x229.google.com ([2607:f8b0:4002:c05::229]:34213)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <bohmer@gmail.com>) id 1dKUdk-0003XY-Ri
	for coreutils@gnu.org; Mon, 12 Jun 2017 15:04:40 -0400
Received: by mail-yw0-x229.google.com with SMTP id e142so31883347ywa.1
	for <coreutils@gnu.org>; Mon, 12 Jun 2017 12:04:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:from:date:message-id:subject:to;
	bh=QDc1mSPUq94b0a9tqR5llREf/XdK+VHVHVYup6xwOcU=;
	b=u5iUHSIOcYbTRN7ujaUbzi9G3MQ0LdxFAgcYsXvQWMWOEGMOkPwq+rNN0zips2y26G
	kARPtSobNCGTFp9RGzZOGr509iyyxjKsVdGoXKyeHNJWiBlUpPNRMvoTu4envFkywl/z
	2cpg8eSew75aVNGIUVfCBDYKiDN1FrIa1D2hk0w/wlNBYj+l12DUezgrCwzxwls3oXM0
	RUt1zIiXJC0OVl2OBJRo4w6gsjBm6qpSNMVqKIlg/iVKXQLzQEAB/xkLNBTxpnkspFQh
	bLkilNrjWzQ5SJR1ejEaw3ZrfvfI7Uc9iGNsUQaz25n+WeJ6xYay5HPmuvrgfMBNCS0r
	RpKA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
	bh=QDc1mSPUq94b0a9tqR5llREf/XdK+VHVHVYup6xwOcU=;
	b=KkyV58x+hHhYNgOOPmoQeS0AqiiKaORmqlX9l2KukU80bHFYzuiJX2n3gwkzxuHyqs
	LfF50uQmzCX3sN60WzCQZY7JvpelUnrWiqKdnAT3XIqNGi8DitlIIDSLzMyvxwHGrHJo
	akWpad9GznWwhdVRFPTR9frjTeTnOH8PX19gyfldmmN78Lqdb3UlHLXzmuwsgDj89uxd
	rPyH7W4Iou0lT57v1OHCL46GTfPqjUY6+fiuVtCzKwNZQgT8nziWpX+JHcIZxcCjYvzz
	xjZR9YCLjT2IgWb0aEXP1KgDcYMw8YmRU6g1JMJlkOJtWF+AVSLBCSEUQD+h8/Hn/jMm
	VuMA==
X-Gm-Message-State: AKS2vOzJtoiXYqyJLiyMTJbP6n6CQXv1+CluBbSMLARUkJiQ1Jjj+X3M
	fR+vQA0rzRjF9sLNRq8AV1mYseX3r+2s
X-Received: by 10.13.234.131 with SMTP id t125mr343716ywe.113.1497294279868;
	Mon, 12 Jun 2017 12:04:39 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.37.45.77 with HTTP; Mon, 12 Jun 2017 12:04:39 -0700 (PDT)
From: =?UTF-8?Q?Knut_Olav_B=C3=B8hmer?= <bohmer@gmail.com>
Date: Mon, 12 Jun 2017 21:04:39 +0200
Message-ID: <CAF805t6Gioxx9trLtVa7RO9jdS=C_swsFPdgtUWuWVqj0T_=WQ@mail.gmail.com>
Subject: Bug#23750 disable sending latin-1 or utf-8 body
To: coreutils@gnu.org
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4002:c05::229
X-Mailman-Approved-At: Mon, 12 Jun 2017 17:03:15 -0400
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
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, 12 Jun 2017 19:04:42 -0000

In url-http.el there is a function url-http-create-request with the
following check:

    ;; Bug#23750
    (unless (=3D (string-bytes request)
               (length request))
      (error "Multibyte text in HTTP request: %s" request))
    (url-http-debug "Request is: \n%s" request)

It makes it impossible to send utf-8 or latin-1 strings in the body.
I need it for some requests by soap-client.
Would be nice If we could have an extra variable to allow latin-1 strings.
For example  url-http-allow-multibyte-body or
url-http-prevent-multibyte-request, or something like that.

then do

    (unless (and url-http-prevent-multibyte-request (=3D (string-bytes
request)
               (length request)))
      (error "Multibyte text in HTTP request: %s" request))

Or maybe the solution is something else. But it should be possible to send
latin-1 strings  with "=C3=A6=C3=B8=C3=A5" in it.

regards
--=20
Knut Olav B=C3=B8hmer

From MAILER-DAEMON Tue Jun 13 11:42:15 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dKnxP-0003Ji-7C
	for mharc-coreutils@gnu.org; Tue, 13 Jun 2017 11:42:15 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:51619)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <steeve.mccauley@gmail.com>) id 1dKm34-0006xI-Kq
	for coreutils@gnu.org; Tue, 13 Jun 2017 09:39:59 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <steeve.mccauley@gmail.com>) id 1dKm33-0003Q6-Mb
	for coreutils@gnu.org; Tue, 13 Jun 2017 09:39:58 -0400
Received: from mail-ua0-x22f.google.com ([2607:f8b0:400c:c08::22f]:35301)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <steeve.mccauley@gmail.com>)
	id 1dKm33-0003Pg-HF
	for coreutils@gnu.org; Tue, 13 Jun 2017 09:39:57 -0400
Received: by mail-ua0-x22f.google.com with SMTP id q15so75535404uaa.2
	for <coreutils@gnu.org>; Tue, 13 Jun 2017 06:39:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:from:date:message-id:subject:to;
	bh=SW5CWh0VfOJotfNFIl7WKjmE9sl5+ItRDVEW/UA3xcc=;
	b=KHb+EeI8cQb0boZmUF2cZ8NlQxOf95XpIJWQdLdh1+ns4Ls0lbqITzaZ966Dm6Ap5x
	9YgKqISQxBBxdq6sxy4W3cmHkGFu0FthLZmgHM1YhnqeAX4+vaK2WIYTWR4TqeW8qHwL
	qASPXfxYjhH6gQjYcu1Dr9o6pRKZP6NbX9fAfbUgtyWy3t3S3Ku/YBY8ags6S/14LIpF
	k0Wvq5wMdXWUqAeAczvRobsP6hT2HW05BdUeMkms86BM58xch+BCQK5BuSXe4BupYlJk
	4QFkwZ1zujrs9zotKaOOaDq1UUUUFickeldkoofqP2xoM0PRXdcQlIwo4I4pF/Q2Mede
	6FsA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
	bh=SW5CWh0VfOJotfNFIl7WKjmE9sl5+ItRDVEW/UA3xcc=;
	b=X8UYGApAis02qcoumfJJh78cN9oihc1e603LgdmfuUL0RndkykzSje80ytPGQGPf0n
	qMHFCVboed6Min0++KNP+1mx4LfBXvgi6iZBav5mNafda3xsPw2cNRsN+ThQtVD/J26S
	IfobFxvJgObH4LqkiDAgZMRZGA8wAyy95A1QTySTXlvXdKJeJs5fNdOFGRxKY+PtskFX
	4cY0k5InUpIpjjto5BBeHx2ICFBHNiD53fOPpU9I367/AvGUM0bJCz7/3P2nHat9pG4T
	MkX6It3r65+6NIS++f0IMy0bXeANIDRQV7+7FWnquxBxMKv14UGLSleWZ7CzCmQ1Rd0m
	pOCw==
X-Gm-Message-State: AKS2vOx9V1RUtP7v4FrZKdPRknEJBD9JGH4zuA+l+zcJoJ5eBIn7JPoq
	K/NalNpZvJbjd9DQ7Yy8y6TD4N60i8pnzTY=
X-Received: by 10.176.24.167 with SMTP id t39mr2720291uag.56.1497361195233;
	Tue, 13 Jun 2017 06:39:55 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.176.1.248 with HTTP; Tue, 13 Jun 2017 06:39:14 -0700 (PDT)
From: Steeve McCauley <steeve.mccauley@gmail.com>
Date: Tue, 13 Jun 2017 09:39:14 -0400
Message-ID: <CA+MRLqnB1kqbFumHHH6wcXSUXzRzm0fRWy4RDrOAYeg-YEFouA@mail.gmail.com>
Subject: Support for RFC 8089
To: coreutils@gnu.org
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:400c:c08::22f
X-Mailman-Approved-At: Tue, 13 Jun 2017 11:42:13 -0400
Content-Type: text/plain; charset="UTF-8"
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: Tue, 13 Jun 2017 13:39:59 -0000

I searched google and the bug and list archives for coreutils but couldn't
find any mention of support for local or non-local file URIs,

file:///foo/bar
file://remote.baz/foo/bar

has there ever been any discussion of support for file URIs in coreutils?

I often copy files into the clipboard (using fedora 25 with gnome shell
3.22.3) and then have to manually remove the file URI at the command line
to remove the file:/// part.

$ cp file:///data/photos/DCIM/Camera/IMG_20170613_074704.jpg butterfly.jpg
cp: cannot stat
'file://file:///data/photos/DCIM/Camera/IMG_20170613_074704.jpg': No such
file or directory
$

I can understand why non-local files might not be supported but thought
that this might not be a terribly difficult representation to support even
if it just strips off the URI (s/^file:/\/\/\/\//), at least on POSIX
systems.

the RFC is here,

https://tools.ietf.org/html/rfc8089

-- 
:wq

From MAILER-DAEMON Thu Jun 15 11:31:17 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dLWjt-0006La-N5
	for mharc-coreutils@gnu.org; Thu, 15 Jun 2017 11:31:17 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:59410)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dLWjq-0006Kr-Il
	for coreutils@gnu.org; Thu, 15 Jun 2017 11:31:15 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dLWjn-000283-Bv
	for coreutils@gnu.org; Thu, 15 Jun 2017 11:31:14 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:52694)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dLWjn-00027a-5L
	for coreutils@gnu.org; Thu, 15 Jun 2017 11:31:11 -0400
Received: from localhost.localdomain (mobile-166-177-249-211.mycingular.net
	[166.177.249.211])
	(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 77BA39D0E;
	Thu, 15 Jun 2017 16:31:07 +0100 (IST)
Subject: Re: Support for RFC 8089
To: Steeve McCauley <steeve.mccauley@gmail.com>, coreutils@gnu.org
References: <CA+MRLqnB1kqbFumHHH6wcXSUXzRzm0fRWy4RDrOAYeg-YEFouA@mail.gmail.com>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <abd6ef3f-8899-ba59-3cfc-fc99bec6c38f@draigBrady.com>
Date: Thu, 15 Jun 2017 08:31:03 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <CA+MRLqnB1kqbFumHHH6wcXSUXzRzm0fRWy4RDrOAYeg-YEFouA@mail.gmail.com>
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]
	[fuzzy]
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, 15 Jun 2017 15:31:15 -0000

On 13/06/17 06:39, Steeve McCauley wrote:
> I searched google and the bug and list archives for coreutils but could=
n't
> find any mention of support for local or non-local file URIs,
>=20
> file:///foo/bar
> file://remote.baz/foo/bar
>=20
> has there ever been any discussion of support for file URIs in coreutil=
s?
>=20
> I often copy files into the clipboard (using fedora 25 with gnome shell
> 3.22.3) and then have to manually remove the file URI at the command li=
ne
> to remove the file:/// part.

Note gnome shell has the "paste filenames" feature, when you've selected =
and
copied file(s) in the nautilus browser, though is a little awkward to acc=
ess.
You can use right click in gnome terminal to access the menu,
or (with the menu bar enabled) Alt+e f <return>.
There doesn't seem to be a way to assign a shortcut to this function.
I'd log a feature request to do that with the gnome folks,
as that would be a simple and relatively safe way to achieve what you wan=
t.

I'm not sure coreutils could support file:// directly
due to the clash with a network file server named 'file' or a directory n=
amed 'file:'

I see that xdg-open supports file:// urls though that's quite a specialis=
ed tool.

It's also worth noting the recent proposal to have ls output clickable li=
nks
which could use file:// resulting in gnome terminal opening the default
application when the file links were ctrl clicked.
https://lists.gnu.org/archive/html/coreutils/2017-05/msg00000.html

cheers,
P=C3=A1draig.



From MAILER-DAEMON Thu Jun 15 11:59:53 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dLXBZ-0001TS-IX
	for mharc-coreutils@gnu.org; Thu, 15 Jun 2017 11:59:53 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:38962)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <steeve.mccauley@gmail.com>) id 1dLXBX-0001SI-Or
	for coreutils@gnu.org; Thu, 15 Jun 2017 11:59:53 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <steeve.mccauley@gmail.com>) id 1dLXBW-0004KH-9a
	for coreutils@gnu.org; Thu, 15 Jun 2017 11:59:51 -0400
Received: from mail-vk0-x230.google.com ([2607:f8b0:400c:c05::230]:33233)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <steeve.mccauley@gmail.com>)
	id 1dLXBW-0004Ja-3w
	for coreutils@gnu.org; Thu, 15 Jun 2017 11:59:50 -0400
Received: by mail-vk0-x230.google.com with SMTP id p62so9327337vkp.0
	for <coreutils@gnu.org>; Thu, 15 Jun 2017 08:59:48 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc; bh=F+NBzYjQkwb7AY3IpWARuZMsnDOrYuejjZ3G8+TVcZA=;
	b=q9t4GKCXfvnIhPme4M9c0ThDt7pS7k4yBqQReLClwoEIfq2fo2MJHCMuMczQpMVKY8
	KDXOT/8R62D3aJtlt38xd3pqMuxl/AWOR8qOZZKdmPi5/WrR6wVUM3EJjrCFyPckidp0
	eooEm42VEYQHMuieyo+cmqcCRWT6MjMn5cTCPGH1ejb/e7SjgiWj+uQxYPu4n4vP2Ixg
	f+BMDNosGBm4sKzQ+9/kCS5gXn/k4QWChJNxA/uPb9NyxR+aDAX+Vmy9cSftzOnci77u
	hYkBMKBryOrwUFQXnO059KdUYnShNjopEfpIXF6gYldPoB5hTlWj59Ie9eegvFalG1d4
	Zwdg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:cc;
	bh=F+NBzYjQkwb7AY3IpWARuZMsnDOrYuejjZ3G8+TVcZA=;
	b=df8qxa0Y6PZLorIpnesQS98viXb9rTW/c48vHn/VDTT9k+O/DHZ6Ryj65GkNPxHT8L
	Fc4rWLqAljufNTfv+g/WmqUFMPyPJiuSIRWuaw/n6jXbHsTpOhXAo17Mj0boeKT56j26
	/LbZJs1gLa81R+ON1qv7oGYZjC2uvsefFLsXTr0X9Wz8CF8dW2AOd2/OQIFibbcxeSYg
	w7l4qQNFTmDFlTFksFPIhBYJHZNQzTIAG6T0d1dCFP4FH/DKXAcEVHcLv/bSorvP0/BT
	hFOF7pC4Czbu9tIHs/4/xMBu+DzJfXuzpinI5MImALwokhPmq+IkWDl2vlIUcAEMCdmg
	uVLw==
X-Gm-Message-State: AKS2vOyqbqozA9Oex/z0o1fOSLlx0AQ4auriKKMa24kF2GkQ+4Nzh4S6
	YMSjOR/vBQfnAFCkWBC90zgtmITyHMNFB5g=
X-Received: by 10.31.254.199 with SMTP id l190mr3463393vki.114.1497542387853; 
	Thu, 15 Jun 2017 08:59:47 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.176.23.214 with HTTP; Thu, 15 Jun 2017 08:59:07 -0700 (PDT)
In-Reply-To: <abd6ef3f-8899-ba59-3cfc-fc99bec6c38f@draigBrady.com>
References: <CA+MRLqnB1kqbFumHHH6wcXSUXzRzm0fRWy4RDrOAYeg-YEFouA@mail.gmail.com>
	<abd6ef3f-8899-ba59-3cfc-fc99bec6c38f@draigBrady.com>
From: Steeve McCauley <steeve.mccauley@gmail.com>
Date: Thu, 15 Jun 2017 11:59:07 -0400
Message-ID: <CA+MRLqn=WyMs4CpLTu+ZsGD+aew=zwjPT6j6vk2v6cx_Mbjn8w@mail.gmail.com>
Subject: Re: Support for RFC 8089
To: =?UTF-8?Q?P=C3=A1draig_Brady?= <P@draigbrady.com>
Cc: coreutils@gnu.org
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:400c:c05::230
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
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: Thu, 15 Jun 2017 15:59:53 -0000

I suspect the problem of a clash with a directory named file:// minimal
though, in POSIX at least.  Not sure about the network file server issue,
but with the double (treble) slash it also seems unlikely to be a problem.

Thanks for the info, I hadn't noticed the Paste Filenames context menu
item, but since I always paste with "Ctrl+Shift+V" ... I'll see what the
gnome types think about providing a short cut customization, seems an
oversight not to provide one.

slainte

Steeve


On Thu, Jun 15, 2017 at 11:31 AM, P=C3=A1draig Brady <P@draigbrady.com> wro=
te:

> On 13/06/17 06:39, Steeve McCauley wrote:
> > I searched google and the bug and list archives for coreutils but
> couldn't
> > find any mention of support for local or non-local file URIs,
> >
> > file:///foo/bar
> > file://remote.baz/foo/bar
> >
> > has there ever been any discussion of support for file URIs in coreutil=
s?
> >
> > I often copy files into the clipboard (using fedora 25 with gnome shell
> > 3.22.3) and then have to manually remove the file URI at the command li=
ne
> > to remove the file:/// part.
>
> Note gnome shell has the "paste filenames" feature, when you've selected
> and
> copied file(s) in the nautilus browser, though is a little awkward to
> access.
> You can use right click in gnome terminal to access the menu,
> or (with the menu bar enabled) Alt+e f <return>.
> There doesn't seem to be a way to assign a shortcut to this function.
> I'd log a feature request to do that with the gnome folks,
> as that would be a simple and relatively safe way to achieve what you wan=
t.
>
> I'm not sure coreutils could support file:// directly
> due to the clash with a network file server named 'file' or a directory
> named 'file:'
>
> I see that xdg-open supports file:// urls though that's quite a
> specialised tool.
>
> It's also worth noting the recent proposal to have ls output clickable
> links
> which could use file:// resulting in gnome terminal opening the default
> application when the file links were ctrl clicked.
> https://lists.gnu.org/archive/html/coreutils/2017-05/msg00000.html
>
> cheers,
> P=C3=A1draig.
>
>


--=20
:wq

From MAILER-DAEMON Fri Jun 16 09:14:31 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dLr54-0001pb-Te
	for mharc-coreutils@gnu.org; Fri, 16 Jun 2017 09:14:30 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:33356)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <slashmais@gmail.com>) id 1dLoDt-00059g-V5
	for coreutils@gnu.org; Fri, 16 Jun 2017 06:11:26 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <slashmais@gmail.com>) id 1dLoDs-0000Jp-Ft
	for coreutils@gnu.org; Fri, 16 Jun 2017 06:11:25 -0400
Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]:35945)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <slashmais@gmail.com>) id 1dLoDs-0000J7-9W
	for coreutils@gnu.org; Fri, 16 Jun 2017 06:11:24 -0400
Received: by mail-wm0-x233.google.com with SMTP id m125so21770379wmm.1
	for <coreutils@gnu.org>; Fri, 16 Jun 2017 03:11:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:from:date:message-id:subject:to
	:content-transfer-encoding;
	bh=BKejhGY1R55nfU/g+5lOLts/NGL+bGc/Ue3T5YCYlU8=;
	b=LhJxEZ7NSgajxRKgic0fh2sOsCe2ygWr4tcPP4Y0yeJbZEB3hNbB7UbaEpXlzH66B2
	X+O6gVtkJ7yQkDwxP/yg749gV9l9g9jFlCryikEV0z2N/EGrxIj8UQklBUXB7l8xlHfc
	m/s9VmYI7RHmGo4HV7ggJg4frYvZnj5ETJQJzL9Ef0Oxo7CS6N1wLx0q4ZawZb7795+0
	GZxjucCSEOyVqeqNjG+JPeTn4tZvRYpw56J0ktcZxtl2xZqD54YVz9n1ZV/Qqk9ClHsx
	GiojiI/bQnOnljiBK8hF+xilvbmO03zIwvFqP3WULPBxd7jUgGw6hdAqMARn8HMVCAxQ
	wXzQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:from:date:message-id:subject:to
	:content-transfer-encoding;
	bh=BKejhGY1R55nfU/g+5lOLts/NGL+bGc/Ue3T5YCYlU8=;
	b=AM61VpdmukTbp1gv+odFp7UKMoopduqB2wNTMvV1S2HdqirGEqNL/p+4aH89PWLCEt
	9WvqjsFt0xD+amdOWSh9S2cLWh/whHHaD6UAiicf1+HvAhETzJWWshK/euX4KjB/Kwse
	Am5MBiwXcA0wa0Uf6KyHzcm4ImVP3X9NrrjS7q8a6wOzC16G4MOzgosqVsVp1ymRchbT
	5X+PTlgU0mOze8C3flrdrtQfqPjxKbnEItu9MPZTRndBbtFR7aQ0aAhN+kr1oV7H76fV
	/LNq6YXlDb2CB+YL/cvNBSXnSY+7gdVIO+8WCf9iYKj/vsZsWygMYEA5wnfbNOBlkpld
	z1zg==
X-Gm-Message-State: AKS2vOyIIZ3alGnHqAl8BUjYZdHeFd77KIT/oaIVQvZtFDItkA4KS+8j
	RA9UZBjEJYchG0o3KPVggq3KI5SfQQ==
X-Received: by 10.28.113.85 with SMTP id m82mr6772726wmc.21.1497607881240;
	Fri, 16 Jun 2017 03:11:21 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.28.189.137 with HTTP; Fri, 16 Jun 2017 03:11:20 -0700 (PDT)
From: slash mais <slashmais@gmail.com>
Date: Fri, 16 Jun 2017 12:11:20 +0200
Message-ID: <CAKyOcTWw7VCGB6jiuU02Bg08eGwOZv48wBOu3AgcLH-vgiQwsA@mail.gmail.com>
Subject: cp and --backup error
To: coreutils@gnu.org
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2a00:1450:400c:c09::233
X-Mailman-Approved-At: Fri, 16 Jun 2017 09:14:30 -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: Fri, 16 Jun 2017 10:11:26 -0000

The command:
	cp -r -P --preserve=3Dall --strip-trailing-slashes --backup=3Dnumbered
"/source-dir/source-file" "/source-dir/"
returns:
	cp: =E2=80=98/source-dir/source-file=E2=80=99 and =E2=80=98/source-dir/sou=
rce-file=E2=80=99 are the same file

This result is wrong because '--backup' has been specified, and 'cp'
should do the backup and copy actions regardless in this case.


From MAILER-DAEMON Fri Jun 16 09:53:33 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dLrgr-000667-0t
	for mharc-coreutils@gnu.org; Fri, 16 Jun 2017 09:53:33 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:59786)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dLrgo-00064Q-PZ
	for coreutils@gnu.org; Fri, 16 Jun 2017 09:53:31 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dLrgo-0004X6-3H
	for coreutils@gnu.org; Fri, 16 Jun 2017 09:53:30 -0400
Received: from mail-vk0-x22c.google.com ([2607:f8b0:400c:c05::22c]:33380)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <meyering@gmail.com>) id 1dLrgn-0004Vo-Ui
	for coreutils@gnu.org; Fri, 16 Jun 2017 09:53:30 -0400
Received: by mail-vk0-x22c.google.com with SMTP id p62so22655317vkp.0
	for <coreutils@gnu.org>; Fri, 16 Jun 2017 06:53:28 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:sender:in-reply-to:references:from:date:message-id
	:subject:to:cc:content-transfer-encoding;
	bh=Szy6wddnDeBJuCXJGiIBbHHFv1f2bxcaIr5hBsDHQJ8=;
	b=WSvcO5QfYW0zuIERw/QCbxJapp69RA96JlICLPXk+d7ItfEWNxsRWMh/pIkWWMYEue
	hVDGVD3kpsPvfPDH6PXK0/JbRz/6ggXdbfNTrt793Y2s80zEsUnygK1kmUK2z47jkZQH
	DfH5qFx9WZRGjHXCxaXZjI7nwOP+hrNyxhj57r+KU+g9p4mumDv0aHcdbxbtnAbmWF4d
	pdgHSeK9oIVf8VXyz1G9wqWy6VvtZwXrxEKA9gRUR8KiFFY2s7OsV1zCeGJp9z7k+bvn
	7TwlfBVa4Q+XV7RXRJ0Ssl8dQZnqqTdP5m3MTA4JkoNbJkxnqd9QEjpS4M2e8ADUMMWe
	EB6Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
	:date:message-id:subject:to:cc:content-transfer-encoding;
	bh=Szy6wddnDeBJuCXJGiIBbHHFv1f2bxcaIr5hBsDHQJ8=;
	b=oYBtTCDRtqjBW9FYRsIamAocXRIFYvhUmn2feqIA2X4c/+XOoMEUab9ulifLH0WpsF
	Y+hg/zPl+RCXCcA02BbhzXqr8Ldwup8Go1cZsMkUq4/XmDWUV1z76k2VXm8uDowiV1sB
	C4oX7Max9+RBn4DkYuvaOjBb/4r1SayCUGqRSA4maF47ltfzb3dO+Hj9BFr/xWFP68Xh
	SyqzhvGZkLgRAtgb9UgP/5wS4y8IBdTI/nPWw7ODgt3/sfUVeQIWWMO6beoXzQ+nHgd/
	7Cs9QP2yNPiInQdTCQjJ2zDz4vvtMNyYAQrlh3H+IoC5JI5/qgEV+6vLV03KVIW8QaEp
	s0MQ==
X-Gm-Message-State: AKS2vOxGw9Un/GCfmOu+t2KSrLAsASyzB2RB/6WhpVo+u6zBqpEyXwl4
	eZZyDtL1Gs9PokXL9StcvNREq7nWGg==
X-Received: by 10.31.163.72 with SMTP id m69mr5364850vke.14.1497621207632;
	Fri, 16 Jun 2017 06:53:27 -0700 (PDT)
MIME-Version: 1.0
Sender: meyering@gmail.com
Received: by 10.176.70.83 with HTTP; Fri, 16 Jun 2017 06:53:07 -0700 (PDT)
In-Reply-To: <CAKyOcTWw7VCGB6jiuU02Bg08eGwOZv48wBOu3AgcLH-vgiQwsA@mail.gmail.com>
References: <CAKyOcTWw7VCGB6jiuU02Bg08eGwOZv48wBOu3AgcLH-vgiQwsA@mail.gmail.com>
From: Jim Meyering <jim@meyering.net>
Date: Fri, 16 Jun 2017 06:53:07 -0700
X-Google-Sender-Auth: Z6ByxBqp0O0-mqtLBea7okM7W9M
Message-ID: <CA+8g5KF7tNA-XNwPAfwnPM11=Y95BD4LLWjy1u1fkUaLxSpyrw@mail.gmail.com>
Subject: Re: cp and --backup error
To: slash mais <slashmais@gmail.com>
Cc: Coreutils <coreutils@gnu.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:400c:c05::22c
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, 16 Jun 2017 13:53:31 -0000

On Fri, Jun 16, 2017 at 3:11 AM, slash mais <slashmais@gmail.com> wrote:
> The command:
>         cp -r -P --preserve=3Dall --strip-trailing-slashes --backup=3Dnum=
bered
> "/source-dir/source-file" "/source-dir/"
> returns:
>         cp: =E2=80=98/source-dir/source-file=E2=80=99 and =E2=80=98/sourc=
e-dir/source-file=E2=80=99 are the same file
>
> This result is wrong because '--backup' has been specified, and 'cp'
> should do the backup and copy actions regardless in this case.

If you really want to do that, you must also specify the -f (--force) optio=
n.


From MAILER-DAEMON Sun Jun 18 10:08:00 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dMarw-0006t6-DA
	for mharc-coreutils@gnu.org; Sun, 18 Jun 2017 10:08:00 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:33560)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <nfitzkee@gmail.com>) id 1dMSwi-0002j1-Gg
	for coreutils@gnu.org; Sun, 18 Jun 2017 01:40:25 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <nfitzkee@gmail.com>) id 1dMSwf-0003Ry-FM
	for coreutils@gnu.org; Sun, 18 Jun 2017 01:40:24 -0400
Received: from mail-yb0-x234.google.com ([2607:f8b0:4002:c09::234]:35717)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <nfitzkee@gmail.com>) id 1dMSwf-0003Ri-Av
	for coreutils@gnu.org; Sun, 18 Jun 2017 01:40:21 -0400
Received: by mail-yb0-x234.google.com with SMTP id f192so21036411yba.2
	for <coreutils@gnu.org>; Sat, 17 Jun 2017 22:40:21 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=from:to:subject:date:message-id:mime-version
	:content-transfer-encoding:thread-index:content-language;
	bh=ryI49k0XSeaUFdloJGN6hFxsOxYPwgMwhD1/sj+prjs=;
	b=OZ6Yo7n9OLhWIuCNoes0Og+xieulJ3psFeaUsvQzVUiIWpKFO9qrG5Z64ZYcLFDgcf
	Dg65daqybYU1QneIpFO0rTSMV/0jgjhSvzbX2b53LEqoj89G8RfVyStLxAYXD8/9FEVw
	oW8yfdRV0jn75N07trMSmwvKWLZuG/fbtGWlw0wDpTkbif++uW/vxZq75pqgLwl/FbOX
	TghvIjPlpuu6vYkq152UdNJYpayUjv3ZOC0/rQH2Tj2LK7UsyYujdxNeNNYhpypLKKjJ
	4eoL9f/5XL9Fis5MP48eIgEtsTqk9HPTOX2L8dKh7lDUBEGTcoHfQt7UaZBjYnpYtgFq
	36gg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:from:to:subject:date:message-id:mime-version
	:content-transfer-encoding:thread-index:content-language;
	bh=ryI49k0XSeaUFdloJGN6hFxsOxYPwgMwhD1/sj+prjs=;
	b=Lxje1X5tvw9xsuw4eCq4hGjReBz/HzJcysAjDZPt3zy3xAMi5b+f7zw05HXMWzUpni
	F39zlAb4B9CBx/ilAdFN20z6eT/+ElUu1pmS0gXiU5y9rj5D4lL3m0Iacsg1MYVCifAl
	XIMzSBtydllt7DxafwVr8qG84SOK1kOSqfifYrsB90NhV6jA34WF0jWNrrRqNEx1MBUl
	/SGYO5vhmr5adYZc9mTHhNcMaJ2uzH9tDKwMCfY2HRNhtSsCUHcIEmoztSjIcR0oNhsM
	krW/jNr7yymqjq82fcOkVVBw9+g8R2rVb5qrJPbGEIK4fdGn0zNBDiSi50xg83W2eFMF
	zNCw==
X-Gm-Message-State: AKS2vOzYbCSiIovINWpM6kQqSVtfrYKNZ104SvLJSye3fwb6ZUdhq55H
	hOkbf7z7tQP3AuA0yMo=
X-Received: by 10.37.59.133 with SMTP id i127mr14523009yba.235.1497764420354; 
	Sat, 17 Jun 2017 22:40:20 -0700 (PDT)
Received: from legolas (107-141-16-11.lightspeed.jcsnms.sbcglobal.net.
	[107.141.16.11]) by smtp.gmail.com with ESMTPSA id
	d12sm2870154ywa.44.2017.06.17.22.40.19 for <coreutils@gnu.org>
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Sat, 17 Jun 2017 22:40:19 -0700 (PDT)
From: "Nicholas Fitzkee" <nfitzkee@gmail.com>
To: <coreutils@gnu.org>
Subject: Question about stdbuf on OpenWRT
Date: Sun, 18 Jun 2017 00:40:19 -0500
Message-ID: <000001d2e7f5$5f75b8c0$1e612a40$@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Outlook 15.0
Thread-Index: AdLn6wdP9TY5bL5rTdOMY4jQ57kG1g==
Content-Language: en-us
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4002:c09::234
X-Mailman-Approved-At: Sun, 18 Jun 2017 10:07:59 -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: Sun, 18 Jun 2017 05:40:25 -0000

Hi all,

I'm trying to use stdbuf on OpenWRT and I'm having some problems getting the
correct behavior.  As I'm learning, cross-compiling is not easy, so I'm not
sure if this is a bug or if I'm simply doing something wrong.  Probably the
latter.

My application is rather convoluted, but I found a very nice test case on
the openwrt website (https://github.com/openwrt/packages/issues/1674) .
Running the following command buffers icmp entries when passed into awk:

tcpdump -eni eth0 -v icmp | awk '{print $1}'

If I ping an external website, the output of tcpdump is buffered so that awk
prints several lines at a time. The following command should fix this:

stdbuf -oL tcpdump -eni eth0 -v icmp | awk '{print $1}'

On my router, I get the following error message:

root@DD-WRT:/opt/bin# stdbuf -oL tcpdump -eni eth0 icmp
Error relocating /opt/bin/libstdbuf.so: __fprintf_chk: symbol not found

Libstdbuf.so is installed, and the program will work for trivial cases:

root@DD-WRT:/opt/bin# stdbuf --version
stdbuf (GNU coreutils) 8.27
Copyright (C) 2017 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Padraig Brady.
root@DD-WRT:/opt/bin# stdbuf -oL date
Sat Jun 17 23:45:49 CDT 2017

I'm not sure where to start with this, and any advice would be appreciated.
The router/OS information is below, and the system is using libc 2.25.

Linux DD-WRT 4.9.30 #14 SMP Sat May 27 01:12:16 CEST 2017 armv7l GNU/Linux

Thanks,
Nick



From MAILER-DAEMON Sun Jun 18 10:08:02 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dMary-0006uX-Hi
	for mharc-coreutils@gnu.org; Sun, 18 Jun 2017 10:08:02 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:33139)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <boruch_baum@gmx.com>) id 1dMXnV-0005MA-OO
	for coreutils@gnu.org; Sun, 18 Jun 2017 06:51:14 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <boruch_baum@gmx.com>) id 1dMXnR-0006av-Rk
	for coreutils@gnu.org; Sun, 18 Jun 2017 06:51:13 -0400
Received: from mout.gmx.net ([212.227.17.22]:51118)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <boruch_baum@gmx.com>) id 1dMXnR-0006aW-H3
	for coreutils@gnu.org; Sun, 18 Jun 2017 06:51:09 -0400
Received: from E15-2016.optimum.net ([108.6.168.221]) by mail.gmx.com
	(mrgmx101 [212.227.17.174]) with ESMTPSA (Nemesis) id
	0LlqNY-1dvsc53bbE-00ZKzb for <coreutils@gnu.org>;
	Sun, 18 Jun 2017 12:51:06 +0200
Date: Sun, 18 Jun 2017 06:51:01 -0400
From: Boruch Baum <boruch_baum@gmx.com>
To: coreutils@gnu.org
Subject: FEATURE REQUEST: Re: 'ls' human-readable sizes
Message-ID: <20170618105101.GO7465@E15-2016.optimum.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Provags-ID: V03:K0:qeGM8nvUr8DzZMmJ3OucrpPGEfyVYidEQRUft1R63yoAKoM+vZn
	KvI9UoYSgIFyyH5FdIk+dFT7IGDzptiMYuQw4lf0rY4DIV1JzXf4xkQMEAWNa/fiuChAj4a
	kMP7buyEEsyhmOYaFHKlVSVKxpACyybxrCDweJOOQDzyUFd19Em83r7Jt3q/KgNqultKlpm
	Qd5d9wLLZ7kN++9XwUgYQ==
X-UI-Out-Filterresults: notjunk:1;V01:K0:LIxZFyEqvro=:5mmY4uFd6XS3zdOfkjjFM3
	cndkFaSlHkwuKd9yH8H7kB4TGGiGJMH5hkac+19mM3o1WHu/YnxPxb9tJKNsI+9LAGADJY4n/
	Qqk1dTelzQi0Uk4tqF9Q++rnwPBe6ZIcSEQvgrkbpDSzvfatQaZ2ko2ekm6bQ/F79Gu9yNgci
	NdjIKt5F20jC1tcHVXlGIABZXZNtaQLZ1wa2qf4Ar/7XRp4AwXIVYq3lfFXEUDvhjzNXMDp8x
	EK3yt+muDJf96VcSFaMeUtR3EY2EZU8Dc8+qUwA0LNhqlIW6vq8fpNrQX3c6HlQXc7aZdZ4i7
	b0wBnI9tj3mf0fOO50oAsJEQJ/QJ9Z5PbhWkTxL9Pb8tjD4Pojyu9XZBjcnTRAPTsTKYW7DA0
	bpBUhusuqBbsvpysaGIspcHGE8IdqrEHDefQDNdoetud392+Hce2G+7NM1xJHwAk96wmlSd0l
	t6JD2CRyYkxTLXp5tIjxBvp9/mrJfjY7BE47wtm2Fh2kXfj/+hiRIlln/gMvGrJUjMcgb7cqQ
	E+MWtVAj3iqgJyj3dZlBQMcirc/msVv1Ktsi3WisavUMrCCZnl/41ufJB3dYjq+NZUFySSxk2
	lgFYgCDbYqy55l14s3qY/135ZvDPijf1DY0H2ua9nNzmQDjisweNyG19sfGQcNRS9ZK7O0F16
	B//xVfWwLa3lhy0SG6rBaRJLR1sXQQKe3/AF5MwjuCHE3e0TkwJ1a1mA3QHKg/ocU7164L9rG
	CAbHCSscCzZiCPzobYxAegRWCieTqMi/DBIsT/wJN/U9f2rARuUZi7dANxg=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 212.227.17.22
X-Mailman-Approved-At: Sun, 18 Jun 2017 10:07:59 -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: Sun, 18 Jun 2017 10:51:14 -0000

When I visually scan 'ls -lh' output, I find it difficult to notice
every instance of the convenience presentation of 'k' and 'm'. Could
you consider making them more visible, either through colorization of the letter,
bold face of the letter, indentation, or marking?

By indentation, I mean comething like:

   111
     4M
    11

By marking, I mean something like:

   111
    4M<-
    11


--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0


From MAILER-DAEMON Sun Jun 18 15:08:24 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dMfYe-0008Mm-25
	for mharc-coreutils@gnu.org; Sun, 18 Jun 2017 15:08:24 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:60823)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dMfYb-0008Md-6V
	for coreutils@gnu.org; Sun, 18 Jun 2017 15:08:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dMfYY-0005Pz-1o
	for coreutils@gnu.org; Sun, 18 Jun 2017 15:08:21 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:44558)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dMfYX-0005Pe-Rf
	for coreutils@gnu.org; Sun, 18 Jun 2017 15:08:17 -0400
Received: from localhost.localdomain (mobile-166-170-38-143.mycingular.net
	[166.170.38.143])
	(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 07A3A94C9;
	Sun, 18 Jun 2017 20:08:13 +0100 (IST)
Subject: Re: Question about stdbuf on OpenWRT
To: Nicholas Fitzkee <nfitzkee@gmail.com>, coreutils@gnu.org
References: <000001d2e7f5$5f75b8c0$1e612a40$@gmail.com>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <8448f341-0c89-f44b-9031-f9fbc1087204@draigBrady.com>
Date: Sun, 18 Jun 2017 12:08:10 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <000001d2e7f5$5f75b8c0$1e612a40$@gmail.com>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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, 18 Jun 2017 19:08:22 -0000

On 17/06/17 22:40, Nicholas Fitzkee wrote:
> Hi all,
>=20
> I'm trying to use stdbuf on OpenWRT and I'm having some problems gettin=
g the
> correct behavior.  As I'm learning, cross-compiling is not easy, so I'm=
 not
> sure if this is a bug or if I'm simply doing something wrong.  Probably=
 the
> latter.
>=20
> My application is rather convoluted, but I found a very nice test case =
on
> the openwrt website (https://github.com/openwrt/packages/issues/1674) .
> Running the following command buffers icmp entries when passed into awk=
:
>=20
> tcpdump -eni eth0 -v icmp | awk '{print $1}'
>=20
> If I ping an external website, the output of tcpdump is buffered so tha=
t awk
> prints several lines at a time.

Note stdbuf only controls stdio buffering.
I think tcpdump has other internal buffering for efficiency
so to disable that you probably have to pass the --immediate-mode
option to tcpdump?

> The following command should fix this:
>=20
> stdbuf -oL tcpdump -eni eth0 -v icmp | awk '{print $1}'
>=20
> On my router, I get the following error message:
>=20
> root@DD-WRT:/opt/bin# stdbuf -oL tcpdump -eni eth0 icmp
> Error relocating /opt/bin/libstdbuf.so: __fprintf_chk: symbol not found

Blerg. Yes this looks like a cross compile issue.
Specifically it looks like you're cross compiling with the FORTIFY_SOURCE
in your CFLAGS, while support for that is not present in your libc.
Note we set CFLAGS for libstdbuf.so to: -fPIC $(AM_CFLAGS)
This is correct I think according to:
https://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ord=
ering.html

So I'd look at getting these into the CFLAGS somehow when compiling the s=
hared lib:

 -fno-stack-protector -D_FORTIFY_SOURCE=3D0

> root@DD-WRT:/opt/bin# stdbuf -oL date
> Sat Jun 17 23:45:49 CDT 2017

It's surprising that worked.

cheers,
P=E1draig


From MAILER-DAEMON Sun Jun 18 15:09:48 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dMfa0-00005m-4B
	for mharc-coreutils@gnu.org; Sun, 18 Jun 2017 15:09:48 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:32849)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dMfZy-00005f-9O
	for coreutils@gnu.org; Sun, 18 Jun 2017 15:09:47 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dMfZv-0005nm-5M
	for coreutils@gnu.org; Sun, 18 Jun 2017 15:09:46 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:44562)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dMfZu-0005nQ-Um
	for coreutils@gnu.org; Sun, 18 Jun 2017 15:09:43 -0400
Received: from localhost.localdomain (mobile-166-170-38-143.mycingular.net
	[166.170.38.143])
	(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 062B794CC;
	Sun, 18 Jun 2017 20:09:40 +0100 (IST)
Subject: Re: FEATURE REQUEST: Re: 'ls' human-readable sizes
To: Boruch Baum <boruch_baum@gmx.com>, coreutils@gnu.org
References: <20170618105101.GO7465@E15-2016.optimum.net>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <44c3a6b1-9033-f764-f8b2-f9d45c381fcc@draigBrady.com>
Date: Sun, 18 Jun 2017 12:09:38 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <20170618105101.GO7465@E15-2016.optimum.net>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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, 18 Jun 2017 19:09:47 -0000

On 18/06/17 03:51, Boruch Baum wrote:
> When I visually scan 'ls -lh' output, I find it difficult to notice
> every instance of the convenience presentation of 'k' and 'm'. Could
> you consider making them more visible, either through colorization of t=
he letter,
> bold face of the letter, indentation, or marking?
>=20
> By indentation, I mean comething like:
>=20
>    111
>      4M
>     11
>=20
> By marking, I mean something like:
>=20
>    111
>     4M<-
>     11

This wouldn't be core functionality so if we were to do that
it would be better in numfmt I think. For example you can get ls -lh
functionality now with numfmt like:

  \ls -l | numfmt --header --field=3D5 --to=3Dsi

Looking at my numfmt TODO here I see this pertinent item:

  Have numfmt --format=3D'%f ' put a space between number and auto units

cheers,
P=E1draig



From MAILER-DAEMON Sun Jun 18 16:55:44 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dMhEW-0002kg-DP
	for mharc-coreutils@gnu.org; Sun, 18 Jun 2017 16:55:44 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:50647)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dMhET-0002kX-Gw
	for coreutils@gnu.org; Sun, 18 Jun 2017 16:55:42 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dMhEP-0004u1-Dt
	for coreutils@gnu.org; Sun, 18 Jun 2017 16:55:41 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:44900)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dMhEP-0004sl-5H
	for coreutils@gnu.org; Sun, 18 Jun 2017 16:55:37 -0400
Received: from localhost.localdomain (mobile-166-170-38-143.mycingular.net
	[166.170.38.143])
	(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 D65DE9508;
	Sun, 18 Jun 2017 21:55:33 +0100 (IST)
Subject: Re: coreutils-8.27 released [stable]
To: Michael Felt <michael@felt.demon.nl>, Michael Felt <aixtools@gmail.com>,
	Coreutils <coreutils@gnu.org>
References: <8e8eaed6-2358-e2fe-272d-689101d2b30f@draigBrady.com>
	<CANvxniXzbZoQBDUpmhuT7zsK9d18DnZKCCYRiNDtQabv-E6tWQ@mail.gmail.com>
	<973883a1-e589-13fc-9e26-bd2b6e883e6d@draigBrady.com>
	<e683bdef-4976-615f-4318-636aa9051a0e@felt.demon.nl>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <7dee834b-b26a-02d8-c07b-0871c8a98dad@draigBrady.com>
Date: Sun, 18 Jun 2017 13:55:30 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <e683bdef-4976-615f-4318-636aa9051a0e@felt.demon.nl>
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]
	[fuzzy]
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, 18 Jun 2017 20:55:42 -0000

On 18/06/17 13:20, Michael Felt wrote:
> On 27/05/2017 12:39, P=C3=A1draig Brady wrote:
>> On 25/05/17 02:58, Michael Felt wrote:
>>> file config.h contains an incorrect file suffix
>> The reason for that error is because your compiler is not
>> recognizing the -include option and thus interpreting the
>> file as a file to compile.
>>
>> Now I added the -include option when compiling b2sum
>> in v8.26 as I thought it was standard
>> (and I checked solaris cc, gcc, clang, icc).
>> I see that xlc may support this option if invoked as gxlc ?
>> Also you could change the -include in src/local.mk to -qinclude
> With -qinclude=3Dconfig.h it seems to be getting further. Now it stops =
with
>=20
> + make > .buildaix/make.out
> "../src/coreutils-8.27/lib/euidaccess.c", line 84.19: 1506-280 (W)=20
> Function argument assignment between types "char*" and "const char*" is=
=20
> not allowed.
> ld: 0711-317 ERROR: Undefined symbol: .renameat
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more=20
> information.
> make: 1254-004 The error code from the last command is 8.
>=20
> Stop.
> make: 1254-004 The error code from the last command is 1.
>=20
> Stop.
> make: 1254-004 The error code from the last command is 2.
>=20
> Stop.
> make returned an error
>=20
> Will look another time into missing "renameat"

See http://bugs.gnu.org/26044

cheers,
P=C3=A1draig



From MAILER-DAEMON Sun Jun 18 18:08:03 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dMiMV-0003yk-Ee
	for mharc-coreutils@gnu.org; Sun, 18 Jun 2017 18:08:03 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:36322)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <coreutils@tlinx.org>) id 1dMiMT-0003yT-Hz
	for coreutils@gnu.org; Sun, 18 Jun 2017 18:08:02 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <coreutils@tlinx.org>) id 1dMiMO-0004my-GN
	for coreutils@gnu.org; Sun, 18 Jun 2017 18:08:01 -0400
Received: from ishtar.tlinx.org ([173.164.175.65]:59944
	helo=Ishtar.sc.tlinx.org)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <coreutils@tlinx.org>) id 1dMiMO-0004l4-5y
	for coreutils@gnu.org; Sun, 18 Jun 2017 18:07:56 -0400
Received: from [192.168.3.12] (Athenae [192.168.3.12])
	by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id
	v5IM7fWs059618; Sun, 18 Jun 2017 15:07:43 -0700
Message-ID: <5946F9AD.8010406@tlinx.org>
Date: Sun, 18 Jun 2017 15:07:41 -0700
From: L A Walsh <coreutils@tlinx.org>
User-Agent: Thunderbird
MIME-Version: 1.0
To: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@draigBrady.com>
CC: Boruch Baum <boruch_baum@gmx.com>, coreutils@gnu.org
Subject: Re: FEATURE REQUEST: Re: 'ls' human-readable sizes
References: <20170618105101.GO7465@E15-2016.optimum.net>
	<44c3a6b1-9033-f764-f8b2-f9d45c381fcc@draigBrady.com>
In-Reply-To: <44c3a6b1-9033-f764-f8b2-f9d45c381fcc@draigBrady.com>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by Ishtar.sc.tlinx.org id
	v5IM7fWs059618
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
	timestamps) [generic] [fuzzy]
X-Received-From: 173.164.175.65
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, 18 Jun 2017 22:08:02 -0000

P=C3=A1draig Brady wrote:
> On 18/06/17 03:51, Boruch Baum wrote:
>  =20
>> When I visually scan 'ls -lh' output, I find it difficult to notice
>> every instance of the convenience presentation of 'k' and 'm'. Could
>> you consider making them more visible, either through colorization of =
the letter,
>> bold face of the letter, indentation, or marking?
>>    =20
>
> This wouldn't be core functionality
---
    Whereas putting quotes around filenames is core functionality?

    Maybe an ENV option, like LS_OPTIONS could be provided
to allow specifying interactive options like the filename
quoting that wouldn't be active when scripts are run?




From MAILER-DAEMON Sun Jun 18 18:18:21 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dMiWT-0006cg-Pp
	for mharc-coreutils@gnu.org; Sun, 18 Jun 2017 18:18:21 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:38096)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <dualbus@gmail.com>) id 1dMiWS-0006ca-3T
	for coreutils@gnu.org; Sun, 18 Jun 2017 18:18:20 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <dualbus@gmail.com>) id 1dMiWO-0000ym-2W
	for coreutils@gnu.org; Sun, 18 Jun 2017 18:18:20 -0400
Received: from mail-oi0-x242.google.com ([2607:f8b0:4003:c06::242]:34094)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <dualbus@gmail.com>) id 1dMiWN-0000yZ-Sk
	for coreutils@gnu.org; Sun, 18 Jun 2017 18:18:16 -0400
Received: by mail-oi0-x242.google.com with SMTP id w127so7616102oiw.1
	for <coreutils@gnu.org>; Sun, 18 Jun 2017 15:18:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=date:from:to:cc:subject:message-id:references:mime-version
	:content-disposition:in-reply-to:user-agent;
	bh=UpkNfAvcc0MLpBsm3UHWs8glL82fdpSgO+1ma73uD3U=;
	b=T7u9tcDu4yR4hwUUHNd7yRn9YZJm8fHDTgB1eRIETlVN0zjCOpQxc593Nb9YdbI95r
	8SY/2N5OuBvNjVKeRcR+AcKOCS8sDPJDcwNudZF86ah5mDEUFJ09S6wDPegeZUmrzdTF
	TFWgPqoFlWKYdK54nCmy+X1O9dzLGdkyC/mqLToECjAkO4kJN0xE5+rq1zt6RezM5kKo
	JCTExexrkXWtKByESxrQPvvXBKp7oQO7JzaxI/CAmDufxorKAVWaI1clzIPojIqmkPHL
	8aWbY7Whw6tPZEbvRdo7GCKVjnPyHi3TzMrX4rFugltKgqfri8g5Q1y9/Gh1Vbq8ta2h
	+mbA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:date:from:to:cc:subject:message-id:references
	:mime-version:content-disposition:in-reply-to:user-agent;
	bh=UpkNfAvcc0MLpBsm3UHWs8glL82fdpSgO+1ma73uD3U=;
	b=sUjT+rbTem8Fe/DLiM1CGie32ozWrXXejWjIo6tolzLPVBpc4l8Lnvq0V641YN0xwT
	xfDGJwFqBTAHrRRch9hwHrVh6uV880sFu3afUZ2A1FKGawicUHfzL8F4Wt9ihwxCaxRg
	IzS9FbSaJSub0teC4+11FKagV4pJNRYyP78eId79QVgASMT4dDLaoVPuq6Rj+ZR3GOIf
	u+Ca8hao+5EUq1CtcAbg5dCVrJ+QOuMktTAG4p+/Fg1QD589s90x8578hOpQ/FGiln7E
	vI8vSfaNxj8/EUTDb8pHhCAjYRVCARbidzpZBAKFFX0X/A5fqmmR6BdF975jTAAQRuqn
	JJeg==
X-Gm-Message-State: AKS2vOxFmb408o121+Tc5GE5cN1M0rz6ElSO5mAgccKkmGlo9aOigIHC
	hBcurNdru2WYEA==
X-Received: by 10.202.252.197 with SMTP id a188mr11313272oii.162.1497824295059;
	Sun, 18 Jun 2017 15:18:15 -0700 (PDT)
Received: from localhost ([201.157.173.180]) by smtp.gmail.com with ESMTPSA id
	o184sm4105236oif.23.2017.06.18.15.18.14
	(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
	Sun, 18 Jun 2017 15:18:14 -0700 (PDT)
Date: Sun, 18 Jun 2017 17:18:08 -0500
From: Eduardo =?utf-8?Q?A=2E_Bustamante_L=C3=B3pez?= <dualbus@gmail.com>
To: L A Walsh <coreutils@tlinx.org>
Cc: =?utf-8?Q?P=C3=A1draig?= Brady <P@draigBrady.com>,
	Boruch Baum <boruch_baum@gmx.com>, coreutils@gnu.org
Subject: Re: FEATURE REQUEST: Re: 'ls' human-readable sizes
Message-ID: <20170618221808.m2em3tsydhqpahjn@debian>
References: <20170618105101.GO7465@E15-2016.optimum.net>
	<44c3a6b1-9033-f764-f8b2-f9d45c381fcc@draigBrady.com>
	<5946F9AD.8010406@tlinx.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <5946F9AD.8010406@tlinx.org>
User-Agent: NeoMutt/20170113 (1.7.2)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4003:c06::242
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, 18 Jun 2017 22:18:21 -0000

On Sun, Jun 18, 2017 at 03:07:41PM -0700, L A Walsh wrote:
[..]
>    Maybe an ENV option, like LS_OPTIONS could be provided
> to allow specifying interactive options like the filename
> quoting that wouldn't be active when scripts are run?

ls isn't meant to be used in scripts. Use find or shell globbing.

-- 
Eduardo Bustamante
https://dualbus.me/


From MAILER-DAEMON Sun Jun 18 18:39:24 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dMiqq-0002bk-HG
	for mharc-coreutils@gnu.org; Sun, 18 Jun 2017 18:39:24 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:41838)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <coreutils@tlinx.org>) id 1dMiqo-0002ai-SU
	for coreutils@gnu.org; Sun, 18 Jun 2017 18:39:23 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <coreutils@tlinx.org>) id 1dMiql-0002lx-Ll
	for coreutils@gnu.org; Sun, 18 Jun 2017 18:39:22 -0400
Received: from ishtar.tlinx.org ([173.164.175.65]:32904
	helo=Ishtar.sc.tlinx.org)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <coreutils@tlinx.org>) id 1dMiql-0002l0-B6
	for coreutils@gnu.org; Sun, 18 Jun 2017 18:39:19 -0400
Received: from [192.168.3.12] (Athenae [192.168.3.12])
	by Ishtar.sc.tlinx.org (8.14.7/8.14.4/SuSE Linux 0.8) with ESMTP id
	v5IMd76g061832; Sun, 18 Jun 2017 15:39:09 -0700
Message-ID: <5947010B.9000303@tlinx.org>
Date: Sun, 18 Jun 2017 15:39:07 -0700
From: L A Walsh <coreutils@tlinx.org>
User-Agent: Thunderbird
MIME-Version: 1.0
To: =?UTF-8?B?IkVkdWFyZG8gQS4gQnVzdGFtYW50ZSBMw7NwZXoi?=
 <dualbus@gmail.com>
CC: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@draigBrady.com>,
	Boruch Baum <boruch_baum@gmx.com>, coreutils@gnu.org
Subject: Re: FEATURE REQUEST: Re: 'ls' human-readable sizes
References: <20170618105101.GO7465@E15-2016.optimum.net>
	<44c3a6b1-9033-f764-f8b2-f9d45c381fcc@draigBrady.com>
	<5946F9AD.8010406@tlinx.org>
	<20170618221808.m2em3tsydhqpahjn@debian>
In-Reply-To: <20170618221808.m2em3tsydhqpahjn@debian>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by Ishtar.sc.tlinx.org id
	v5IMd76g061832
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no
	timestamps) [generic] [fuzzy]
X-Received-From: 173.164.175.65
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, 18 Jun 2017 22:39:23 -0000



Eduardo A. Bustamante L=C3=B3pez wrote:
> On Sun, Jun 18, 2017 at 03:07:41PM -0700, L A Walsh wrote:
> [..]
>>    Maybe an ENV option, like LS_OPTIONS could be provided
>> to allow specifying interactive options like the filename
>> quoting that wouldn't be active when scripts are run?
>=20
> ls isn't meant to be used in scripts. Use find or shell globbing.
---
	Fine -- then have LS_OPTIONS apply all the time.  ;-)




From MAILER-DAEMON Sun Jun 18 21:30:02 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dMlVx-00005u-Vz
	for mharc-coreutils@gnu.org; Sun, 18 Jun 2017 21:30:02 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:59675)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <nfitzkee@gmail.com>) id 1dMlVv-00005d-S8
	for coreutils@gnu.org; Sun, 18 Jun 2017 21:30:00 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <nfitzkee@gmail.com>) id 1dMlVs-0007Mc-P8
	for coreutils@gnu.org; Sun, 18 Jun 2017 21:29:59 -0400
Received: from mail-yw0-x232.google.com ([2607:f8b0:4002:c05::232]:35695)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <nfitzkee@gmail.com>) id 1dMlVs-0007MD-Jo
	for coreutils@gnu.org; Sun, 18 Jun 2017 21:29:56 -0400
Received: by mail-yw0-x232.google.com with SMTP id v7so35351220ywc.2
	for <coreutils@gnu.org>; Sun, 18 Jun 2017 18:29:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=from:to:references:in-reply-to:subject:date:message-id:mime-version
	:content-transfer-encoding:thread-index:content-language;
	bh=yPLzH/NejcoG4/0tGNWCH5gA9F25+KzuEa+JF25+c2g=;
	b=OT9DYaFoknBRwYipAlyHFclifnhhRoL/WZgMhLb4EMdPIwZfwDzXfStZyTCzp27gEP
	LGgnXX8sp4fS5t8I5A/uJB45xEdKPMTK3xg85aPAUNT3/X8b5QZiiR3NlLKoo+ufWZB3
	uxWOOhLvZQASDrQnRxPVdR0Dk0vZQKaUaYGdmo2PRcYH23XY3Qs34JYd5KwGotB4Njmq
	Rnvz4fbVb01fgmNhbp5PNY+RbTcvH8If6TaKngswfTwYm/JgQRkxGopf0aK0VfutFjfE
	XkOBmJ1tSpoGT6UcqwCOsNvTTXvJf2vN5+X6j0rfx5q7sHY4L9xfdCDcdwXWZjEJhiYK
	CcUQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:from:to:references:in-reply-to:subject:date
	:message-id:mime-version:content-transfer-encoding:thread-index
	:content-language;
	bh=yPLzH/NejcoG4/0tGNWCH5gA9F25+KzuEa+JF25+c2g=;
	b=DYJcsPxQskc+zBi4MuJk6O50WyHN2/DsMsAOvI2/1PeR7tBh9+qBnn5RPNjC+WerF3
	lZ7AbKSvDx3zhTnyFAumUU6KptQbIBDP+UCcr3LuHvWwiw6ujotYXddmGOHYv8pJaMxV
	uyqOjlWBY5w+6sktNJtPZPn9/ykWtnXJNCihTk4MCWqm4370x9TXCXKDW153GudqEMbd
	u7+/W2ft7yvWMG0lpPDdnHsrw1yr8GKZR+2ME6pqp8gb6kgOJ4y2o9e+8ZgBgTHn+7hh
	Dt3lTYBQzWCX5EXTLnZjyHwlVbJooP9Qtn5yo5SYnY1hcGHqFXhQ0lgGDkSLSqkOlHzm
	synQ==
X-Gm-Message-State: AKS2vOyYSQ7jtjIEBikz/9d+ZD1efiYQzhymDXrKBJa6HSUaZ7T/V17N
	97gKPPZIWnSpURiXqIY1TQ==
X-Received: by 10.129.146.67 with SMTP id j64mr16298274ywg.41.1497835795704;
	Sun, 18 Jun 2017 18:29:55 -0700 (PDT)
Received: from legolas (107-141-16-11.lightspeed.jcsnms.sbcglobal.net.
	[107.141.16.11]) by smtp.gmail.com with ESMTPSA id
	z142sm4052514ywz.50.2017.06.18.18.29.54
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Sun, 18 Jun 2017 18:29:55 -0700 (PDT)
From: "Nicholas Fitzkee" <nfitzkee@gmail.com>
To: =?iso-8859-1?Q?'P=E1draig_Brady'?= <P@draigBrady.com>, <coreutils@gnu.org>
References: <000001d2e7f5$5f75b8c0$1e612a40$@gmail.com>
	<8448f341-0c89-f44b-9031-f9fbc1087204@draigBrady.com>
In-Reply-To: <8448f341-0c89-f44b-9031-f9fbc1087204@draigBrady.com>
Subject: RE: Question about stdbuf on OpenWRT
Date: Sun, 18 Jun 2017 20:29:55 -0500
Message-ID: <000001d2e89b$8f0414f0$ad0c3ed0$@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Outlook 15.0
Thread-Index: AQHq3f696qKONp9BZNv2Y82NUG2SDQEanYX2ofKk2bA=
Content-Language: en-us
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4002:c05::232
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, 19 Jun 2017 01:30:00 -0000

> So I'd look at getting these into the CFLAGS somehow when compiling the
shared lib:
>
> -fno-stack-protector -D_FORTIFY_SOURCE=0

Perfect! That did the trick, and everything works fine now. I'll pass along
your solution to the OpenWRT developers. Thanks for the help.

Regards,
Nick



From MAILER-DAEMON Sun Jun 18 22:02:59 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dMm1r-00068r-8N
	for mharc-coreutils@gnu.org; Sun, 18 Jun 2017 22:02:59 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:34476)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <boruch_baum@gmx.com>) id 1dMm1p-000688-CB
	for coreutils@gnu.org; Sun, 18 Jun 2017 22:02:58 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <boruch_baum@gmx.com>) id 1dMm1k-0005lY-Hi
	for coreutils@gnu.org; Sun, 18 Jun 2017 22:02:57 -0400
Received: from mout.gmx.net ([212.227.15.19]:53132)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <boruch_baum@gmx.com>) id 1dMm1k-0005lF-6q
	for coreutils@gnu.org; Sun, 18 Jun 2017 22:02:52 -0400
Received: from E15-2016.optimum.net ([108.6.168.221]) by mail.gmx.com
	(mrgmx001 [212.227.17.184]) with ESMTPSA (Nemesis) id
	0M2L2a-1ddTxj3cU0-00s5Fq; Mon, 19 Jun 2017 04:02:48 +0200
Date: Sun, 18 Jun 2017 22:02:42 -0400
From: Boruch Baum <boruch_baum@gmx.com>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>, coreutils@gnu.org
Subject: Re: FEATURE REQUEST: Re: 'ls' human-readable sizes
Message-ID: <20170619020242.GP7465@E15-2016.optimum.net>
References: <20170618105101.GO7465@E15-2016.optimum.net>
	<45e739ae-2f6a-ef56-8551-ea0f44b6daf7@draigBrady.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <45e739ae-2f6a-ef56-8551-ea0f44b6daf7@draigBrady.com>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Provags-ID: V03:K0:1IxZQVQ/BWkFosVIBkgQQzwciKMzi4ICZyKVqJAzI3fVThw35lb
	bu+XPliwEl9fdfGJJI0sUznz8qO63HVBtxUna6bY3sRwnwrRy5SocvzVwYkLSetk+SRuePq
	hcF5Tk9kHI3ObBUlo3UI915uBtW3XAb6L/QR8xda9VqGcc6pysMe7LT8lQo8gXlCaNQLbxB
	7+TuJTrsFLo+WndrDd+Hw==
X-UI-Out-Filterresults: notjunk:1;V01:K0:uqf9ZvnBWDU=:BLIYxKoIJ5kWwyZrGqeN+/
	Q9qsHw5UtxDiQRrjA84sdCli0QKztBe4Kv8m2Ei/Uw0HEjZ62DWK9ltnGyHAS59pVCv7/OUVj
	9vhz7FqI9Az/52PIiJy+mMjBWlfwt9y6iz9NKO+TwAiWp9ZoI2Ydc+jn0235mcuHyv6vQy+A4
	eoknNcwNJJoIkUp3BX/PpffMB8+stQ517d03qzgx7v36dlay5He5CoD7mD7+SU/Q0ZDcP3G2G
	CxdfuxjWGmyGHnGjprmwUu79fdzXLysPEIbwQ+6MYMWJAR/DeIIlMdaOLlS47TCMCKPTZftcx
	lMJIR9AG0rRTxL4TC17ef8UXjpaBFUZepAIBHOXEJ6dDlIGG2TKwtXIrcc0DQeHDX1xkFkIdT
	o1J1tBd2nAqmAEF74jpc31ApyKTNl7mVtVmr158FUjlF0GNCILKr2HgaQY6xPXtR83h5kKkh+
	OrqXrvjuSPSemjISWuJ6KIEXMuzltbT3Ckn7teKdzKdqdPsC+apsudV0fDdVMvH4dQsx9fx87
	3HERVCZEA9M0xOkpRjl3Z3zxuVs6SoLhE0diiXTb0SvwegBdxh1C2gCNBBuSeX/CY6x5VsDXF
	Lf4iEsdpVMoQLOVOzelc0EOLypgvD3jSkgBT4Xq0EhucYwCYMuiNz5kxGhk+NUKM3ml75xwcp
	16bNoMJpbRW5zEeCHfT2NWc6NKHScT+MTtWKjmuRbsXhqfr9hBC+OHQXt37Gq7OK6e5q+gzUj
	UbiTfrEtVrum9IIaDSAG8t1E0MekjaQX+rMtsJ2XJnlwdqBO3hLYBHhHcOQ=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 212.227.15.19
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, 19 Jun 2017 02:02:58 -0000

On 2017-06-18 11:32, Pádraig Brady wrote:
> On 18/06/17 03:51, Boruch Baum wrote:
> > When I visually scan 'ls -lh' output, I find it difficult to notice
> > every instance of the convenience presentation of 'k' and 'm'. Could
> > you consider making them more visible, either through colorization of the letter,
> > bold face of the letter, indentation, or marking?
> >
> > By indentation, I mean comething like:
> >
> >    111
> >      4M
> >     11
> >
> > By marking, I mean something like:
> >
> >    111
> >     4M<-
> >     11
>
> This wouldn't be core functionality so if we were to do that
> it would be better in numfmt I think. For example you can get ls -lh
> functionality now with numfmt like:
>
>   \ls -l | numfmt --header --field=5 --to=si
>
> Looking at my numfmt TODO here I see this pertinent item:
>
>   Have numfmt --format='%f ' put a space between number and auto units

Thanks for the quick reply.

1] For the `numfmt' functionality, let me suggest that your TODO item
alter the implementation.

1.1] Using spaces for purposes other than for delimiting in `numfmt'
is bound to mess up scripts. How about using an underscore instead of
a space?

1.2] My guess is that people would want / expect "post number" text,
including whitespace, to appear exactly as they write it. For example
they might actually want a space in their format string exactly where
you want to use it for your option (eg. `--format='%f €' ). Even if you
reject the idea in par. 1.1, maybe use. `--format='%_f' to indicate
placement of the space (or my preference, the underscore).

2] By way of persisting about an enhancement to `ls' functionality:

2.1] The current `h' doesn't note the units of small-sized files as
`bytes', so let it do so, but instead of marking those numbers with a
`B', use a space (a kind of "silent" `b', like in "lamb"). The result
would align all numbers in the column, and it would be easier to note
the `K', `M', etc. markers. This suggestion produces the same result
as indentation, but is just a tweak to the already existing `h' for
small values.

2.2] Does LS_COLORS operate only on the final field? Is there a
possible user hack to have LS_COLORS operate on the size field?

Kind regards,

--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0


From MAILER-DAEMON Mon Jun 19 01:15:08 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dMp1o-0006yH-LD
	for mharc-coreutils@gnu.org; Mon, 19 Jun 2017 01:15:08 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:34755)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dMp1l-0006wE-L8
	for coreutils@gnu.org; Mon, 19 Jun 2017 01:15:06 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dMp1h-0005fx-LB
	for coreutils@gnu.org; Mon, 19 Jun 2017 01:15:05 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:48972)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dMp1h-0005ei-Dx
	for coreutils@gnu.org; Mon, 19 Jun 2017 01:15:01 -0400
Received: from localhost.localdomain (unknown [73.93.155.81])
	(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 772E49872;
	Mon, 19 Jun 2017 06:14:56 +0100 (IST)
Subject: Re: FEATURE REQUEST: Re: 'ls' human-readable sizes
To: Boruch Baum <boruch_baum@gmx.com>, coreutils@gnu.org
References: <20170618105101.GO7465@E15-2016.optimum.net>
	<45e739ae-2f6a-ef56-8551-ea0f44b6daf7@draigBrady.com>
	<20170619020242.GP7465@E15-2016.optimum.net>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <ab7259cc-1e30-0ccc-227e-8fb9f101f44b@draigBrady.com>
Date: Sun, 18 Jun 2017 22:14:53 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <20170619020242.GP7465@E15-2016.optimum.net>
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]
	[fuzzy]
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, 19 Jun 2017 05:15:07 -0000

On 18/06/17 19:02, Boruch Baum wrote:
> On 2017-06-18 11:32, P=C3=A1draig Brady wrote:
>> On 18/06/17 03:51, Boruch Baum wrote:
>>> When I visually scan 'ls -lh' output, I find it difficult to notice
>>> every instance of the convenience presentation of 'k' and 'm'. Could
>>> you consider making them more visible, either through colorization of=
 the letter,
>>> bold face of the letter, indentation, or marking?
>>>
>>> By indentation, I mean comething like:
>>>
>>>    111
>>>      4M
>>>     11
>>>
>>> By marking, I mean something like:
>>>
>>>    111
>>>     4M<-
>>>     11
>>
>> This wouldn't be core functionality so if we were to do that
>> it would be better in numfmt I think. For example you can get ls -lh
>> functionality now with numfmt like:
>>
>>   \ls -l | numfmt --header --field=3D5 --to=3Dsi
>>
>> Looking at my numfmt TODO here I see this pertinent item:
>>
>>   Have numfmt --format=3D'%f ' put a space between number and auto uni=
ts
>=20
> Thanks for the quick reply.
>=20
> 1] For the `numfmt' functionality, let me suggest that your TODO item
> alter the implementation.
>=20
> 1.1] Using spaces for purposes other than for delimiting in `numfmt'
> is bound to mess up scripts. How about using an underscore instead of
> a space?
>=20
> 1.2] My guess is that people would want / expect "post number" text,
> including whitespace, to appear exactly as they write it. For example
> they might actually want a space in their format string exactly where
> you want to use it for your option (eg. `--format=3D'%f =E2=82=AC' ). E=
ven if you
> reject the idea in par. 1.1, maybe use. `--format=3D'%_f' to indicate
> placement of the space (or my preference, the underscore).

Right 1.2 is getting to my core idea for numfmt,
i.e. that it would center around the --format argument much like you desc=
ribe here.

> 2] By way of persisting about an enhancement to `ls' functionality:
>=20
> 2.1] The current `h' doesn't note the units of small-sized files as
> `bytes', so let it do so, but instead of marking those numbers with a
> `B', use a space (a kind of "silent" `b', like in "lamb").

You mean, a kind of "silent" `b', like in "subtle" :)

> The result
> would align all numbers in the column, and it would be easier to note
> the `K', `M', etc. markers. This suggestion produces the same result
> as indentation, but is just a tweak to the already existing `h' for
> small values.

This isn't a bad suggestion.
A 1 minute patch not considering edge cases to do that is:

diff --git a/src/ls.c b/src/ls.c
index 4802d92..746d3ed 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -4071,12 +4071,18 @@ print_long_format (const struct fileinfo *f)
          : human_readable (unsigned_file_size (f->stat.st_size),
                            hbuf, file_human_output_opts, 1,
                            file_output_block_size));
-      int pad;
-      for (pad =3D file_size_width - mbswidth (size, 0); 0 < pad; pad--)
+      int curr_size_width =3D mbswidth (size, 0);
+      int pad =3D file_size_width - curr_size_width;
+      size_t size_len =3D strlen (size);
+      if (pad && ISDIGIT (size[size_len - 1]))
+        pad--;
+      for (; 0 < pad; pad--)
         *p++ =3D ' ';
       while ((*p++ =3D *size++))
         continue;
       p[-1] =3D ' ';
+      if (ISDIGIT (size[-2]))
+        *p++ =3D ' ';
     }

Which results in this output:

drwxrwxr-x. 26 padraig padraig 4.0K Jun 17 19:50 tests
-r--r--r--.  1 padraig padraig  48K Mar  8 21:02 THANKS
-rwxrwxr-x.  1 padraig padraig 441  May 28  2012 thanks-gen
-rw-rw-r--.  1 padraig padraig  38K Mar 11 10:44 THANKS.in
-rw-rw-r--.  1 padraig padraig 2.0K Mar  9 23:07 THANKS-to-translators
-rw-rw-r--.  1 padraig padraig 121  Aug 23  2011 THANKStt.in
-rw-rw-r--.  1 padraig padraig 6.7K Jan  1 14:34 TODO

Not to everyone's taste I suppose being not right aligned.

> 2.2] Does LS_COLORS operate only on the final field? Is there a
> possible user hack to have LS_COLORS operate on the size field?

Not at present. You might be able to do some post processing highlighting
like my http://www.pixelbeat.org/scripts/l script does.

cheers,
P=C3=A1draig.


From MAILER-DAEMON Mon Jun 19 02:04:12 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dMpnI-0008Bw-JV
	for mharc-coreutils@gnu.org; Mon, 19 Jun 2017 02:04:12 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:42592)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <boruch_baum@gmx.com>) id 1dMpnG-0008Bi-78
	for coreutils@gnu.org; Mon, 19 Jun 2017 02:04:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <boruch_baum@gmx.com>) id 1dMpnD-0007cZ-2x
	for coreutils@gnu.org; Mon, 19 Jun 2017 02:04:10 -0400
Received: from mout.gmx.net ([212.227.17.22]:54591)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <boruch_baum@gmx.com>) id 1dMpnC-0007c4-Oc
	for coreutils@gnu.org; Mon, 19 Jun 2017 02:04:07 -0400
Received: from E15-2016.optimum.net ([108.6.168.221]) by mail.gmx.com
	(mrgmx101 [212.227.17.174]) with ESMTPSA (Nemesis) id
	0MB2G8-1dUVJ0450m-009vuw; Mon, 19 Jun 2017 08:04:03 +0200
Date: Mon, 19 Jun 2017 02:04:00 -0400
From: Boruch Baum <boruch_baum@gmx.com>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>, coreutils@gnu.org
Subject: Re: FEATURE REQUEST: Re: 'ls' human-readable sizes
Message-ID: <20170619060359.GR7465@E15-2016.optimum.net>
References: <20170618105101.GO7465@E15-2016.optimum.net>
	<45e739ae-2f6a-ef56-8551-ea0f44b6daf7@draigBrady.com>
	<20170619020242.GP7465@E15-2016.optimum.net>
	<ab7259cc-1e30-0ccc-227e-8fb9f101f44b@draigBrady.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <ab7259cc-1e30-0ccc-227e-8fb9f101f44b@draigBrady.com>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-Provags-ID: V03:K0:p+bLeCTOnf6xsiWmvwSSz+tttiSJnqVK12XZHpOpgAwhgZ/BZtH
	ppB/pcdcjf9psyfKj5dujh3N2QjXur1wUhtvdluI+ZC79nTQELZYRhV745evFtCAUs+lYm/
	PnmpoNoJF7S2Uj0oaIcQQ71c/6KyCAFc6touMWBmoRCKdb52w7gE+qD6OxnMYkp0+z6VzPQ
	mVOPAqLfPtExtuNV1oIqQ==
X-UI-Out-Filterresults: notjunk:1;V01:K0:QStEFJVYfIU=:k3X90JwnUa2Pp0mDvnRxI1
	ZPcEdR7RUOVo4gRnI6bRsXP33IT558gL0eKIyYKlzqF7HTqt80c9Rnfwzv32M6K2e4riQN6Rm
	tSemC5eioRGs54+70Zt0TBe/1Oi/JMvg4nWqhruJV5E4NJcDgNhY2qW47Q3tOUb2THkS/iHmK
	8rHKDomyNTtm6zEp3rRQPiL6gQu1Bk5VfDxEoSFu0pFVJv2KAY9JU4obuQzjdZMuPF5GOZT5R
	tSvsufmm8/X2f0ld9tKgSrL/DxmKFxknfFUacDRQYwYivgWEu/YW5+sS0+MkpBYHp3pAUlQdZ
	BMhJ4tV6znljG1bMdYFAMVyzLfymTzCEzFjoWuNPW6urBV3JiJYX6FZp3rl6/UYAK25+XlPRm
	6vCGhj9KDapGjUbphPHrwN2+ESiU/BXOaSmAbgZqppy+8u0AfJZ0H6/wpy2lVXbtKauN2w79S
	If1hmuYjgPeO+ggtU56d/OfSot9SV4TnNsut+qQ1WuqAoJpp9/ntDG57BoiwSCe/SHlJnGMO0
	I6SydfOz4aM4Eefx9VJcbkUzN23cYP7kI9Lh61b654AZg1KJc1kNUFq7kwvB1z0Ko+OtntpFJ
	t5sPqA+qxYRVlAyUdUY2OzLKKl7aA17kqnQVC5TYnYYS+qlGzB5BeRGQ/RirDipCiPYWHi0yg
	2zFGyFifgimfzL/IJprhdgAJRUZqxnl6vpBQm66M+kpO6angEPqCCupHEHa7F8KToZ+7Y8AjF
	kritEffzd7hWPYK5TInQWwsT9iI41UuhaYlDUWinLZnvP+hEwr3536tjg6A=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 212.227.17.22
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, 19 Jun 2017 06:04:11 -0000

On 2017-06-18 22:14, Pádraig Brady wrote:
> On 18/06/17 19:02, Boruch Baum wrote:
> > On 2017-06-18 11:32, Pádraig Brady wrote:
> >> On 18/06/17 03:51, Boruch Baum wrote:

[snip]
> > want to use it for your option (eg. `--format='%f €' ). Even if you
Hmm, this was supposed to be a 'euro currency sign'.  ^^

[snip]

> > 2.1] The current `h' doesn't note the units of small-sized files as
> > `bytes', so let it do so, but instead of marking those numbers with a
> > `B', use a space (a kind of "silent" `b', like in "lamb").
>
> You mean, a kind of "silent" `b', like in "subtle" :)
>
> > The result
> > would align all numbers in the column, and it would be easier to note
> > the `K', `M', etc. markers. This suggestion produces the same result
> > as indentation, but is just a tweak to the already existing `h' for
> > small values.
>
> This isn't a bad suggestion.
> A 1 minute patch not considering edge cases to do that is:

[snip]

> Which results in this output:
>
> drwxrwxr-x. 26 padraig padraig 4.0K Jun 17 19:50 tests
> -r--r--r--.  1 padraig padraig  48K Mar  8 21:02 THANKS
> -rwxrwxr-x.  1 padraig padraig 441  May 28  2012 thanks-gen
> -rw-rw-r--.  1 padraig padraig  38K Mar 11 10:44 THANKS.in
> -rw-rw-r--.  1 padraig padraig 2.0K Mar  9 23:07 THANKS-to-translators
> -rw-rw-r--.  1 padraig padraig 121  Aug 23  2011 THANKStt.in
> -rw-rw-r--.  1 padraig padraig 6.7K Jan  1 14:34 TODO
>
> Not to everyone's taste I suppose being not right aligned.

I'll vote thumbs up, since it's optional, but it occurs to me to ask,
without knowing the `ls' internals: does this mess up or complicate
sorting by size?

> > 2.2] Does LS_COLORS operate only on the final field? Is there a
> > possible user hack to have LS_COLORS operate on the size field?
>
> Not at present. You might be able to do some post processing highlighting
> like my http://www.pixelbeat.org/scripts/l script does.

I'll check it out, thanks.

--
hkp://keys.gnupg.net
CA45 09B5 5351 7C11 A9D1  7286 0036 9E45 1595 8BC0


From MAILER-DAEMON Mon Jun 19 04:59:59 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dMsXP-0001mK-O0
	for mharc-coreutils@gnu.org; Mon, 19 Jun 2017 04:59:59 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:42443)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dMsXO-0001lR-0O
	for coreutils@gnu.org; Mon, 19 Jun 2017 04:59:59 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dMsXK-0004NS-SH
	for coreutils@gnu.org; Mon, 19 Jun 2017 04:59:58 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:49750)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dMsXK-0004MH-Li
	for coreutils@gnu.org; Mon, 19 Jun 2017 04:59:54 -0400
Received: from localhost.localdomain (mobile-166-137-177-093.mycingular.net
	[166.137.177.93])
	(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 B2BD198C2;
	Mon, 19 Jun 2017 09:59:51 +0100 (IST)
Subject: Re: FEATURE REQUEST: Re: 'ls' human-readable sizes
To: Boruch Baum <boruch_baum@gmx.com>, coreutils@gnu.org
References: <20170618105101.GO7465@E15-2016.optimum.net>
	<45e739ae-2f6a-ef56-8551-ea0f44b6daf7@draigBrady.com>
	<20170619020242.GP7465@E15-2016.optimum.net>
	<ab7259cc-1e30-0ccc-227e-8fb9f101f44b@draigBrady.com>
	<20170619060359.GR7465@E15-2016.optimum.net>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <b2d87136-1079-cc86-596d-d509faf63d54@draigBrady.com>
Date: Mon, 19 Jun 2017 01:59:48 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <20170619060359.GR7465@E15-2016.optimum.net>
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]
	[fuzzy]
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, 19 Jun 2017 08:59:59 -0000

On 18/06/17 23:04, Boruch Baum wrote:
> On 2017-06-18 22:14, P=C3=A1draig Brady wrote:
>> On 18/06/17 19:02, Boruch Baum wrote:
>>> On 2017-06-18 11:32, P=C3=A1draig Brady wrote:
>>>> On 18/06/17 03:51, Boruch Baum wrote:
>=20
> [snip]
>>> want to use it for your option (eg. `--format=3D'%f =E2=82=AC' ). Eve=
n if you
> Hmm, this was supposed to be a 'euro currency sign'.  ^^
>=20
> [snip]
>=20
>>> 2.1] The current `h' doesn't note the units of small-sized files as
>>> `bytes', so let it do so, but instead of marking those numbers with a
>>> `B', use a space (a kind of "silent" `b', like in "lamb").
>>
>> You mean, a kind of "silent" `b', like in "subtle" :)
>>
>>> The result
>>> would align all numbers in the column, and it would be easier to note
>>> the `K', `M', etc. markers. This suggestion produces the same result
>>> as indentation, but is just a tweak to the already existing `h' for
>>> small values.
>>
>> This isn't a bad suggestion.
>> A 1 minute patch not considering edge cases to do that is:
>=20
> [snip]
>=20
>> Which results in this output:
>>
>> drwxrwxr-x. 26 padraig padraig 4.0K Jun 17 19:50 tests
>> -r--r--r--.  1 padraig padraig  48K Mar  8 21:02 THANKS
>> -rwxrwxr-x.  1 padraig padraig 441  May 28  2012 thanks-gen
>> -rw-rw-r--.  1 padraig padraig  38K Mar 11 10:44 THANKS.in
>> -rw-rw-r--.  1 padraig padraig 2.0K Mar  9 23:07 THANKS-to-translators
>> -rw-rw-r--.  1 padraig padraig 121  Aug 23  2011 THANKStt.in
>> -rw-rw-r--.  1 padraig padraig 6.7K Jan  1 14:34 TODO
>>
>> Not to everyone's taste I suppose being not right aligned.
>=20
> I'll vote thumbs up, since it's optional

True, but -h would be a very commonly used option.
I'd be 60:40 against this change.

> but it occurs to me to ask,
> without knowing the `ls' internals: does this mess up or complicate
> sorting by size?

No, that's not impacted as done numerically before output.

>>> 2.2] Does LS_COLORS operate only on the final field? Is there a
>>> possible user hack to have LS_COLORS operate on the size field?
>>
>> Not at present. You might be able to do some post processing highlight=
ing
>> like my http://www.pixelbeat.org/scripts/l script does.
>=20
> I'll check it out, thanks.

An example implementation is at
https://gist.github.com/anonymous/327fa19405883157ae660236cbc9ad5e

cheers,
P=C3=A1draig



From MAILER-DAEMON Tue Jun 20 16:49:27 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dNQ5X-0007cN-Ez
	for mharc-coreutils@gnu.org; Tue, 20 Jun 2017 16:49:27 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:54472)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dNQ5S-0007b3-RT
	for coreutils@gnu.org; Tue, 20 Jun 2017 16:49:25 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dNQ5R-0002vx-PR
	for coreutils@gnu.org; Tue, 20 Jun 2017 16:49:22 -0400
Received: from mail-pg0-x22e.google.com ([2607:f8b0:400e:c05::22e]:35242)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <meyering@gmail.com>) id 1dNQ5R-0002vI-K7
	for coreutils@gnu.org; Tue, 20 Jun 2017 16:49:21 -0400
Received: by mail-pg0-x22e.google.com with SMTP id 132so34026995pgb.2
	for <coreutils@gnu.org>; Tue, 20 Jun 2017 13:49:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=sender:from:to:subject:date:message-id:mime-version;
	bh=fOLSvaxb68qf/kVaeDWbgZ+FjKthuwuIQYv/vcJsS8w=;
	b=EEaVu3wDk/bL7ql6gf91sGBfzlyr6o+IXvKtlKWYT1BDy/qfTv5r6BLLucVjEUYVDB
	Y8r6joq+bmQ7oz/3fXyDjfoYeTrG+eajJ8hywWcHQAlgNg0TKce7Si/dgtlQxUrKP61R
	JOreKZPX/rEmmFDn8zEZ0pjSyGRe9W/u0StcGoybEq9ySCufwtWPsU0vnbb0Aqrh6CN6
	XqrBpw3T4vu47y80e24koaOJ6Z87PfykKdt69Ji/GVS/EtEpQhLLWnDdHFEtGsHD85EN
	d+vhw2MRV/O2JXe8rqpggpqk5/jqFugSQgr79kL3yqHGImDAE4yty/Nuu2F4Wz9K9K5D
	G6xg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:sender:from:to:subject:date:message-id
	:mime-version;
	bh=fOLSvaxb68qf/kVaeDWbgZ+FjKthuwuIQYv/vcJsS8w=;
	b=Sh28f9fh1gQf1WsBdgsufvdgmFrJhz3whlXByr+rJnOx1OHDqs7+E1+UhTKH4ddXpX
	8V0+/Tbg2LWEnJCHOXQMxMqqoRaqopuWDn6SUVb75O6NxWEqbFC3aDqnaOMwHloS0VIF
	fCK1qdVMYaj4hYSuUGRugMbuTz8oMEs8vFW8b0JSLDxOUhxgeSHZiainyBNUEuZEMcW0
	pXy9GGKjBjwIOnEveSrPITJYdprA2gh1unBeNb+seoEf2CzYR8tKVxsku+0pk76/u0nu
	rg/xJboH18P2GRtdJy6ni3guQZqmqO6zQ4cjljbkwlTbVkoaXJCTbscTbUtY4mNpwvwN
	4C9Q==
X-Gm-Message-State: AKS2vOwptcBqOj7g4EwAssvwtV7UPgQJuwocCwmAdmTqxIqpEorwE5EB
	nqYRy08efZPhpxhL
X-Received: by 10.84.131.2 with SMTP id 2mr37854750pld.61.1497991758835;
	Tue, 20 Jun 2017 13:49:18 -0700 (PDT)
Received: from dhcp-172-24-231-87.dhcp.thefacebook.com
	([2620:10d:c090:200::5:c361]) by smtp.gmail.com with ESMTPSA id
	b82sm26824447pfd.111.2017.06.20.13.49.17 for <coreutils@gnu.org>
	(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);
	Tue, 20 Jun 2017 13:49:17 -0700 (PDT)
Sender: Jim Meyering <meyering@gmail.com>
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH] maint: avoid spurious "make distcheck" failure
Date: Tue, 20 Jun 2017 13:49:11 -0700
Message-ID: <lubpf3efuel708.fsf@meyering.net>
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:400e:c05::22e
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, 20 Jun 2017 20:49:26 -0000

I've been annoyed by this subtle bug more than a few times over the
years, so have finally diagnosed it.  Here's one way to fix it:

>From a05ba352d39a6e6a0c58d57f4b7acbb1e4f11f8b Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@fb.com>
Date: Tue, 20 Jun 2017 07:53:17 -0700
Subject: [PATCH] maint: avoid spurious "make distcheck" failure

When the generated file, doc/constants.texi, happens to be older than
doc/coreutils.info, it will not be updated until/unless its generated
contents change.  This is due to way that rule is careful to update
the file, to avoid provoking a pointless rerunning of makeinfo.

Note that this does not happen when one first runs "make distclean",
as recommended in README-release.  However, I sometimes run it as
a more-rigorous "make check", and shouldn't have to manually run
"make distclean" first, in that case.

Before this change, one could reproduce the failure by running
`touch -dyesterday doc/constants.texi && make distcheck`.  It would
fail with "makeinfo: could not open ../../doc/coreutils.info-t
for writing: Permission denied"
* Makefile.am (dist-hook): Touch the two generated files, so that
they are cannot be out of date wrt doc/coreutils.texi.
---
 Makefile.am | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/Makefile.am b/Makefile.am
index 68f537cef..396112f0c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -90,11 +90,14 @@ BUILT_SOURCES = .version
 # Have .timestamp based dates only in tarball builds.
 # The perl substitution is to change some key uses of "rm" to "/bin/rm".
 # See the rm_subst comment for details.
+# The touch avoids a subtle, spurious "make distcheck" failure.
 dist-hook: gen-ChangeLog
 	$(AM_V_GEN)chmod -R +rw $(distdir)
 	$(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
 	$(AM_V_GEN)date +%s > $(distdir)/.timestamp
 	$(AM_V_at)perl -pi -e '$(rm_subst)' $(distdir)/Makefile.in
+	$(AM_V_at)touch $(distdir)/doc/constants.texi \
+	  $(distdir)/doc/coreutils.info

 gen_start_ver = 8.15
 .PHONY: gen-ChangeLog
-- 
2.13.0



From MAILER-DAEMON Tue Jun 20 18:44:38 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dNRt0-0003Fq-Bc
	for mharc-coreutils@gnu.org; Tue, 20 Jun 2017 18:44:38 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:52039)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1dNRsv-0003FW-7q
	for coreutils@gnu.org; Tue, 20 Jun 2017 18:44:34 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1dNRss-0006eb-4t
	for coreutils@gnu.org; Tue, 20 Jun 2017 18:44:33 -0400
Received: from mout.kundenserver.de ([212.227.126.187]:53803)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <mail@bernhard-voelker.de>)
	id 1dNRsr-0006dM-PH
	for coreutils@gnu.org; Tue, 20 Jun 2017 18:44:30 -0400
Received: from [10.0.2.15] ([82.208.167.240]) by mrelayeu.kundenserver.de
	(mreue002 [212.227.15.167]) with ESMTPSA (Nemesis) id
	0Ldhch-1e5YCy1oWZ-00iyAf; Wed, 21 Jun 2017 00:44:23 +0200
Subject: Re: [PATCH] maint: avoid spurious "make distcheck" failure
To: Jim Meyering <jim@meyering.net>, coreutils@gnu.org
References: <lubpf3efuel708.fsf@meyering.net>
From: Bernhard Voelker <mail@bernhard-voelker.de>
Message-ID: <efc78605-1a6a-2343-57f0-2fae6857c5bc@bernhard-voelker.de>
Date: Wed, 21 Jun 2017 00:44:01 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
	Thunderbird/52.1.1
MIME-Version: 1.0
In-Reply-To: <lubpf3efuel708.fsf@meyering.net>
Content-Type: text/plain; charset=utf-8
Content-Language: de-DE-1901
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:7Aw1cGR2Mkrf4Jdy2TkW1I2+ySA7161sGNQISDjrfkKt1HV2s6k
	KxwMge5dA0fCET+7ZpH9aB284bw928RrVP6JTTgpdBbJ1n/f/mYg+UnWiSU/e2VmpU/hfe/
	VYmxzUZmeC70Dy4/4rghfJkxXi6+OTRyri61grbTfwnmytzjHZz9okHeg/4tXF09NOZ05gE
	w1Lcdee4hAQPprpIvqZiA==
X-UI-Out-Filterresults: notjunk:1;V01:K0:DW3YA0k7y+M=:4VT/m7fhVUwPCJ4HYCIpIk
	/CMz7/+q4MB1mNc9ga1DcIl27O7KDLYMhwBDhB9ll3gtdo/R7pYOy5p2RZvXzwI7N91qa6gEF
	FsI1khNZffCTmseeVLO3/fFtPc+6Q+cLF81//yh6sVZmaPmANzkHzcIQ//085fDbb6F7xexeB
	Zjmmvyn6U74n9NgXscB1pHEhhL0XjGsIsn9cywvBfEeWLnAxIOFFRUQ1rTahkboT7kjmRn17R
	8v5rfGMVsjPMauE19sT0WgqLiFRHyFhhEpm671LcDae+h87Y715XEmB7DKa53uvFBP1iXA2LF
	RJmwvxCM76gYK3Zs22AOVklPlVwbRZuoEYPTe5SMfljhMtHcS2dpU0Ti78NGCG7GmdsmIK/KW
	bbXlq6Ym+djUD8JGXocIdcsmU3LivYwKMd5813ko4qPGoQFgNRGQ5FkklKnqsTtHuSM/t+vEG
	1Zx7KcKMW1rf7BUCOK91cbgnay6ncZh40hf4I4pVoPf7cZ+1JscKDkHo9lqDFZay19yQqbw0O
	2OcTdwPcNERuW4BLyrSWb01ckly9BHznhB69Qx76SKs86cHWZev772Cca/NRmH7gPiFAqsMUr
	Hqzk91BhFrQ9AvGCmRZ87yHXSOZuNHgUE79nzwJJbhfEOpCJJye2IB4Hm+PkEoHIogHMb3fbO
	hScR4Iwltrh+ZNTXKZvFcIrmTocGWJDCjLr+4tQKRfZnkCwfnsYlibCetdKdIlP2cVf1ZUCE8
	tphu+rzthm2vUyry
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Tue, 20 Jun 2017 22:44:34 -0000

On 06/20/2017 10:49 PM, Jim Meyering wrote:
> From a05ba352d39a6e6a0c58d57f4b7acbb1e4f11f8b Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering@fb.com>
> Date: Tue, 20 Jun 2017 07:53:17 -0700
> Subject: [PATCH] maint: avoid spurious "make distcheck" failure

Nice!
> When the generated file, doc/constants.texi, happens to be older than
> doc/coreutils.info, it will not be updated until/unless its generated
> contents change.  This is due to way that rule is careful to update
> the file, to avoid provoking a pointless rerunning of makeinfo.
> 
> Note that this does not happen when one first runs "make distclean",
> as recommended in README-release.  However, I sometimes run it as
> a more-rigorous "make check", and shouldn't have to manually run
> "make distclean" first, in that case.
> 
> Before this change, one could reproduce the failure by running
> `touch -dyesterday doc/constants.texi && make distcheck`.  It would
> fail with "makeinfo: could not open ../../doc/coreutils.info-t
> for writing: Permission denied"
> * Makefile.am (dist-hook): Touch the two generated files, so that
> they are cannot be out of date wrt doc/coreutils.texi.

s/are //  # minor nit

Thanks & have a nice day,
Berny


From MAILER-DAEMON Tue Jun 20 19:06:02 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dNSDi-0003ET-Nf
	for mharc-coreutils@gnu.org; Tue, 20 Jun 2017 19:06:02 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:57344)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dNSDg-0003E2-5e
	for coreutils@gnu.org; Tue, 20 Jun 2017 19:06:01 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <meyering@gmail.com>) id 1dNSDa-0006nV-S3
	for coreutils@gnu.org; Tue, 20 Jun 2017 19:05:55 -0400
Received: from mail-ua0-x22e.google.com ([2607:f8b0:400c:c08::22e]:33004)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <meyering@gmail.com>) id 1dNSDa-0006nG-Nb
	for coreutils@gnu.org; Tue, 20 Jun 2017 19:05:54 -0400
Received: by mail-ua0-x22e.google.com with SMTP id 70so31016132uau.0
	for <coreutils@gnu.org>; Tue, 20 Jun 2017 16:05:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:sender:in-reply-to:references:from:date:message-id
	:subject:to:cc;
	bh=7V1vV3PlpTl6YwVtZuPsMm7Csmx4pCH9/zQOHjU6pyc=;
	b=ar7Y/0PCnPtcXhBa9u43Bf48EyJayfovZKRRi1FnGNk/m29A+NKYB5jT4iVfNqkbZh
	t9YVr6uGiy2dfmqEfb0u9cr9a/ZzGV93ua01hyTg9aTJZmTuxqTN+3Qg07pv6R2km9DM
	CBjhZAuIoI4R5Wwte4s2hU5qFMXDNmW18q55owq9Agd+ttgr3/VPGkfp8k0dh07jXJve
	sXbZVDsNUmknMEShT8hz1NBjp5sVl/kT4FlSJPlfXb5KreVvXZr+8YGqRmQzHBLIaLtI
	unMMmGN9Y2lEXYAvcTfP8aqlLdYY515jUY9+77NDC8fDHJ7pN5xOd+rCjd63FGGDp4sT
	uxnw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
	:date:message-id:subject:to:cc;
	bh=7V1vV3PlpTl6YwVtZuPsMm7Csmx4pCH9/zQOHjU6pyc=;
	b=i323swIduRjdUHWvwUuubVYPlVIeZSoqrrTbqk3cbzWXRqFWTgtP8MvaDP31pW+xDE
	xiCnFMGUE7dZAXj4/DCj/9IBoTQoR4+9E37drTBZJjyX4CGDt235YE/oVybCpqfIX785
	7+rw+vZ6k9VfWZ5BAzDFDHptn/LcR/MmuZkzrfGZBusJfIyqX4sepugqljW6dp5vZMeU
	1jAQtl955GrdKpSj6KRO8KFQXHwujXz35kQ7nkM0yGzpl6kGFbdejd6FQXFefvUswv/T
	p/IbZqdidHXxFKyikE+O8+gsWI2fFD+xQioXwIJULLyQNO8MkPyziyjzv9qGf0SmVosL
	Ia8A==
X-Gm-Message-State: AKS2vOysA/+1gk9mvj9db8J+IVNmQLGtZEmQlImIaN8uhV49EWsX7ho4
	R6ImXCIpHEC00m1P9jIkKwUbEwBzmw==
X-Received: by 10.176.24.78 with SMTP id j14mr11359021uag.120.1497999954037;
	Tue, 20 Jun 2017 16:05:54 -0700 (PDT)
MIME-Version: 1.0
Sender: meyering@gmail.com
Received: by 10.176.70.83 with HTTP; Tue, 20 Jun 2017 16:05:33 -0700 (PDT)
In-Reply-To: <efc78605-1a6a-2343-57f0-2fae6857c5bc@bernhard-voelker.de>
References: <lubpf3efuel708.fsf@meyering.net>
	<efc78605-1a6a-2343-57f0-2fae6857c5bc@bernhard-voelker.de>
From: Jim Meyering <jim@meyering.net>
Date: Tue, 20 Jun 2017 16:05:33 -0700
X-Google-Sender-Auth: Zy2Ubam5Awm3d9Au2gqrl-qpUQM
Message-ID: <CA+8g5KG83SiHc7tpVO_E0N1RVVn+1Sa_nWLmTWaC2H22O9gjPA@mail.gmail.com>
Subject: Re: [PATCH] maint: avoid spurious "make distcheck" failure
To: Bernhard Voelker <mail@bernhard-voelker.de>
Cc: Coreutils <coreutils@gnu.org>
Content-Type: text/plain; charset="UTF-8"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:400c:c08::22e
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, 20 Jun 2017 23:06:01 -0000

On Tue, Jun 20, 2017 at 3:44 PM, Bernhard Voelker
<mail@bernhard-voelker.de> wrote:
> On 06/20/2017 10:49 PM, Jim Meyering wrote:
>> From a05ba352d39a6e6a0c58d57f4b7acbb1e4f11f8b Mon Sep 17 00:00:00 2001
>> From: Jim Meyering <meyering@fb.com>
>> Date: Tue, 20 Jun 2017 07:53:17 -0700
>> Subject: [PATCH] maint: avoid spurious "make distcheck" failure
...
>> * Makefile.am (dist-hook): Touch the two generated files, so that
>> they are cannot be out of date wrt doc/coreutils.texi.
>
> s/are //  # minor nit

Well-caught! Thank you.


From MAILER-DAEMON Tue Jun 20 23:53:55 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dNWiJ-0007Uj-Mn
	for mharc-coreutils@gnu.org; Tue, 20 Jun 2017 23:53:55 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:46595)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <michael@felt.demon.nl>) id 1dNRTp-0006NI-UN
	for coreutils@gnu.org; Tue, 20 Jun 2017 18:18:39 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <michael@felt.demon.nl>) id 1dNRTl-00033d-CJ
	for coreutils@gnu.org; Tue, 20 Jun 2017 18:18:37 -0400
Received: from felt-1.demon.nl ([80.101.98.107]:32908 helo=felt.demon.nl)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <michael@felt.demon.nl>) id 1dNRTk-0002uH-UK
	for coreutils@gnu.org; Tue, 20 Jun 2017 18:18:33 -0400
Received: from [192.168.129.200] (x053 [192.168.129.53])
	by felt.demon.nl (AIX7.1/8.14.4/8.14.4) with ESMTP id v5KMIO1P12714166; 
	Tue, 20 Jun 2017 22:18:25 GMT
Subject: Re: coreutils-8.27 released [stable]
To: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>,
	Michael Felt <aixtools@gmail.com>, Coreutils <coreutils@gnu.org>
References: <8e8eaed6-2358-e2fe-272d-689101d2b30f@draigBrady.com>
	<CANvxniXzbZoQBDUpmhuT7zsK9d18DnZKCCYRiNDtQabv-E6tWQ@mail.gmail.com>
	<973883a1-e589-13fc-9e26-bd2b6e883e6d@draigBrady.com>
	<e683bdef-4976-615f-4318-636aa9051a0e@felt.demon.nl>
	<7dee834b-b26a-02d8-c07b-0871c8a98dad@draigBrady.com>
From: Michael Felt <michael@felt.demon.nl>
Message-ID: <b26d7bc9-b1c1-3e14-1682-558a2d276866@felt.demon.nl>
Date: Wed, 21 Jun 2017 00:18:25 +0200
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
	Thunderbird/52.2.0
MIME-Version: 1.0
In-Reply-To: <7dee834b-b26a-02d8-c07b-0871c8a98dad@draigBrady.com>
Content-Language: en-US
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 80.101.98.107
X-Mailman-Approved-At: Tue, 20 Jun 2017 23:53:54 -0400
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: quoted-printable
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: Tue, 20 Jun 2017 22:18:39 -0000



On 6/18/2017 10:55 PM, P=C3=A1draig Brady wrote:
>> Stop.
>> make returned an error
>>
>> Will look another time into missing "renameat"
> Seehttp://bugs.gnu.org/26044
I suppossed that solved that problem - and then the next one. Or maybe I=20
should have done something different from "autoreconf" after modifying=20
bootstrap.conf.

Now it stops - even with GNU make - at:
WARNING: 'makeinfo' is missing on your system.
          You should only need it if you modified a '.texi' file, or
          any other file indirectly affecting the aspect of the manual.
          You might want to install the Texinfo package:
          <http://www.gnu.org/software/texinfo/>
          The spurious makeinfo call might also be the consequence of
          using a buggy 'make' (AIX, DU, IRIX), in which case you might
          want to install GNU make:
          <http://www.gnu.org/software/make/>

I can install the package that include makeinfo - but from memory, I did=20
not need it with 8.25 (8.26 I never succeeded, nor posted about the issue=
s).

After installing texinfo - make continues, but sadly ends with:
   CCLD     src/cp
ld: 0711-317 ERROR: Undefined symbol: .renameat
ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more=20
information.
Makefile:7586: recipe for target 'src/cp' failed
make[2]: *** [src/cp] Error 8
make[2]: Leaving directory '/data/prj/gnu/coreutils-8.27'
Makefile:10791: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/data/prj/gnu/coreutils-8.27'
Makefile:5798: recipe for target 'all' failed
make: *** [all] Error 2

Summary:
1. updated local.mk to say -qinclude=3Dconfig.h
2. updated bootstrap.conf to include renameat
3. ran autoreconf
4. installed "gmake" and texinfo (for makeinfo)
5. still ends at missing renameat

All for tonight,
Michael
>
> cheers,
> P=C3=A1draig
>


From MAILER-DAEMON Wed Jun 21 01:01:10 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dNXlN-00051w-UW
	for mharc-coreutils@gnu.org; Wed, 21 Jun 2017 01:01:09 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:51192)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dNXlK-00051H-L0
	for coreutils@gnu.org; Wed, 21 Jun 2017 01:01:07 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dNXlG-0004wU-LB
	for coreutils@gnu.org; Wed, 21 Jun 2017 01:01:06 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:41666)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dNXlG-0004vy-E5
	for coreutils@gnu.org; Wed, 21 Jun 2017 01:01:02 -0400
Received: from localhost.localdomain (mobile-166-137-178-054.mycingular.net
	[166.137.178.54])
	(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 71DBE9A01;
	Wed, 21 Jun 2017 06:00:55 +0100 (IST)
Subject: Re: coreutils-8.27 released [stable]
To: Michael Felt <michael@felt.demon.nl>, Michael Felt <aixtools@gmail.com>,
	Coreutils <coreutils@gnu.org>
References: <8e8eaed6-2358-e2fe-272d-689101d2b30f@draigBrady.com>
	<CANvxniXzbZoQBDUpmhuT7zsK9d18DnZKCCYRiNDtQabv-E6tWQ@mail.gmail.com>
	<973883a1-e589-13fc-9e26-bd2b6e883e6d@draigBrady.com>
	<e683bdef-4976-615f-4318-636aa9051a0e@felt.demon.nl>
	<7dee834b-b26a-02d8-c07b-0871c8a98dad@draigBrady.com>
	<b26d7bc9-b1c1-3e14-1682-558a2d276866@felt.demon.nl>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <fee5ef63-2fdd-ce4c-62ae-72fa9efe3f8f@draigBrady.com>
Date: Tue, 20 Jun 2017 22:00:48 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <b26d7bc9-b1c1-3e14-1682-558a2d276866@felt.demon.nl>
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]
	[fuzzy]
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: Wed, 21 Jun 2017 05:01:08 -0000

On 20/06/17 15:18, Michael Felt wrote:
>=20
>=20
> On 6/18/2017 10:55 PM, P=C3=A1draig Brady wrote:
>>> Stop.
>>> make returned an error
>>>
>>> Will look another time into missing "renameat"
>> See http://bugs.gnu.org/26044
> I suppossed that solved that problem - and then the next one. Or maybe =
I should have done something different from "autoreconf" after modifying =
bootstrap.conf.
>=20
> Now it stops - even with GNU make - at:
> WARNING: 'makeinfo' is missing on your system.
>          You should only need it if you modified a '.texi' file, or
>          any other file indirectly affecting the aspect of the manual.
>          You might want to install the Texinfo package:
>          <http://www.gnu.org/software/texinfo/>
>          The spurious makeinfo call might also be the consequence of
>          using a buggy 'make' (AIX, DU, IRIX), in which case you might
>          want to install GNU make:
>          <http://www.gnu.org/software/make/>
>=20
> I can install the package that include makeinfo - but from memory, I di=
d not need it with 8.25 (8.26 I never succeeded, nor posted about the iss=
ues).
>=20
> After installing texinfo - make continues, but sadly ends with:
>   CCLD     src/cp
> ld: 0711-317 ERROR: Undefined symbol: .renameat
> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more infor=
mation.
> Makefile:7586: recipe for target 'src/cp' failed
> make[2]: *** [src/cp] Error 8
> make[2]: Leaving directory '/data/prj/gnu/coreutils-8.27'
> Makefile:10791: recipe for target 'all-recursive' failed
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory '/data/prj/gnu/coreutils-8.27'
> Makefile:5798: recipe for target 'all' failed
> make: *** [all] Error 2
>=20
> Summary:
> 1. updated local.mk to say -qinclude=3Dconfig.h
> 2. updated bootstrap.conf to include renameat
> 3. ran autoreconf
> 4. installed "gmake" and texinfo (for makeinfo)
> 5. still ends at missing renameat

There was a link in that bug where I made a dist tarball available
that should handle the renameat issue.
Hopefully that won't trigger the need for makeinfo.
Anyway to get around that you can just touch the info file I'd say

cheers,
P=C3=A1draig



From MAILER-DAEMON Wed Jun 21 06:39:47 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dNd35-0002Og-3s
	for mharc-coreutils@gnu.org; Wed, 21 Jun 2017 06:39:47 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:33214)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <aixtools@gmail.com>) id 1dNd32-0002OZ-DP
	for coreutils@gnu.org; Wed, 21 Jun 2017 06:39:45 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <aixtools@gmail.com>) id 1dNd2y-0005Ss-Fb
	for coreutils@gnu.org; Wed, 21 Jun 2017 06:39:44 -0400
Received: from mail-ot0-x232.google.com ([2607:f8b0:4003:c0f::232]:35971)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <aixtools@gmail.com>) id 1dNd2y-0005Rc-7B
	for coreutils@gnu.org; Wed, 21 Jun 2017 06:39:40 -0400
Received: by mail-ot0-x232.google.com with SMTP id s7so109092067otb.3
	for <coreutils@gnu.org>; Wed, 21 Jun 2017 03:39:38 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:in-reply-to:references:from:date:message-id:subject:to
	:cc:content-transfer-encoding;
	bh=FcBreyxQ3nVFkD0fxeFMsa4seVOwC3jA6lbKUX22pUQ=;
	b=aNt/SLjRs0ZiXCYZRRdmM1fvp8L0U/0E2glcdP6orJnktKeIM4NUWPwcN/etTAsaSB
	ggveJUgFbvAR5rqjGq24QedxmBcNxIvPsQjOLpSdxql7aoutwKB1Wf+aioAcUUCpE2wW
	wfmVRiJDCUClSzlBLItmYwrDwlrVdrQhswfCwwoyo6LExbf275uP97U0t6a13thVRLen
	qV2UUrnMgYYHy22Rcad4oK9pwNVsEIUXQ9PWNOgkirvHndJqrtcgMv7NStTv09n57e2C
	bMZETG7Uo76UGUte8oL+iGB5iR3Bumu45W23vpMAmbfRchDWxEjVjTn2VgHIVwEk/Qa+
	xXow==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:in-reply-to:references:from:date
	:message-id:subject:to:cc:content-transfer-encoding;
	bh=FcBreyxQ3nVFkD0fxeFMsa4seVOwC3jA6lbKUX22pUQ=;
	b=jcb9MNfG9Fp76RoJ373gZlIrPKxeDWPXY+7K9AZjXHiLUIyTamSNPQQzXDa+4SjCnr
	5hRoiqc53VDs3w1IElX3GyfKCQbzzUwbh8MtuXIPedOJbbYwDsnGXar0R2tWOMABhWkG
	w9x57BAReBpslrL4G1kZ66CTRnth5p9ZC5jlKrj04k88G5HhnEKuKLUjD/xqZ/wEHs42
	r2TKHbuMoBJLBkFNrltanzFmjcY7bOZca1Trq9x7wGX4uyPgvjDL4aVgAO1wbwGE0gBu
	bed/EAz7RxvsXsR4wIqJFt8mjfOgoceQM3KFQV8uF3ge5ClLLxGdDm1BMtby4QET28e9
	Fp8g==
X-Gm-Message-State: AKS2vOzvq6cOQpq5aGNNGgro4VUcWRmNldpPpsATaqItZUTTG+ApFMFZ
	mod5wVpm/hY2Lj25cq8X8i64Liuafw==
X-Received: by 10.157.12.205 with SMTP id o13mr20589518otd.20.1498041577873;
	Wed, 21 Jun 2017 03:39:37 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.182.70.2 with HTTP; Wed, 21 Jun 2017 03:39:37 -0700 (PDT)
In-Reply-To: <fee5ef63-2fdd-ce4c-62ae-72fa9efe3f8f@draigBrady.com>
References: <8e8eaed6-2358-e2fe-272d-689101d2b30f@draigBrady.com>
	<CANvxniXzbZoQBDUpmhuT7zsK9d18DnZKCCYRiNDtQabv-E6tWQ@mail.gmail.com>
	<973883a1-e589-13fc-9e26-bd2b6e883e6d@draigBrady.com>
	<e683bdef-4976-615f-4318-636aa9051a0e@felt.demon.nl>
	<7dee834b-b26a-02d8-c07b-0871c8a98dad@draigBrady.com>
	<b26d7bc9-b1c1-3e14-1682-558a2d276866@felt.demon.nl>
	<fee5ef63-2fdd-ce4c-62ae-72fa9efe3f8f@draigBrady.com>
From: Michael Felt <aixtools@gmail.com>
Date: Wed, 21 Jun 2017 12:39:37 +0200
Message-ID: <CANvxniV_dU5QjHAX=pW5r_nbDd7Xi=7FrA709y5LLAqtwi+0Jw@mail.gmail.com>
Subject: Re: coreutils-8.27 released [stable]
To: =?UTF-8?Q?P=C3=A1draig_Brady?= <P@draigbrady.com>
Cc: Michael Felt <michael@felt.demon.nl>, Coreutils <coreutils@gnu.org>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:4003:c0f::232
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, 21 Jun 2017 10:39:45 -0000

So, after downloading the tarball, and updating local.mk I was able to
build from the sources.

Will provide the details later, but summary of "make check" is:

=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
Testsuite summary for GNU coreutils 8.27.4-3c9d7
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
# TOTAL: 592
# PASS:  412
# SKIP:  177
# XFAIL: 0
# FAIL:  3
# XPASS: 0
# ERROR: 0
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
See ./tests/test-suite.log
Please report to bug-coreutils@gnu.org
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D

On Wed, Jun 21, 2017 at 7:00 AM, P=C3=A1draig Brady <P@draigbrady.com> wrot=
e:
> On 20/06/17 15:18, Michael Felt wrote:
>>
>>
>> On 6/18/2017 10:55 PM, P=C3=A1draig Brady wrote:
>>>> Stop.
>>>> make returned an error
>>>>
>>>> Will look another time into missing "renameat"
>>> See http://bugs.gnu.org/26044
>> I suppossed that solved that problem - and then the next one. Or maybe I=
 should have done something different from "autoreconf" after modifying boo=
tstrap.conf.
>>
>> Now it stops - even with GNU make - at:
>> WARNING: 'makeinfo' is missing on your system.
>>          You should only need it if you modified a '.texi' file, or
>>          any other file indirectly affecting the aspect of the manual.
>>          You might want to install the Texinfo package:
>>          <http://www.gnu.org/software/texinfo/>
>>          The spurious makeinfo call might also be the consequence of
>>          using a buggy 'make' (AIX, DU, IRIX), in which case you might
>>          want to install GNU make:
>>          <http://www.gnu.org/software/make/>
>>
>> I can install the package that include makeinfo - but from memory, I did=
 not need it with 8.25 (8.26 I never succeeded, nor posted about the issues=
).
>>
>> After installing texinfo - make continues, but sadly ends with:
>>   CCLD     src/cp
>> ld: 0711-317 ERROR: Undefined symbol: .renameat
>> ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more inform=
ation.
>> Makefile:7586: recipe for target 'src/cp' failed
>> make[2]: *** [src/cp] Error 8
>> make[2]: Leaving directory '/data/prj/gnu/coreutils-8.27'
>> Makefile:10791: recipe for target 'all-recursive' failed
>> make[1]: *** [all-recursive] Error 1
>> make[1]: Leaving directory '/data/prj/gnu/coreutils-8.27'
>> Makefile:5798: recipe for target 'all' failed
>> make: *** [all] Error 2
>>
>> Summary:
>> 1. updated local.mk to say -qinclude=3Dconfig.h
>> 2. updated bootstrap.conf to include renameat
>> 3. ran autoreconf
>> 4. installed "gmake" and texinfo (for makeinfo)
>> 5. still ends at missing renameat
>
> There was a link in that bug where I made a dist tarball available
> that should handle the renameat issue.
> Hopefully that won't trigger the need for makeinfo.
> Anyway to get around that you can just touch the info file I'd say
>
> cheers,
> P=C3=A1draig
>


From MAILER-DAEMON Sat Jun 24 20:03:40 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dOv1g-0008CI-M8
	for mharc-coreutils@gnu.org; Sat, 24 Jun 2017 20:03:40 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:36562)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1dOv1e-0008Bn-9T
	for coreutils@gnu.org; Sat, 24 Jun 2017 20:03:39 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1dOv1b-0004BR-3Q
	for coreutils@gnu.org; Sat, 24 Jun 2017 20:03:38 -0400
Received: from mail-qk0-x232.google.com ([2607:f8b0:400d:c09::232]:36734)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <assafgordon@gmail.com>)
	id 1dOv1a-0004AI-UT
	for coreutils@gnu.org; Sat, 24 Jun 2017 20:03:35 -0400
Received: by mail-qk0-x232.google.com with SMTP id p21so57953912qke.3
	for <coreutils@gnu.org>; Sat, 24 Jun 2017 17:03:33 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=date:from:to:subject:message-id:mime-version:content-disposition
	:user-agent; bh=zdLf56IJzEUo+3eZA4obl3Wm6hYQevJ4+b1g6gD1ii8=;
	b=qabGGUcOZ7TwPNikpO/ib+3rAhNxOZ+bXc1w2KFEonknOURoHnVaxypgJxo+fYQIto
	n9Sj5iHaHvEhxrrOG0U9nqDnrEU5tQdUGhlgdKS1w6r+4spgzp228Ua2/5N0D4Sfu0P8
	XAzRE+g7kkwviHV0XAANnuEVSUuzUFTCEkTQgtpZMiEor36wOMvpRtwNeWhz4olzrVtL
	0Wul5njt/krOKJ7mkQQcxOvMsvndM4xxHinSuVzxSTfV7ApY6O3/KNzCAvGBAgi9Ou79
	sy5yXd4vRcgQZc/Lesn59iu3JVHtvbozRtXT6ARI3XK75FXqSer45foes9vWkdb9SMZr
	6QlQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:date:from:to:subject:message-id:mime-version
	:content-disposition:user-agent;
	bh=zdLf56IJzEUo+3eZA4obl3Wm6hYQevJ4+b1g6gD1ii8=;
	b=Uzv+rg9C9J0Bns57+57wDpD7zG0oUHZeZp/S76ygFsSaofJMTOuPraZIn/atveNeEd
	jXahCofsOTe0dOqEKq2s8AlrEpQFLAP0evw/GkzsUiaifLVtrhjzz3y3BBYu75OaqLOQ
	+KhIS5EYubpjXKIsStnWbd2TPoySgGJgDkYaF2sutiti1FbelMFmh3OkOi0vone3TAfn
	cqOyBEcQcVnw/tcYieaqHD77TMnPzX+HQwYwruFvhysqboIdHtOAJvYwLrrmlJyR90ab
	gmjkdgmGP7R/CysTmAw0/QkMmV64o1IWQlh0IQskrDMD/BQ9df3Ik5ACpxLw1L+5kEnL
	Ej+w==
X-Gm-Message-State: AKS2vOwc6M2tbFiCExUtMWy03KLiyg72d6b1pD3B50w77jDKWUEVCESt
	9kQRKhZqI8gF/EX9aes=
X-Received: by 10.55.203.208 with SMTP id u77mr15660989qkl.95.1498349012617;
	Sat, 24 Jun 2017 17:03:32 -0700 (PDT)
Received: from gmail.com (housegordon.org. [104.236.108.240])
	by smtp.gmail.com with ESMTPSA id 8sm6467626qkx.28.2017.06.24.17.03.31
	for <coreutils@gnu.org>
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Sat, 24 Jun 2017 17:03:31 -0700 (PDT)
Date: Sun, 25 Jun 2017 00:02:53 +0000
From: Assaf Gordon <assafgordon@gmail.com>
To: coreutils@gnu.org
Subject: realpath edge cases
Message-ID: <20170625000252.GA17379@gmail.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="opJtzjQTFsWo+cga"
Content-Disposition: inline
User-Agent: Mutt/1.5.23 (2014-03-12)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:400d:c09::232
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, 25 Jun 2017 00:03:39 -0000


--opJtzjQTFsWo+cga
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Disposition: inline

Hello all,

I've encountered two interesting (?) edge-cases with realpath.
Perhaps they warrent a change in documentation (or even 
error-checking code).

First,
Running 'realpath' in a deleted (unlinked) directory leads to confusing
error messages. Example:

    # In terminal 1
    mkdir /tmp/a
    cd /tmp/a

    # In another terminal
    rmdir /tmp/a

    # back in terminal 1
    $ realpath /foo
    /foo

    $ realpath foo
    realpath: foo: No such file or directory

    $ realpath ../foo
    realpath: ../foo: No such file or directory

    $ realpath -m foo
    realpath: foo: No such file or directory

I'd say this error message is confusing, because naively 'realpath' does
not require the last component to exist, and with '-m' it doesn't
require any component to exist. Yet the error message hints that
something that should exist doesn't.

The reason for the error message is this flow:
   src/realpath.c:process_path()
     src/realpath.c:realpath_canon()
       gnulib/lib/canonicalize.c:canonicalize_filename_mode()
         gnulib/lib/xgetcwd.c:xgetcwd()

Then xgetcwd fails (because the directory was deleted),
but despite the 'x' prefix, it only dies on ENOMEM,
not on ENOENT. It returns NULL, and the rest of the program
fails, but errno remains at ENOENT.

Not sure what would be a good gnulib fix without breaking
existing code that uses 'canonicalize_filename_mode'.

Of course, it is always recommended not to run programs
in a deleted directory... many programs will fail with confusing
errors.


Second,
`realpath --help` shows:
  --relative-to=FILE       print the resolved path relative to FILE
  --relative-base=FILE     print absolute paths unless paths below FILE

This hints (to a naive person like me :) ) that realpath will calculate
relative path to any file. But in fact, it assumes that the FILE
argument is always a directory, and with 'realpath -e' it indeeds
verifies it's a directory.

Example:

    $ mkdir /tmp/b
    $ cd /tmp/b
    $ touch 1
    $ realpath --relative-to=/tmp/b/1 2
    ../2
    $ realpath -e --relative-to=/tmp/b/1 2
    realpath: /tmp/b/1: Not a directory

One could argue it doesn't matter since 'realpath'
is mainly used to construct path strings in script.
But the resulting concatenated string is not a valid path:

    $ touch /tmp/b/1/../2
    touch: cannot touch '/tmp/b/1/../2': Not a directory

That is, if someone writes a shell script like:

    base=/foo/bar/file.txt
    rel=$(realpath --relative-to="$base" another.txt)

There might be assumption that "$base/$rel" should always work,
but it only works correctly if '$base' is a directory, despite
realpath not returning error message.

I assume that checking if the argument to --relative-{to,base}
is actually a directory when not using 'realpath -e' is not
acceptable as it will break existing behaviour.

So perhaps just update the usage text? (patch attached).
If not, then add a new 'gotcha' ?

regards,
 - assaf


--opJtzjQTFsWo+cga
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0001-realpath-improve-usage-description-for-relative-to-b.patch"

>From 4531af6d156eb1391a1152a5bd27488159ad2f68 Mon Sep 17 00:00:00 2001
From: Assaf Gordon <assafgordon@gmail.com>
Date: Sat, 24 Jun 2017 19:47:26 -0400
Subject: [PATCH] realpath: improve usage description for --relative-{to,base}

* src/realpath.c (usage): Explicitly say 'DIR' instead of 'FILE' for
--relative-{to,base} parameters, to avoid giving the impression
that regular files can be used as relative base.
---
 src/realpath.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/realpath.c b/src/realpath.c
index 92d88c5..d4c1595 100644
--- a/src/realpath.c
+++ b/src/realpath.c
@@ -81,8 +81,8 @@ all but the last component must exist\n\
   -L, --logical                resolve '..' components before symlinks\n\
   -P, --physical               resolve symlinks as encountered (default)\n\
   -q, --quiet                  suppress most error messages\n\
-      --relative-to=FILE       print the resolved path relative to FILE\n\
-      --relative-base=FILE     print absolute paths unless paths below FILE\n\
+      --relative-to=DIR        print the resolved path relative to DIR\n\
+      --relative-base=DIR      print absolute paths unless paths below DIR\n\
   -s, --strip, --no-symlinks   don't expand symlinks\n\
   -z, --zero                   end each output line with NUL, not newline\n\
 \n\
-- 
2.8.2


--opJtzjQTFsWo+cga--


From MAILER-DAEMON Mon Jun 26 02:54:52 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dPNvA-0001a3-3K
	for mharc-coreutils@gnu.org; Mon, 26 Jun 2017 02:54:52 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:48734)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dPNv7-0001Zn-6h
	for coreutils@gnu.org; Mon, 26 Jun 2017 02:54:50 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dPNv4-0005X1-57
	for coreutils@gnu.org; Mon, 26 Jun 2017 02:54:49 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:36712)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dPNv3-0005Vp-UC
	for coreutils@gnu.org; Mon, 26 Jun 2017 02:54:46 -0400
Received: from localhost.localdomain (unknown [73.93.152.138])
	(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 85E669894;
	Mon, 26 Jun 2017 07:54:42 +0100 (IST)
Subject: Re: realpath edge cases
To: Assaf Gordon <assafgordon@gmail.com>, coreutils@gnu.org
References: <20170625000252.GA17379@gmail.com>
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <24e013fd-e8b8-7dac-d5a0-49e6aaf59174@draigBrady.com>
Date: Sun, 25 Jun 2017 23:54:40 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <20170625000252.GA17379@gmail.com>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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, 26 Jun 2017 06:54:50 -0000

On 24/06/17 17:02, Assaf Gordon wrote:
> Hello all,
>=20
> I've encountered two interesting (?) edge-cases with realpath.
> Perhaps they warrent a change in documentation (or even=20
> error-checking code).
>=20
> First,
> Running 'realpath' in a deleted (unlinked) directory leads to confusing
> error messages. Example:
>=20
>     # In terminal 1
>     mkdir /tmp/a
>     cd /tmp/a
>=20
>     # In another terminal
>     rmdir /tmp/a
>=20
>     # back in terminal 1
>     $ realpath /foo
>     /foo
>=20
>     $ realpath foo
>     realpath: foo: No such file or directory
>=20
>     $ realpath ../foo
>     realpath: ../foo: No such file or directory
>=20
>     $ realpath -m foo
>     realpath: foo: No such file or directory
>=20
> I'd say this error message is confusing, because naively 'realpath' doe=
s
> not require the last component to exist, and with '-m' it doesn't
> require any component to exist. Yet the error message hints that
> something that should exist doesn't.
>=20
> The reason for the error message is this flow:
>    src/realpath.c:process_path()
>      src/realpath.c:realpath_canon()
>        gnulib/lib/canonicalize.c:canonicalize_filename_mode()
>          gnulib/lib/xgetcwd.c:xgetcwd()
>=20
> Then xgetcwd fails (because the directory was deleted),
> but despite the 'x' prefix, it only dies on ENOMEM,
> not on ENOENT. It returns NULL, and the rest of the program
> fails, but errno remains at ENOENT.
>=20
> Not sure what would be a good gnulib fix without breaking
> existing code that uses 'canonicalize_filename_mode'.
>=20
> Of course, it is always recommended not to run programs
> in a deleted directory... many programs will fail with confusing
> errors.

Yes, it would be better to improve the error for this case
to say we can't get the name of the _current directory_.

> Second,
> `realpath --help` shows:
>   --relative-to=3DFILE       print the resolved path relative to FILE
>   --relative-base=3DFILE     print absolute paths unless paths below FI=
LE
>=20
> This hints (to a naive person like me :) ) that realpath will calculate
> relative path to any file. But in fact, it assumes that the FILE
> argument is always a directory, and with 'realpath -e' it indeeds
> verifies it's a directory.

> So perhaps just update the usage text? (patch attached).
> If not, then add a new 'gotcha' ?

> --- a/src/realpath.c
> +++ b/src/realpath.c
> @@ -81,8 +81,8 @@ all but the last component must exist\n\

> -      --relative-to=3DFILE       print the resolved path relative to F=
ILE\n\
> -      --relative-base=3DFILE     print absolute paths unless paths bel=
ow FILE\n\
> +      --relative-to=3DDIR        print the resolved path relative to D=
IR\n\
> +      --relative-base=3DDIR      print absolute paths unless paths bel=
ow DIR\n\

Yes this is clearer.
Otherwise one might also think the FILE's directory is used.
Please update the info doc also.

thanks!
P=E1draig


From MAILER-DAEMON Tue Jun 27 20:56:14 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dQ1HC-0005Be-B5
	for mharc-coreutils@gnu.org; Tue, 27 Jun 2017 20:56:14 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:58472)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1dQ1HA-0005BU-Pi
	for coreutils@gnu.org; Tue, 27 Jun 2017 20:56:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1dQ1H7-00018e-PO
	for coreutils@gnu.org; Tue, 27 Jun 2017 20:56:12 -0400
Received: from mail-qk0-x236.google.com ([2607:f8b0:400d:c09::236]:35603)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <assafgordon@gmail.com>)
	id 1dQ1H7-00018S-LK
	for coreutils@gnu.org; Tue, 27 Jun 2017 20:56:09 -0400
Received: by mail-qk0-x236.google.com with SMTP id 16so39515865qkg.2
	for <coreutils@gnu.org>; Tue, 27 Jun 2017 17:56:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=date:from:to:cc:subject:message-id:references:mime-version
	:content-disposition:content-transfer-encoding:in-reply-to
	:user-agent; bh=uUs+2LT4HfyK0K/3od0KjdvIhrSq7tU8WpymFbdMIIs=;
	b=EbTVL95j4ZoZmT7cuzS1O2JOCn/QrQchh3qpk+JZW95vEzt046NWCcWLXUJTiDfzln
	w88Kva+Js0QxERQo4B+lmOeuCgbz2PsdB4gGhfO9QWzigGlvlQB0Iil8Kvl0OJNfsP+o
	E481ruQWJMSqe2lrbC/tx29cD8VBLbHS3ndhk+mRjLDEipCFdbgEtrtYQwKmk5R5/pma
	JvatfWPAMRN5s3++MpXwnQvirnr+qiB42LW2wUayRvQPOsaa27rYe1FB7H8cJAG8ISjC
	ZtpHiasOKX1bFJozghnobXA3HW1SGiMi7b5j0qfoSL28Rnj8UemQdaWBTQa0pdgIjSES
	VJtw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:date:from:to:cc:subject:message-id:references
	:mime-version:content-disposition:content-transfer-encoding
	:in-reply-to:user-agent;
	bh=uUs+2LT4HfyK0K/3od0KjdvIhrSq7tU8WpymFbdMIIs=;
	b=Pomz8e3PIPXYoeS9L7GOmy0lJZkbo3h9r3MUoOnJkSXyrUVMDrK8VF3gUL0wFINFWk
	1pLzma09unuU8HiqnSS4WB9QsPsPxKLwAkwa7CuPrdyVWrM0+hnN7WTWPj+rMrixKu03
	hF1elZqWem6/vcMAAwYsklKnzGM6N1C/08COWWLvTGa6MVgLFmfJhCdUXtoHaMQZgVXQ
	pjkEcJXtaOTN6bXH5s4bklDM+BRTHFaIpeXXasQF8IMOBPLc6JTX/LOfNUNlAbbuZHGn
	lxidg7WS99SBkPy+0C5DOaTJJCNQUkXrxL+ghJ0K/UArPVy6E2PFTBmkGuGSteoKihF/
	XBIA==
X-Gm-Message-State: AKS2vOxT3SQqV4PU8pg9ikZEddMGI+xcIGgL+mveEEvXB/Tqa6cx8fp+
	2VQ/37bUetOHxSHsZVQ=
X-Received: by 10.55.118.66 with SMTP id r63mr9598676qkc.234.1498611368502;
	Tue, 27 Jun 2017 17:56:08 -0700 (PDT)
Received: from gmail.com (housegordon.org. [104.236.108.240])
	by smtp.gmail.com with ESMTPSA id l12sm665783qtl.24.2017.06.27.17.56.07
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Tue, 27 Jun 2017 17:56:07 -0700 (PDT)
Date: Wed, 28 Jun 2017 00:55:29 +0000
From: Assaf Gordon <assafgordon@gmail.com>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Cc: coreutils@gnu.org
Subject: Re: realpath edge cases
Message-ID: <20170628005528.GA12440@gmail.com>
References: <20170625000252.GA17379@gmail.com>
	<24e013fd-e8b8-7dac-d5a0-49e6aaf59174@draigBrady.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
In-Reply-To: <24e013fd-e8b8-7dac-d5a0-49e6aaf59174@draigBrady.com>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:400d:c09::236
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, 28 Jun 2017 00:56:13 -0000

Hi,

On Sun, Jun 25, 2017 at 11:54:40PM -0700, Pádraig Brady wrote:
>On 24/06/17 17:02, Assaf Gordon wrote:

>> Second,
>> `realpath --help` shows:
>>   --relative-to=FILE       print the resolved path relative to FILE
>>   --relative-base=FILE     print absolute paths unless paths below FILE
>>
>> So perhaps just update the usage text? (patch attached).

>Yes this is clearer.
>Otherwise one might also think the FILE's directory is used.
>Please update the info doc also.

Attached are three patches for realpath's documentation:

  realpath: improve usage description for --relative-{to,base}
  doc: fix realpath index entry
  doc: add 'realpath usage examples' section

  doc/coreutils.texi | 103 +++++++++++++++++++++++++++++++++++++++++------------
  src/realpath.c     |   4 +--
  2 files changed, 83 insertions(+), 24 deletions(-)

The last one gives examples of the interaction between
--relative-to and --relative-base, and I hope it makes
them easier to understand.

Comments welcomed,
 - assaf




From MAILER-DAEMON Tue Jun 27 21:36:48 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dQ1uS-000583-51
	for mharc-coreutils@gnu.org; Tue, 27 Jun 2017 21:36:48 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:36070)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1dQ1uQ-00057v-1v
	for coreutils@gnu.org; Tue, 27 Jun 2017 21:36:47 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1dQ1uM-0008N6-VT
	for coreutils@gnu.org; Tue, 27 Jun 2017 21:36:46 -0400
Received: from mail-qt0-x235.google.com ([2607:f8b0:400d:c0d::235]:33633)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <assafgordon@gmail.com>)
	id 1dQ1uM-0008My-P1
	for coreutils@gnu.org; Tue, 27 Jun 2017 21:36:42 -0400
Received: by mail-qt0-x235.google.com with SMTP id r30so38999951qtc.0
	for <coreutils@gnu.org>; Tue, 27 Jun 2017 18:36:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=date:from:to:cc:subject:message-id:references:mime-version
	:content-disposition:in-reply-to:user-agent;
	bh=S7nY55u4h7KSDksJu/0upDGl5fIdjwX1PeZu9IXCd8s=;
	b=jfSCZgMxl8jDxyTKj8aZjBEGtpyUYOUuORGI1J/F6sU2uH1kPI1u3nSspJ8QEilLcK
	LGxHY40EDX8JfJsbG4FWuxvDCv6Zs0VBxd/iFo/hB27Q8AMuiq12dpxXv0x/SyAr6DDV
	FI73PooCzKFmyUecbtJre5V1tqnXiMi/1D4OGmsbKI/Fbd6ccAG+RiGJrr5bkU3TJLaw
	ShCyUcKBgutbqFrOiI5Eu1YWDux3cDjWRioJfX3jcQkA9TbTBlPVyues9rXtG5D7PQt3
	58WQQNPecf9c8i71U80+nhXwnvnQVLuW7DgVJWOpErq39hzPAGMsLYid6uspuWq6/tn9
	nwZA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:date:from:to:cc:subject:message-id:references
	:mime-version:content-disposition:in-reply-to:user-agent;
	bh=S7nY55u4h7KSDksJu/0upDGl5fIdjwX1PeZu9IXCd8s=;
	b=ZMPV8CdPoUtn2IUPj8hfIughEYwAwYbnZ5cjPjgsiKZCKj3KMFlRqz1LfhlVXYQoeR
	P1sPKkA2yHOuESMDsflv/T6PRmXWlUJN+6a7oudvhRw/UFx7QVebenU28D5AvNdVbwum
	M+il+efJDo3PbzVFO/kaVpbUmuebLFhoaIIvOKIQpUZ+54yiEZV7QNcDuM5FyTQc2aKn
	kwPIqyXGLeEyUpqI4wF9bisJz8VB5XoeuAZCONbgUdFEsAYkx5ysfEZtiW15IOEitZuM
	CE+Ua7SUjjWv7w6uBEtzzcX/DyeF27aZmOcBdVFb35RuLOVtYx2x8G3kVzJjbS3lTukX
	BurQ==
X-Gm-Message-State: AKS2vOyCn5nL5Owkcq6qIsEPgax3zKdRaLj/q6k779qtDXlFSrRiXIwf
	IEky/iytN3R+Xw==
X-Received: by 10.237.54.37 with SMTP id e34mr132099qtb.41.1498613802269;
	Tue, 27 Jun 2017 18:36:42 -0700 (PDT)
Received: from gmail.com (housegordon.org. [104.236.108.240])
	by smtp.gmail.com with ESMTPSA id f8sm634166qke.52.2017.06.27.18.36.40
	(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
	Tue, 27 Jun 2017 18:36:41 -0700 (PDT)
Date: Wed, 28 Jun 2017 01:36:02 +0000
From: Assaf Gordon <assafgordon@gmail.com>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Cc: coreutils@gnu.org
Subject: Re: realpath edge cases
Message-ID: <20170628013600.GB12440@gmail.com>
References: <20170625000252.GA17379@gmail.com>
	<24e013fd-e8b8-7dac-d5a0-49e6aaf59174@draigBrady.com>
	<20170628005528.GA12440@gmail.com>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="a8Wt8u1KmwUX3Y2C"
Content-Disposition: inline
In-Reply-To: <20170628005528.GA12440@gmail.com>
User-Agent: Mutt/1.5.23 (2014-03-12)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:400d:c0d::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: Wed, 28 Jun 2017 01:36:47 -0000


--a8Wt8u1KmwUX3Y2C
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Disposition: inline

On Wed, Jun 28, 2017 at 12:55:29AM +0000, Assaf Gordon wrote:
>Attached are three patches for realpath's documentation:
>
> realpath: improve usage description for --relative-{to,base}
> doc: fix realpath index entry
> doc: add 'realpath usage examples' section

Once again, with the missing attachment.





--a8Wt8u1KmwUX3Y2C
Content-Type: application/gzip
Content-Disposition: attachment; filename="realpath-doc1.patch.gz"
Content-Transfer-Encoding: base64

H4sICAv8UlkAA3JlYWxwYXRoLWRvYzEucGF0Y2gAzVjdk6PGEX/nr+g37UYCCfStSlJy7Ltk
U875ynspP8R5GGCQsIHBDKy0t9b/7u4ZPoSEdHt7e5XIW2eY6enp7/41bzMRw9x2vPnC9ub2
cj5irrPgM9edcTaejoLldDLic2ZzNpvDv0QC9zwFew6j0Ur9gTMa2cZbZLOCb6RkAfxdZD7S
/ZnR20a9rDcxCyPLE/Ffje9Yzldwz/IBOBP4Z5EgB+RnL1eT+cqZgTmajEbGfeH+wr18Bf95
/82Hb/8B9nD8X8g4i1KWb1cQxmkmHjgUkm04+Fx6WZjmIV4biMwA08x4xPLwgZtPuRi4TPKD
YfwJZOYNKyaWBzfq+O0K3uzTKPTCPHoEyR6h993djz0IE5lz5oMIoPf27vs3PcW7izWkLGMx
z3kmB5ALYA8i9GETPoTJBvItV+JyKVE+I9+yHBXZFBHLIAgjLsFjCbikC/eBSaj4A/G2UGpf
eENPZLzIw0haOd+HcFNpcUumjJHMNE2ji/J3sB3oq5+pfsapFej3O8AEiMIAp5Jqy5IN9wew
IEvwjKwrb/q3tODziOt389Yw/DAI0OSbMAc27BDB7Vg0wsTne5jP+XI55pZls8V46dtgj0az
yYS06eRloBrd/NZrMO2JbY8HDupbP+Hyh20oAf/IET4PWBHlEAufk2NFyjNGmlgGrEWqhTLN
34qQ5wbcF6nyG/gh2yRC5qEHMb5j0EgKBpAp98IgRL+RzSBBT0jkZJjrMOfxcRjm4i/rB5Y9
Ed3B6F/c98Ps0BLliALXPb2Mi+Q8w3yfhUmuNEM5RfTQkqSJJIxJommLaxn9lx5HKTE5RfaI
yr4TOVKQjYXOwK1IRKbNvdZLT2Z8AJb4zTvmjH6UBqALchYmKleEvh8dirmXeLzbmJQY2lw6
s8/N2VBcNijRGDo6Ssnx6YFFmLq7LU90Pu7CfNuIfeyNw0CptAujiKyXZ6GHIUNaiyJPi5zC
q/sgSLKnKgOlgbW9WVadHRimSLAYKTmauNEkVO144rMkl+qO2g4WwA94f7YLZS0Evhv9z+NF
FrvECpiLcVKgx+s4QdK7i5rusJ4lIm9CZ0BsEsPUyXhBESVaSrGJHjiOwpaud4HRv8SGdLjO
pdQSmVySHaPhRGzttTr4IS5kTpWbGWYjxIkqVCaOswPv3zKUA2s+DwJkhGnYcVgp8IyzKv1W
L8g/o0rA6/kH8BaF4HsWpxFfYTa2iv1JJ3FPFsoiv3T8xcKbWpY/8ezpctou8idHdIE/WaTi
vrAHC+irf/GVYda5OighYugGxBapSDiaUHlFafBz8rOBzc38foASR2ITeiyCk19Z+KBnWb2G
iUS3ovWx5j3GUZj8KitW74lVun2UHbwqVtUZauZoRFFgBGYYgzdl97mtmP02qHrNqVQAsuo9
sSB1sgzdUPUeOm9qsnYLIZhSnk/PSzsZs5UIRN7NS9XPmpvmVac+8ZFQJBGJp19cHoldza/f
JRtiKvgM2ZC8m5USrWb2XNFKdsRKktWpXqf0kAiz9hcggEp6FDwpZcup7z8S/UeeiXNvoZ99
4MzbVsUSD3LdPN79G8OPamDCd7SquCmrm2A4lm1NDEPhZ5hPZ2Nm+zPus5E7Y/5yPHMcbzxa
Mh5M7GmwZNPx2J0sXhGGfyg4wvB5C4ZPx6vp4gIMdwiGI/paYZ3Y13gcdJ5j3mSPhvEB/drD
LZ+M10PVEWptMRV666BCL/oYQWwIc0v3YAwFzA1EagkZG/8XiBM8q5aqw1hbcIcqMfa2X4o4
LetX3nH7zRGUr/a1BAbt31rwrQK7KIzqDyXKKk9ZxmUMrm5BDF6e71Cx4XcNoyNkxS1bV98a
edsN8lbA266B95fi7hJuW9bUmTuOvfxC3D2aOZPBHGF3+YCL91xneIW0PTRJXuJLWXdh2kUg
tduGmDrUcB9jV+AoRqWTAqFyhR/KNGKP5GNEaIXiyBpq8kJDjPOUSFR9rkFKx2b4ERvpEYV5
6juEld7JChAfEcdYHZ4q7x8gxpFxJ7JfKZyxe6go2wlVwUVGOpOWkprnWcqPJu5kZDv2wg4Y
Z9wZ+QHDKTzg8/HUG6Nrlp4/nzuvOXmfpbwzWuEfPnSn/LhOeeb7TeqUo3eJDGQPJB6iAfdC
svzYfQ5z5x3fVYevpQjihv7zf2bzO8+r+fx0pLVfcaYtU8qyZoFvM3TLl860jjNwJmqmxSd7
TNn1qZkJXj4Rma87EZn/o4no2hRjfu0p5nPGD/MrjR/PnSDMF08Q5ksmCBMVLl8Msy4mbag4
LGQGwzxOgZ6GLnYCc63xwdMBLIu2jlcUQRcvFfTXuXXyWis4V0r5ia8kR1/sKsi55nG6fQqD
gzqkOp7Rvx6odZwOutBx6zpk1YK7OEB+6TeY/vV60icP+hwpIhTAxUyiScnV9BfCt3VV2yOH
AbbWdJ/x4OlCVzgc1zBZPu0r2F7Vxdl0MFNlcYqYY0Zl8c0e67XMWV5Qu1VeLJED8cNbFRy8
cCluy8ItO9FlIiTr/jrXua5KKp3he5+G0789Vt8gBy0ooe46aN9rv7WcTNGyQX5JFU03zZCZ
NYGCPGn/CdGIL1UJqUOICo/awyjCwswSkyebKJTbw+2qFLAM9/UmE0Vq9D0fhlsRc8wanhn9
Or+qLBpKRDcqf4aBEHpZblGcoY+Ff6hkANvK9znybPLt+HRro2R0RnzE81T2Fm0t67C6lPxf
KtPO6MYfP13rZjqbL9Rx/fFJO6WuyRdMeaXOkS2gnnPx92XmPbUqFktdL09Ni6vPNKxm8arW
1VWgsea5oesSqs3c/k4QVlN94wHiePRZWvUcPWpgtZKhz/WX0DbZ6XeDIwE+w5FNk3k9Nz43
Qb5ubhDmcMWlBKGPMPbVQk8UzkG3PsKOn8go3Q8111YLfVQnIuHRBIlOVL6viB3snndB02kV
LaG1U7JBw6q6/LyZvjCBv3I4PCcUnp/Q/zfRcOZvQrQHBWlxenabPK2wUunuBizRjH6piVaO
lTVMwv9AQ4CfcFwn8OIJjAO0APbiLUtznp3vHA/tfwC1Q0uVLh8AAA==

--a8Wt8u1KmwUX3Y2C--


From MAILER-DAEMON Wed Jun 28 12:12:17 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dQFZh-0001aI-DI
	for mharc-coreutils@gnu.org; Wed, 28 Jun 2017 12:12:17 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:45086)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <rain1@openmailbox.org>) id 1dQFP0-0003v0-8T
	for coreutils@gnu.org; Wed, 28 Jun 2017 12:01:15 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <rain1@openmailbox.org>) id 1dQFOw-0004M1-2l
	for coreutils@gnu.org; Wed, 28 Jun 2017 12:01:14 -0400
Received: from lb1.openmailbox.org ([5.79.108.160]:41249
	helo=mail.openmailbox.org)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <rain1@openmailbox.org>)
	id 1dQFOv-0004KR-Rq
	for coreutils@gnu.org; Wed, 28 Jun 2017 12:01:10 -0400
Received: by mail.openmailbox.org (Postfix, from userid 20002)
	id 7CF4550A619; Wed, 28 Jun 2017 15:53:03 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=openmailbox.org;
	s=openmailbox; t=1498665666;
	bh=vm4UhIbZvzg/BZmOQsQA4vTORGmoGHoEl0QwskCkgHk=;
	h=Date:From:To:Cc:Subject:In-Reply-To:References:From;
	b=nNe+Gh6D1W1FZGcOI1VKFAaYHUb0ufLspVotZ9CKSSSushFZypq4v9XsfVHsdlLiR
	pXyRzHcQsa01pQZQfINHuTddwV+pMCtwEwiB0u6sESyp8gH7+cW9+HeLgBetyFClUO
	vb8IUNptKpB7ZgBQt8/1bYUJGkQXUhdUHR2FBQwI=
Received: from www.openmailbox.org (unknown [10.0.0.4])
	by mail.openmailbox.org (Postfix) with ESMTP id 0F823525346;
	Wed, 28 Jun 2017 15:53:00 +0200 (CEST)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8;
 format=flowed
Date: Wed, 28 Jun 2017 13:53:00 +0000
From: rain1@openmailbox.org
To: =?UTF-8?Q?P=C3=A1draig_Brady?= <P@draigbrady.com>
Cc: coreutils@gnu.org
Subject: Re: null separated ls output option
In-Reply-To: <e3098ec8-7a10-5eb5-69b4-2af2f3b54be6@draigBrady.com>
References: <ab33759f2f081fb3c67b72752f6698e0@openmailbox.org>
	<e3098ec8-7a10-5eb5-69b4-2af2f3b54be6@draigBrady.com>
Message-ID: <05cf8e81e3c775e47bad069d2fee2c77@openmailbox.org>
X-Sender: rain1@openmailbox.org
User-Agent: Roundcube Webmail/1.0.6
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 5.79.108.160
X-Mailman-Approved-At: Wed, 28 Jun 2017 12:12:16 -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, 28 Jun 2017 16:01:15 -0000

On 2017-06-01 04:45, P=C3=A1draig Brady wrote:
> On 31/05/17 15:24, rain1@openmailbox.org wrote:
>> Hello
>>=20
>> Please consider accepting this patch I wrote which adds a new -0=20
>> feature
>> to ls.
>>=20
>> This emits the entries separated by null bytes (similar to
>> /proc/$PID/cmdline) which creates a completely unambiguous and simple
>> output format that doesn't involve any quotation or escaping (like ls=20
>> -1
>> and ls -Q1) by using a separator which cannot occur inside a filename
>> (\0). Inside emacs eshell for example, the output is nicely human
>> readable with the null separator displayed as ^@.
>=20
> Thanks for the patch.
> This was previously discussed as referenced at:
> https://www.gnu.org/software/coreutils/rejected_requests.html#ls
>=20
> cheers,
> P=C3=A1draig.


It says

> Existing tools like find(1) were thought sufficient

but find does not support sorting by date which ls does.

I hope this patch can be reconsidered for inclusion.


From MAILER-DAEMON Wed Jun 28 12:29:27 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dQFqJ-0001Gz-Qd
	for mharc-coreutils@gnu.org; Wed, 28 Jun 2017 12:29:27 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:53160)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dQFqH-0001GV-6n
	for coreutils@gnu.org; Wed, 28 Jun 2017 12:29:26 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dQFqE-0006FV-3S
	for coreutils@gnu.org; Wed, 28 Jun 2017 12:29:25 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:44186)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dQFqD-0006F1-Sv
	for coreutils@gnu.org; Wed, 28 Jun 2017 12:29:22 -0400
Received: from localhost.localdomain (unknown [73.93.154.166])
	(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 9AFBB4B11;
	Wed, 28 Jun 2017 17:29:16 +0100 (IST)
Subject: Re: realpath edge cases
To: Assaf Gordon <assafgordon@gmail.com>
References: <20170625000252.GA17379@gmail.com>
	<24e013fd-e8b8-7dac-d5a0-49e6aaf59174@draigBrady.com>
	<20170628005528.GA12440@gmail.com> <20170628013600.GB12440@gmail.com>
Cc: coreutils@gnu.org
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <2eb20a60-6d7c-cd0a-7581-25fb993700c1@draigBrady.com>
Date: Wed, 28 Jun 2017 09:29:14 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <20170628013600.GB12440@gmail.com>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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: Wed, 28 Jun 2017 16:29:26 -0000

On 27/06/17 18:36, Assaf Gordon wrote:
> On Wed, Jun 28, 2017 at 12:55:29AM +0000, Assaf Gordon wrote:
>> Attached are three patches for realpath's documentation:
>>
>> realpath: improve usage description for --relative-{to,base}
>> doc: fix realpath index entry
>> doc: add 'realpath usage examples' section
> 
> Once again, with the missing attachment.

I'm getting this message repeated 5 times when building coreutils.info:

Negative repeat count does nothing at /usr/share/texinfo/Texinfo/Convert/Line.pm line 124.

Otherwise, it's great.
Please push.

thanks!


From MAILER-DAEMON Wed Jun 28 13:13:32 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dQGWy-0006sM-10
	for mharc-coreutils@gnu.org; Wed, 28 Jun 2017 13:13:32 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:37288)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <962-396-1872@kylheku.com>) id 1dQGWw-0006j2-1X
	for coreutils@gnu.org; Wed, 28 Jun 2017 13:13:30 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <962-396-1872@kylheku.com>) id 1dQGWv-0001c8-4d
	for coreutils@gnu.org; Wed, 28 Jun 2017 13:13:30 -0400
Received: from smtp-out-so.shaw.ca ([64.59.136.137]:59203)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <962-396-1872@kylheku.com>)
	id 1dQGWo-0001MH-NN; Wed, 28 Jun 2017 13:13:22 -0400
Received: from kylheku.com ([70.79.163.252]) by shaw.ca with SMTP
	id QGWbdKjrFyd2DQGWcdz0jl; Wed, 28 Jun 2017 11:13:11 -0600
X-Authority-Analysis: v=2.2 cv=F5wnTupN c=1 sm=1 tr=0
	a=95A0EdhkF1LMGt25d7h1IQ==:117 a=95A0EdhkF1LMGt25d7h1IQ==:17
	a=IkcTkHD0fZMA:10 a=SMorJkV_YP8A:10 a=LWSFodeU3zMA:10 a=s_ZvC2PqAAAA:8
	a=OqQqNFvi-JO7p5TnFGQA:9 a=QEXdDO2ut3YA:10 a=aFptD_jymfZPbHTSTAos:22
Received: from www-data by kylheku.com with local (Exim 4.72)
	(envelope-from <962-396-1872@kylheku.com>)
	id 1dQGWZ-0004Os-VY; Wed, 28 Jun 2017 10:13:08 -0700
To: rain1@openmailbox.org
Subject: Re: null separated ls output option
X-PHP-Originating-Script: 501:rcmail.php
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8;
 format=flowed
Content-Transfer-Encoding: 8bit
Date: Wed, 28 Jun 2017 10:13:07 -0700
From: "Kaz Kylheku (Coreutils)" <962-396-1872@kylheku.com>
Cc: =?UTF-8?Q?P=C3=A1draig_Brady?= <P@draigbrady.com>, coreutils@gnu.org,
	coreutils <coreutils-bounces+962-396-1872=kylheku.com@gnu.org>
In-Reply-To: <05cf8e81e3c775e47bad069d2fee2c77@openmailbox.org>
References: <ab33759f2f081fb3c67b72752f6698e0@openmailbox.org>
	<e3098ec8-7a10-5eb5-69b4-2af2f3b54be6@draigBrady.com>
	<05cf8e81e3c775e47bad069d2fee2c77@openmailbox.org>
Message-ID: <287003b0bcddcfea4646121c414ae0da@mail.kylheku.com>
X-Sender: 962-396-1872@kylheku.com
User-Agent: Roundcube Webmail/0.9.2
X-CMAE-Envelope: MS4wfIqtkUjZaqeu1XN013nn8Id3DRtTwvhFe5YLv6P3pqJ7FeJ/E7P3jNXkLZbsMv62MWaI8/b9vAK+mbNwfeof5eZSw3J/zGzCm1nW+xOqTKiNY/Iqaek+
	NjF5zlO3ClNgoK1QyL86tV09+p5rdySjMUtmKkh5zB4Kn3yUF4swl3EMP4SW6ue9idrzeItBFGZsVPgyYmqRMgUu7QEIkJXBNARZyeiIH59njWh36qMOaGW8
	UVeTl2TAszyiDEnDgRq634ODmWqJYy8gaSDlwZFrJJjc/Lx2UQ8GoDbnICuiLZ6HxtBLZ/ssOxS+D1RvAGyLAg==
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-Received-From: 64.59.136.137
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, 28 Jun 2017 17:13:31 -0000

On 28.06.2017 06:53, rain1@openmailbox.org wrote:
> On 2017-06-01 04:45, Pádraig Brady wrote:
>> On 31/05/17 15:24, rain1@openmailbox.org wrote:
>> Existing tools like find(1) were thought sufficient
> 
> but find does not support sorting by date which ls does.
> 
> I hope this patch can be reconsidered for inclusion.

Rather than the obvious: patching find so that it supports sorting the 
paths
by date, or other properties?

This could be a "-sort <spec>" predicate, which is understood to be like
"-print", except it sends the visited node into a sorting bucket, which
is spilled when find finishes executing.  Sort buckets are identified by
the "<spec>" syntax as a key, so multiple occurrences of the predicate
giving the same <spec> go to the same bucket. Multiple occurrences of 
-sort
with different keys route to different buckets; these buckets can be
later dumped in left to right order, based on the position of the
leftmost predicate which specifies each bucket.

<spec> could use + and - as prefixes for ascending and descending 
(defaulting
to + if omitted) followed by a word which is derived from the space of 
predicates:
atime, ctime, name, iname, ...

Comma separation for compound keys? -sort mtime,name

Something like that.


From MAILER-DAEMON Wed Jun 28 20:49:33 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dQNeH-0000a1-67
	for mharc-coreutils@gnu.org; Wed, 28 Jun 2017 20:49:33 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:39866)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1dQNeF-0000ZL-1P
	for coreutils@gnu.org; Wed, 28 Jun 2017 20:49:31 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <assafgordon@gmail.com>) id 1dQNeB-0006El-0z
	for coreutils@gnu.org; Wed, 28 Jun 2017 20:49:31 -0400
Received: from mail-qk0-x22d.google.com ([2607:f8b0:400d:c09::22d]:34611)
	by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <assafgordon@gmail.com>)
	id 1dQNeA-0006Du-SY
	for coreutils@gnu.org; Wed, 28 Jun 2017 20:49:26 -0400
Received: by mail-qk0-x22d.google.com with SMTP id d78so64599987qkb.1
	for <coreutils@gnu.org>; Wed, 28 Jun 2017 17:49:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to;
	bh=SwmAD4dm2pfhwxKZMqEIYgNdsGiQ5dRb+u50ijZlKrw=;
	b=TBJXgL4LPcFrnq0QhjPU3C42tEzbKVmr8Whh/oGmNc3zNvazCvnpdsPMHKST2uOt1n
	ZqFnsUBWEKkzgCdsDwOpVym/guGRhHvpTBbd58uoLUXEEs7Ovof2FlK1K84EN4fB9cf3
	szmEj31S7TPwdvq3fUOPRWCZmTrcCFpl6rdQQrfgbTy8fGfYvltaKU+xJHnjsAudlb5j
	cMZZnmcJUrJslSAwYbOYMJu6K4ceLWkOD1fcL2zTbgTnSBbLg5cvj6VrW4v9ozQUjDnh
	4HvzlPDiAsistwfNHsstvrdlmQEqKGbo5hzrFj9I46lXESKNu8lMjNH1RcocDV24Q705
	sizw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc
	:content-transfer-encoding:message-id:references:to;
	bh=SwmAD4dm2pfhwxKZMqEIYgNdsGiQ5dRb+u50ijZlKrw=;
	b=ucL/K5sGmRw58zadJKvx9UULzanLQRld3LMzK8D7CP6JFpwsLmOOY2EphlnXXQg7QQ
	hbWGkpwJqSKEwpmxFmABwdv24Or+WyNYMmZfVngpzQS4UnZAiiYpPOmQKsQxzjJOtxSZ
	NVKLhFOxibEKEoJW+8LNZ/rztkkZ3s2Bcs9eUqmSsYEJNE/Ih5u6uR2KhT7mKcb+xRGg
	jZq5rPVLT/QVJBNUYc3ObKEQKe0wwUzwyi/k4x08u2chHlnfOGgmwpE3OQuWmuU/W8Fr
	RDuPc1YbrSfBnYi+E1bCkKlR+M9KcnSzwUNQNZd8VOhvAg/pJ3BFrVRRQ11dTKxax2DU
	oSCw==
X-Gm-Message-State: AKS2vOxMNQFQ2Klk7oahz5zhW9SIumuPRWxrMaLPTZratO/gOmETWCG2
	gVb5zWxWq3m3oA==
X-Received: by 10.55.167.76 with SMTP id q73mr17697108qke.77.1498697364813;
	Wed, 28 Jun 2017 17:49:24 -0700 (PDT)
Received: from [172.31.99.244] (rrcs-24-103-75-91.nyc.biz.rr.com.
	[24.103.75.91]) by smtp.gmail.com with ESMTPSA id
	x55sm3077605qtc.44.2017.06.28.17.49.23
	(version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128);
	Wed, 28 Jun 2017 17:49:24 -0700 (PDT)
Content-Type: text/plain; charset=windows-1252
Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2102\))
Subject: Re: realpath edge cases
From: Assaf Gordon <assafgordon@gmail.com>
In-Reply-To: <2eb20a60-6d7c-cd0a-7581-25fb993700c1@draigBrady.com>
Date: Wed, 28 Jun 2017 20:49:21 -0400
Cc: coreutils@gnu.org
Content-Transfer-Encoding: quoted-printable
Message-Id: <C8F94B85-9171-4885-BBB9-7461A3784ACE@gmail.com>
References: <20170625000252.GA17379@gmail.com>
	<24e013fd-e8b8-7dac-d5a0-49e6aaf59174@draigBrady.com>
	<20170628005528.GA12440@gmail.com>
	<20170628013600.GB12440@gmail.com>
	<2eb20a60-6d7c-cd0a-7581-25fb993700c1@draigBrady.com>
To: =?windows-1252?Q?P=E1draig_Brady?= <P@draigBrady.com>
X-Mailer: Apple Mail (2.2102)
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 2607:f8b0:400d:c09::22d
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, 29 Jun 2017 00:49:32 -0000

Hello P=E1draig,

> On Jun 28, 2017, at 12:29, P=E1draig Brady <P@draigBrady.com> wrote:
>=20
> On 27/06/17 18:36, Assaf Gordon wrote:
>> On Wed, Jun 28, 2017 at 12:55:29AM +0000, Assaf Gordon wrote:
>>> Attached are three patches for realpath's documentation:
> I'm getting this message repeated 5 times when building =
coreutils.info:
>=20
> Negative repeat count does nothing at =
/usr/share/texinfo/Texinfo/Convert/Line.pm line 124.

I'm not able to reproduce this warning (tried with texinfo versions from =
4.8a to 6.4) -
I wonder what triggered it.

Versions older than 6.1 warned about a missing "@menu" item, I'll add =
that before pushing
(despite 6.0 being too old for coreutils, and texinfo>6.1 allow omitting =
the @menu).

-assaf




From MAILER-DAEMON Thu Jun 29 02:32:14 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dQSzu-00018k-EX
	for mharc-coreutils@gnu.org; Thu, 29 Jun 2017 02:32:14 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:34889)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1dQSzp-00016q-5o
	for coreutils@gnu.org; Thu, 29 Jun 2017 02:32:10 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1dQSzn-0000OP-QB
	for coreutils@gnu.org; Thu, 29 Jun 2017 02:32:09 -0400
Received: from mout.kundenserver.de ([212.227.17.10]:59014)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <mail@bernhard-voelker.de>)
	id 1dQSzi-0000I7-4p; Thu, 29 Jun 2017 02:32:02 -0400
Received: from [192.168.101.10] ([91.12.174.113]) by mrelayeu.kundenserver.de
	(mreue104 [212.227.15.183]) with ESMTPSA (Nemesis) id
	0MQfKn-1dJ8KB1ROv-00U6pk; Thu, 29 Jun 2017 08:31:50 +0200
Subject: Re: null separated ls output option
To: "Kaz Kylheku (Coreutils)" <962-396-1872@kylheku.com>, rain1@openmailbox.org
References: <ab33759f2f081fb3c67b72752f6698e0@openmailbox.org>
	<e3098ec8-7a10-5eb5-69b4-2af2f3b54be6@draigBrady.com>
	<05cf8e81e3c775e47bad069d2fee2c77@openmailbox.org>
	<287003b0bcddcfea4646121c414ae0da@mail.kylheku.com>
Cc: coreutils <coreutils-bounces+962-396-1872=kylheku.com@gnu.org>,
	coreutils@gnu.org, "bug-findutils@gnu.org" <bug-findutils@gnu.org>
From: Bernhard Voelker <mail@bernhard-voelker.de>
Message-ID: <00f42267-3396-f618-3966-aa5054a2e5c5@bernhard-voelker.de>
Date: Thu, 29 Jun 2017 08:31:48 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.6.0
MIME-Version: 1.0
In-Reply-To: <287003b0bcddcfea4646121c414ae0da@mail.kylheku.com>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Provags-ID: V03:K0:Czjbm+MbQXae2Dt0qV27R31WQ1RNOW2zaVyRvc0QU7Mv0xWf8KH
	frH+9MkrH009RkwNxZ+auPVAihpeV6/ctjoLs+egmwkF7BMUukFpFZMNYp56WyeC5L8D25K
	/EQuY0Hz6cag0HehKcN64BEACPHFrJO4E2qi4HralHSuyZZYKjsJtZSchmRYmOdA+M3y7di
	LM5PWvigfBu9zgjBH1k4w==
X-UI-Out-Filterresults: notjunk:1;V01:K0:f3caO5NHO48=:NPAdOBX9HKrtS4hO8hWRTS
	y7uuwC3BnIDR6qoekkB6ykWGn9l701ZfV8GBHdYTmoM2OL9EzftZwy2osazfFKD6kE1ZgrfK9
	GjUB+mUUbOc8LlyyqvfNaVgJjsnrbbDwO5ud7GCsjBftilQ8C8ugky/qgGRfF8Gpgzysn4nJ8
	T8T42CtFF40j2auLtOQtgrqIZScq3XtF/87Lgw0ZL2QntRYFq9XFIFhr2aDnMobll53UVBncP
	ToSmFgbZiJdl23x2KNbA8yZGUywLoQh/G+5VInfj+gW+pVK58n0E/+bKpgKW6NU/L7eQsOShU
	Q8a4u3hg7NqzoqIcF76pKMYo0+iqhARsPfaww+QipxryV0Cl/7MzoC6txw8eZl9HtwgI4XrOO
	yDM2c10VXw2IAyqe1kbYZUOVxXZu+AXq+0nlZPsiDf1Y5bxLXCX3+QImaR1D5LtfV2f1o47bZ
	z3yAbZvYSlTTWlMjZwp7BbIcAdDhc2kEwdl5JLimfMpphOdYX37i//gHnPV1tC6mGT80WwQYC
	UC4Ntc3pYN83tpadpoFlYnJiLB6oCdu667Y4LGfkr2Q3lnlzhPqDEuap+Mcxj04oaYEjpwr39
	Ly5bVeC0xXoCiSourBefoVWxv4EJQRpGsd3DGzakO4UGaX1p8FECf0Feq2R/m4zkO+TXS6UtW
	tlhHFAf5g4vfMd26GpffKWy5RwyT8GFfnGglTdB4D+RaR0URm29Y7zXPNS+vW5vIzxIATo05Y
	eZHSMAp/QQn1+9E/
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 212.227.17.10
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, 29 Jun 2017 06:32:10 -0000

[adding findutils]
First of all, find(1) is maintained in the GNU findutils project,
not in GNU coreutils.

Redirected from:
  http://lists.gnu.org/archive/html/coreutils/2017-06/msg00049.html

On 06/28/2017 07:13 PM, Kaz Kylheku (Coreutils) wrote:
> On 28.06.2017 06:53, rain1@openmailbox.org wrote:
>> On 2017-06-01 04:45, Pádraig Brady wrote:
>>> On 31/05/17 15:24, rain1@openmailbox.org wrote:
>>> Existing tools like find(1) were thought sufficient
>>
>> but find does not support sorting by date which ls does.
>>
>> I hope this patch can be reconsidered for inclusion.
> 
> Rather than the obvious: patching find so that it supports sorting the 
> paths
> by date, or other properties?
> 
> This could be a "-sort <spec>" predicate, which is understood to be like
> "-print", except it sends the visited node into a sorting bucket, which
> is spilled when find finishes executing.  Sort buckets are identified by
> the "<spec>" syntax as a key, so multiple occurrences of the predicate
> giving the same <spec> go to the same bucket. Multiple occurrences of 
> -sort
> with different keys route to different buckets; these buckets can be
> later dumped in left to right order, based on the position of the
> leftmost predicate which specifies each bucket.
> 
> <spec> could use + and - as prefixes for ascending and descending 
> (defaulting
> to + if omitted) followed by a word which is derived from the space of 
> predicates:
> atime, ctime, name, iname, ...
> 
> Comma separation for compound keys? -sort mtime,name
> 
> Something like that.

I think the GNU toolbox already gives you enough flexibility to support
these edgy use cases, e.g. sorting by file size:

  find . -printf "%s/%p\0" \
    | sort -zt '/' -k1,1n  \
    | sed -z 's,^.*/,,'

The above find(1) prints the items separated by '\0', printing its
size %s and name %p separated by '/' - the only other character
apart from '\0' which can not occur in a file name.
Then, sort(1) sorts according to the first column.
Finally, sed strips off the file size and the decorating first slash.

The same works e.g. for mtime using the format string "%T@/%p\0", and
so on.

Given that sorting is not find(1) is supposed to do in the first
place, and that adding such feature would add a big amount of code
(which needs to be written and also maintained by someone), I think
the above alternative is sufficient.

Have a nice day,
Berny


From MAILER-DAEMON Thu Jun 29 02:48:38 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dQTFm-0005Te-Ca
	for mharc-coreutils@gnu.org; Thu, 29 Jun 2017 02:48:38 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:38804)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dQTFj-0005TD-HT
	for coreutils@gnu.org; Thu, 29 Jun 2017 02:48:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1dQTFg-0000Pz-F8
	for coreutils@gnu.org; Thu, 29 Jun 2017 02:48:35 -0400
Received: from mail.magicbluesmoke.com ([82.195.144.49]:39164)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <P@draigBrady.com>) id 1dQTFg-0000PS-91
	for coreutils@gnu.org; Thu, 29 Jun 2017 02:48:32 -0400
Received: from localhost.localdomain (unknown [73.93.155.86])
	(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 798CD9982;
	Thu, 29 Jun 2017 07:48:29 +0100 (IST)
Subject: Re: realpath edge cases
To: Assaf Gordon <assafgordon@gmail.com>
References: <20170625000252.GA17379@gmail.com>
	<24e013fd-e8b8-7dac-d5a0-49e6aaf59174@draigBrady.com>
	<20170628005528.GA12440@gmail.com> <20170628013600.GB12440@gmail.com>
	<2eb20a60-6d7c-cd0a-7581-25fb993700c1@draigBrady.com>
	<C8F94B85-9171-4885-BBB9-7461A3784ACE@gmail.com>
Cc: coreutils@gnu.org
From: =?UTF-8?Q?P=c3=a1draig_Brady?= <P@draigBrady.com>
Message-ID: <21a83313-a986-a02f-bd08-8a2db1dd31c9@draigBrady.com>
Date: Wed, 28 Jun 2017 23:48:27 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.8.0
MIME-Version: 1.0
In-Reply-To: <C8F94B85-9171-4885-BBB9-7461A3784ACE@gmail.com>
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
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, 29 Jun 2017 06:48:36 -0000

On 28/06/17 17:49, Assaf Gordon wrote:
> Hello P=E1draig,
>=20
>> On Jun 28, 2017, at 12:29, P=E1draig Brady <P@draigBrady.com> wrote:
>>
>> On 27/06/17 18:36, Assaf Gordon wrote:
>>> On Wed, Jun 28, 2017 at 12:55:29AM +0000, Assaf Gordon wrote:
>>>> Attached are three patches for realpath's documentation:
>> I'm getting this message repeated 5 times when building coreutils.info=
:
>>
>> Negative repeat count does nothing at /usr/share/texinfo/Texinfo/Conve=
rt/Line.pm line 124.
>=20
> I'm not able to reproduce this warning (tried with texinfo versions fro=
m 4.8a to 6.4) -
> I wonder what triggered it.

Eek, sorry I should have said I used texinfo-6.1-4.fc25.x86_64

> Versions older than 6.1 warned about a missing "@menu" item, I'll add t=
hat before pushing
> (despite 6.0 being too old for coreutils, and texinfo>6.1 allow omittin=
g the @menu).

The warning is caused by the @exdents (which occur nowhere else in the fi=
le).
The code producing the warning is:

      if ($line->{'indent_length'}) {
        $result .=3D ' ' x ($line->{'indent_length'} - $line->{'counter'}=
);
        print STDERR "INDENT.L($line->{'counter'})\n" if ($line->{'DEBUG'=
});
      }

So 'counter' must be more that 'indent_length' which must be non zero.
It's only a warning so it doesn't matter really.
I'll leave it up to you if you want to leave the @exdents in place

cheers,
P=E1draig


From MAILER-DAEMON Thu Jun 29 13:17:37 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dQd4T-0002p1-LJ
	for mharc-coreutils@gnu.org; Thu, 29 Jun 2017 13:17:37 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:51132)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <962-396-1872@kylheku.com>) id 1dQd4R-0002nr-Pv
	for coreutils@gnu.org; Thu, 29 Jun 2017 13:17:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <962-396-1872@kylheku.com>) id 1dQd4Q-0007lU-Tq
	for coreutils@gnu.org; Thu, 29 Jun 2017 13:17:35 -0400
Received: from smtp-out-so.shaw.ca ([64.59.136.137]:47076)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32)
	(Exim 4.71) (envelope-from <962-396-1872@kylheku.com>)
	id 1dQd4M-0007hU-Dc; Thu, 29 Jun 2017 13:17:30 -0400
Received: from kylheku.com ([70.79.163.252]) by shaw.ca with SMTP
	id Qd4AdRaIeyd2DQd4Bd3RXI; Thu, 29 Jun 2017 11:17:20 -0600
X-Authority-Analysis: v=2.2 cv=F5wnTupN c=1 sm=1 tr=0
	a=95A0EdhkF1LMGt25d7h1IQ==:117 a=95A0EdhkF1LMGt25d7h1IQ==:17
	a=IkcTkHD0fZMA:10 a=SMorJkV_YP8A:10 a=LWSFodeU3zMA:10 a=mDV3o1hIAAAA:8
	a=TbP2ikDgNyh6A2eyinkA:9 a=QEXdDO2ut3YA:10 a=ezPy8EHsResA:10
	a=_FVE-zBwftR9WsbkzFJk:22
Received: from www-data by kylheku.com with local (Exim 4.72)
	(envelope-from <962-396-1872@kylheku.com>)
	id 1dQd48-0002ua-Pp; Thu, 29 Jun 2017 10:17:16 -0700
To: Bernhard Voelker <mail@bernhard-voelker.de>
Subject: Re: null separated ls output option
X-PHP-Originating-Script: 501:rcmail.php
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8;
 format=flowed
Content-Transfer-Encoding: quoted-printable
Date: Thu, 29 Jun 2017 10:17:16 -0700
From: "Kaz Kylheku (Coreutils)" <962-396-1872@kylheku.com>
Cc: rain1@openmailbox.org, bug-findutils@gnu.org, coreutils@gnu.org
In-Reply-To: <00f42267-3396-f618-3966-aa5054a2e5c5@bernhard-voelker.de>
References: <ab33759f2f081fb3c67b72752f6698e0@openmailbox.org>
	<e3098ec8-7a10-5eb5-69b4-2af2f3b54be6@draigBrady.com>
	<05cf8e81e3c775e47bad069d2fee2c77@openmailbox.org>
	<287003b0bcddcfea4646121c414ae0da@mail.kylheku.com>
	<00f42267-3396-f618-3966-aa5054a2e5c5@bernhard-voelker.de>
Message-ID: <70a2d904f641b87dff3c5ecd8cc85e62@mail.kylheku.com>
X-Sender: 962-396-1872@kylheku.com
User-Agent: Roundcube Webmail/0.9.2
X-CMAE-Envelope: MS4wfJBePfxPC6gRjMiFPEORimc1lZgrb92Ic1cUUXwpG4ggTiNRRcc9/r1f1pJuzyza4jU2xuSMHo5EFlaF6ChvvWL0gfWfXVkcbL8j3GUX51jR9KNWojgF
	rsOOKoWD8P0HYNa07jTJehrEK6zBpPD9gsJGsZKSWk/WQ5/WbSC+gdpoLTtx1cShghmksPxb4BaXWI2Lhmgx45ZAnf08VG/oWPh5hca1wBRd4uHIG970j3w+
	EjS86O75ks02flK2L+KIvGexcgtOXS55kRtM0X9x4Hc=
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy]
X-Received-From: 64.59.136.137
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, 29 Jun 2017 17:17:36 -0000

On 28.06.2017 23:31, Bernhard Voelker wrote:
> [adding findutils]
> First of all, find(1) is maintained in the GNU findutils project,
> not in GNU coreutils.
>=20
> Redirected from:
>   http://lists.gnu.org/archive/html/coreutils/2017-06/msg00049.html
>=20
> On 06/28/2017 07:13 PM, Kaz Kylheku (Coreutils) wrote:
> > [ snip ... my elaborate proposal for a find -sort predicate ]
>=20
> I think the GNU toolbox already gives you enough flexibility to support
> these edgy use cases, e.g. sorting by file size:
>=20
>   find . -printf "%s/%p\0" \
>     | sort -zt '/' -k1,1n  \
>     | sed -z 's,^.*/,,'

That is great. So there is nothing do here, basically; all the better.

No null-terminated patch for ls is required; GNU sort can sort the
specially formatted null-terminated output from find.

See; it pays to have a discussion about the requirements
before whipping up code.



From MAILER-DAEMON Thu Jun 29 13:26:09 2017
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1dQdCj-00084f-Fn
	for mharc-coreutils@gnu.org; Thu, 29 Jun 2017 13:26:09 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:53362)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1dQdCh-00084Z-7v
	for coreutils@gnu.org; Thu, 29 Jun 2017 13:26:08 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1dQdCc-0003Xi-9J
	for coreutils@gnu.org; Thu, 29 Jun 2017 13:26:07 -0400
Received: from mout.kundenserver.de ([212.227.17.24]:57270)
	by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16)
	(Exim 4.71) (envelope-from <mail@bernhard-voelker.de>)
	id 1dQdCb-0003XG-U9; Thu, 29 Jun 2017 13:26:02 -0400
Received: from [192.168.101.10] ([91.12.174.113]) by mrelayeu.kundenserver.de
	(mreue101 [212.227.15.183]) with ESMTPSA (Nemesis) id
	0Lch0h-1e7umH3wr1-00k92a; Thu, 29 Jun 2017 19:25:51 +0200
Subject: Re: null separated ls output option
To: "Kaz Kylheku (Coreutils)" <962-396-1872@kylheku.com>
References: <ab33759f2f081fb3c67b72752f6698e0@openmailbox.org>
	<e3098ec8-7a10-5eb5-69b4-2af2f3b54be6@draigBrady.com>
	<05cf8e81e3c775e47bad069d2fee2c77@openmailbox.org>
	<287003b0bcddcfea4646121c414ae0da@mail.kylheku.com>
	<00f42267-3396-f618-3966-aa5054a2e5c5@bernhard-voelker.de>
	<70a2d904f641b87dff3c5ecd8cc85e62@mail.kylheku.com>
Cc: bug-findutils@gnu.org, rain1@openmailbox.org, coreutils@gnu.org
From: Bernhard Voelker <mail@bernhard-voelker.de>
Message-ID: <098c6921-6a68-92a0-5946-62dc705244cb@bernhard-voelker.de>
Date: Thu, 29 Jun 2017 19:25:49 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101
	Thunderbird/45.6.0
MIME-Version: 1.0
In-Reply-To: <70a2d904f641b87dff3c5ecd8cc85e62@mail.kylheku.com>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:9wR/43FpqZuJY/eeCb6fX8yyRk5XoE1OYELAy3MPoNTBWju9ksh
	3+qoodk3lehPA/A0sBRzSqVAHPQoo7QB0WzQ2CdI2dJATYKa775zCjTiPN7Ci2XoCkcNAp5
	P0hzdqGhKKozzDFUiEhjspQgUJjOCS/Cqdx+bNFcsvVYiZbICVKKPuBxRe3zdFTzvJbHHJW
	SCfWsGaWTsgtsamSUBklQ==
X-UI-Out-Filterresults: notjunk:1;V01:K0:2rCJG/vGISo=:bwlr8ZcUpKuXhBKUYcSIFb
	RPfEzXAuwXoITc0+0EZwFQXvFB2D5UN+SpWhiqVblGRxauXffEwsBqPgfb/SGPXCXodoA8Yq+
	6hCCav0oEYE0uSsui2PmatbsFJZyYBgtOqNkOsRiMery4Kr4UCv40QjYdDfQKgwXFTHqZnjR+
	WFnAE+1qBM4bq7h77ZQijds0d/pDI1+/X8bQSPPu6nd7t8tq+hdGFphGpTu+ZEX+xd927AOlF
	4FQTt0hqcd1rZWm6grqQEkKt238UUWN8UYtGoALF9VDvnaxMH3i0rnvFmzpYPsoM8Qf2+WDbF
	HpLN6BdQMuOw7A+D9w19VqGHgZMjvWHL3Fl3gfbGnBDPuPfAje5xgBkIAE3MfCF+HkJppzl/X
	21i7nwKtfKrS7via9oG43gFpTHZy11hF2mNUz3R2XKPWRjhh7cWtMf3ZhvJtc5F7BdOezsxa6
	WNPa1KhT8e0i6yXN7GlOHJUWPBEXB2ymuyQo3qacT2ERWkt2qC9o719SF67DFBUXTEzitp4oQ
	mn/+9z86ZvPF6MnCWDcUGX4OMEk0foJ/itwd15epruMeN0X59qeaTnniQuvXjvy3Tl3pbX9oR
	MQ8PBfxFldtfjXqTyLAh8jTZ9QLFYFpKxRxW+xswWM6HtRiXKYJ4yLNw2PzU1/tgvcB3mvpSG
	f5K/5NQaLyITWIUDskv1w0QK7umw/zYJQOQBFbfGdLXwBvBeKE15W1IxKG8pXQWNdEzo5MiZm
	O6PJHVuufFqV1bz+
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic]
	[fuzzy]
X-Received-From: 212.227.17.24
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, 29 Jun 2017 17:26:08 -0000

On 06/29/2017 07:17 PM, Kaz Kylheku (Coreutils) wrote:
> On 28.06.2017 23:31, Bernhard Voelker wrote:
>> I think the GNU toolbox already gives you enough flexibility to support
>> these edgy use cases, e.g. sorting by file size:
>>
>>   find . -printf "%s/%p\0" \
>>     | sort -zt '/' -k1,1n  \
>>     | sed -z 's,^.*/,,'
> 
> That is great. So there is nothing do here, basically; all the better.
> 
> No null-terminated patch for ls is required; GNU sort can sort the
> specially formatted null-terminated output from find.
> 
> See; it pays to have a discussion about the requirements
> before whipping up code.

Thanks, maybe I can find a nice place in find.1 or find.texi
to add such an example ... wait - there is already a similar
example:

https://www.gnu.org/software/findutils/manual/html_node/find_html/Updating-A-Timestamp-File.html#Updating-A-Timestamp-File

yet that doesn't work with arbitrary file names.
I have to think about it.

Have a nice day,
Berny


