From MAILER-DAEMON Sun Jul 01 09:23:19 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SlK7T-0007yC-Qg
	for mharc-coreutils@gnu.org; Sun, 01 Jul 2012 09:23:19 -0400
Received: from eggs.gnu.org ([208.118.235.92]:42737)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <stevenlowson@gmail.com>) id 1SlK7R-0007y5-HQ
	for coreutils@gnu.org; Sun, 01 Jul 2012 09:23:18 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <stevenlowson@gmail.com>) id 1SlK7P-00007s-Sq
	for coreutils@gnu.org; Sun, 01 Jul 2012 09:23:17 -0400
Received: from mail-we0-f169.google.com ([74.125.82.169]:42765)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <stevenlowson@gmail.com>) id 1SlK7P-00007V-Il
	for coreutils@gnu.org; Sun, 01 Jul 2012 09:23:15 -0400
Received: by wefh52 with SMTP id h52so3819895wef.0
	for <coreutils@gnu.org>; Sun, 01 Jul 2012 06:23:12 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=message-id:date:from:user-agent:mime-version:to:cc:subject
	:references:in-reply-to:content-type:content-transfer-encoding;
	bh=xbwAc7Lw6BfA077b9rk4Y+fWmIJWy4geU/MNng7L7Ag=;
	b=Dd8307TOTgM/CubKgg+9hGKUnq/Lkdn30A+hk7pZSi0dAAnrFFepYHY5TfM4QPgD9m
	znLOFs+iEeEzlpLZ1MhyTzIX32EyC/6FJ3nBHHtD/dSsHHgRuDL0850ng6t+IAumyySS
	cYGcheUYPigm/7ibzPeXb/AE/XjRP8dvPoLbDLCtAjRqUYuuwKuzQxbK1BIfVWjTLBdH
	fhslaigZVZRgIw9jJO7lz9864L7RgXcvzt2+ndegK2Ks/Cn/TPM7XYivS54CTTGcgw3Z
	BL5QqnedyPnHvsMNvR5jygecrEZ1ottPNGc1xw9Q91Xd/7RLnIW9VKLvihKvIP3ojQEL
	WeHw==
Received: by 10.180.100.2 with SMTP id eu2mr10542611wib.10.1341148992490;
	Sun, 01 Jul 2012 06:23:12 -0700 (PDT)
Received: from [192.168.0.2]
	(cpc6-dund13-2-0-cust209.sgyl.cable.virginmedia.com.
	[94.174.148.210])
	by mx.google.com with ESMTPS id eb8sm18660362wib.11.2012.07.01.06.23.10
	(version=SSLv3 cipher=OTHER); Sun, 01 Jul 2012 06:23:11 -0700 (PDT)
Message-ID: <4FF04F39.1090206@gmail.com>
Date: Sun, 01 Jul 2012 14:23:05 +0100
From: Steven Lowson <stevenlowson@gmail.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:13.0) Gecko/20120616 Thunderbird/13.0.1
MIME-Version: 1.0
To: Eric Blake <eblake@redhat.com>
Subject: Re: Change to rmdir flag?
References: <4FECDF51.7060908@gmail.com> <4FECE5C1.9010905@redhat.com>
In-Reply-To: <4FECE5C1.9010905@redhat.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 74.125.82.169
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 01 Jul 2012 13:23:18 -0000

Hi Eric,

I did not know you could abbreviate unambiguous flags thanks for the tip.

Steve

On 29/06/12 00:16, Eric Blake wrote:
> On 06/28/2012 04:48 PM, Steven Lowson wrote:
>> Hi Guys,
>>
>> I would like to propose a change to one of the rmdir flags specifically
>> --ignore-fail-on-non-empty to something a bit more succinct. A more
>> suitable name would be -force or -f.
>
> Thanks for the suggestion.  However, we're unlikely to burn a short
> letter without existing precedence in some other implementation, since
> that risks collisions with future standardization.  But do you realize
> that long options can be abbreviated if the abbreviation is unambiguous?
>   Therefore, 'rmdir --i' is equivalent to 'rmdir
> --ignore-fail-on-non-empty', which is almost as good as your proposed
> 'rmdir -f' and shorter than your proposed 'rmdir --force'.
>



From MAILER-DAEMON Mon Jul 02 14:47:54 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sllf7-0001bL-Vw
	for mharc-coreutils@gnu.org; Mon, 02 Jul 2012 14:47:53 -0400
Received: from eggs.gnu.org ([208.118.235.92]:52274)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1Sllf6-0001aj-BJ
	for coreutils@gnu.org; Mon, 02 Jul 2012 14:47:53 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1Sllf4-00070I-Nm
	for coreutils@gnu.org; Mon, 02 Jul 2012 14:47:51 -0400
Received: from mx1.redhat.com ([209.132.183.28]:36681)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1Sllf4-000705-F8
	for coreutils@gnu.org; Mon, 02 Jul 2012 14:47:50 -0400
Received: from int-mx12.intmail.prod.int.phx2.redhat.com
	(int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q62IlkPo019741
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 2 Jul 2012 14:47:47 -0400
Received: from pb-n5110.homenet.telecomitalia.it (ovpn-113-81.phx2.redhat.com
	[10.3.113.81])
	by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q62IliUh007756; Mon, 2 Jul 2012 14:47:45 -0400
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
To: coreutils@gnu.org
Subject: [PATCH] maint: sc_prohibit_fail_0: update a stale comment
Date: Mon,  2 Jul 2012 20:47:32 +0200
Message-Id: <1341254852-17425-1-git-send-email-P@draigBrady.com>
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 02 Jul 2012 18:47:53 -0000

* cfg.mk (sc_prohibit_fail_0): Following on from
commit v8.0-79-g71c2f88, update the comment to match.
---
 cfg.mk |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index 36458a4..ef8a2c8 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -263,9 +263,7 @@ sc_prohibit_emacs__indent_tabs_mode__setting:
 	halt='use of emacs indent-tabs-mode: setting'			\
 	  $(_sc_search_regexp)
 
-# Ensure that each file that contains fail=1 also contains fail=0.
-# Otherwise, setting file=1 in the environment would make tests fail
-# unexpectedly.
+# Ensure that tests don't include a redundant fail=0.
 sc_prohibit_fail_0:
 	@prohibit='\<fail=0\>'						\
 	halt='fail=0 initialization'					\
-- 
1.7.6.4



From MAILER-DAEMON Tue Jul 03 14:19:29 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sm7hB-0006cO-Jw
	for mharc-coreutils@gnu.org; Tue, 03 Jul 2012 14:19:29 -0400
Received: from eggs.gnu.org ([208.118.235.92]:45025)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Sm7h4-0006b7-Bw
	for coreutils@gnu.org; Tue, 03 Jul 2012 14:19:27 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Sm7h2-0007t3-BV
	for coreutils@gnu.org; Tue, 03 Jul 2012 14:19:21 -0400
Received: from mx.meyering.net ([88.168.87.75]:48265)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Sm7h1-0007sl-Tp
	for coreutils@gnu.org; Tue, 03 Jul 2012 14:19:20 -0400
Received: from rho.meyering.net (rho.meyering.net [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 49D7B60098
	for <coreutils@gnu.org>; Tue,  3 Jul 2012 20:19:17 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH 2/2] maint: add syntax-check rule to help avoid misuse of
	EXIT_FAILURE
Date: Tue, 03 Jul 2012 20:19:17 +0200
Message-ID: <87fw984sii.fsf@rho.meyering.net>
Lines: 118
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 03 Jul 2012 18:19:27 -0000

Inspired by the EXIT_FAILURE problem P=E1draig spotted
and that Paul just fixed, I wrote a new syntax-check rule
to help avoid that sort of problem.  The following programs
must avoid most new uses of EXIT_FAILURE:

  chroot.c
  env.c
  expr.c
  ls.c
  nice.c
  nohup.c
  printenv.c
  setuidgid.c
  stdbuf.c
  system.h
  timeout.c
  tty.c

This new syntax-check rule caught a minor problem in
our helper setuidgid (not installed) and I fixed another
minor problem in the vicinity (dead code on error path).

Here are the two patches:

>From fc895b0772c80dfcb099325788478b965bae2196 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Tue, 3 Jul 2012 20:13:09 +0200
Subject: [PATCH 1/2] maint: fix minor bugs in helper program, setuidgid

* src/setuidgid.c (main): Fix two error-before-usage calls not to exit.
Exit with status SETUIDGID_FAILURE (not EXIT_FAILURE) consistently.
---
 src/setuidgid.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/setuidgid.c b/src/setuidgid.c
index 39044ce..4dc055b 100644
--- a/src/setuidgid.c
+++ b/src/setuidgid.c
@@ -107,7 +107,7 @@ main (int argc, char **argv)
                   {
                     if (! (xstrtoul (gr, &ptr, 10, &tmp_ul, NULL) =3D=3D L=
ONGINT_OK
                            && tmp_ul <=3D GID_T_MAX))
-                      error (EXIT_FAILURE, 0, _("invalid group %s"),
+                      error (SETUIDGID_FAILURE, 0, _("invalid group %s"),
                              quote (gr));
                     if (n_gids =3D=3D n_gids_allocated)
                       gids =3D X2NREALLOC (gids, &n_gids_allocated);
@@ -159,8 +159,7 @@ main (int argc, char **argv)
         pwd =3D getpwnam (user);
         if (pwd =3D=3D NULL)
           {
-            error (SETUIDGID_FAILURE, errno,
-                   _("unknown user-ID: %s"), quote (user));
+            error (0, errno, _("unknown user-ID: %s"), quote (user));
             usage (SETUIDGID_FAILURE);
           }
         uid =3D pwd->pw_uid;
@@ -170,7 +169,7 @@ main (int argc, char **argv)
         pwd =3D getpwuid (uid);
         if (pwd =3D=3D NULL)
           {
-            error (SETUIDGID_FAILURE, errno,
+            error (0, errno,
                    _("to use user-ID %s you need to use -g too"), quote (u=
ser));
             usage (SETUIDGID_FAILURE);
           }
@@ -181,8 +180,8 @@ main (int argc, char **argv)
       {
         int n =3D xgetgroups (pwd->pw_name, pwd->pw_gid, &gids);
         if (n <=3D 0)
-          error (EXIT_FAILURE, errno, _("failed to get groups for user %s"=
),
-                 quote (pwd->pw_name));
+          error (SETUIDGID_FAILURE, errno,
+                 _("failed to get groups for user %s"), quote (pwd->pw_nam=
e));
         n_gids =3D n;
       }

--
1.7.11.1.104.ge7b44f1


>From 74427c76d7be2a5522a8d24e29bfa63c299dbbce Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Tue, 3 Jul 2012 20:14:56 +0200
Subject: [PATCH 2/2] maint: add syntax-check rule to help avoid misuse of
 EXIT_FAILURE

* cfg.mk (sc_some_programs_must_avoid_exit_failure): New rule,
to help us avoid using EXIT_FAILURE in programs like sort, ls, nohup,
timeout, env, etc. that use different exit codes in many cases.
---
 cfg.mk | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/cfg.mk b/cfg.mk
index ef8a2c8..6620eaf 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -319,6 +319,16 @@ sc_prohibit_test_backticks:
 	halt=3D'use $$(...), not `...` in tests/'				\
 	  $(_sc_search_regexp)

+# Programs like sort, ls, expr use PROG_FAILURE in place of EXIT_FAILURE.
+# Others, use the EXIT_CANCELED, EXIT_ENOENT, etc. macros defined in syste=
m.h.
+# In those programs, ensure that EXIT_FAILURE is not used by mistake.
+sc_some_programs_must_avoid_exit_failure:
+	@grep -nw EXIT_FAILURE						\
+	    $$(git grep -El '[^T]_FAILURE|EXIT_CANCELED' src)		\
+	  | grep -vE '=3D EXIT_FAILURE|exit \(.* \?' | grep .		\
+	    && { echo '$(ME): do not use EXIT_FAILURE in the above'	\
+		  1>&2; exit 1; } || :
+
 # Exempt the contents of any usage function from the following.
 _continued_string_col_1 =3D \
 s/^usage .*?\n}//ms;/\\\n\w/ and print ("$$ARGV\n"),$$e=3D1;END{$$e||=3D0;=
exit $$e}
--
1.7.11.1.104.ge7b44f1


From MAILER-DAEMON Tue Jul 03 19:01:18 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SmC5u-0001hv-UY
	for mharc-coreutils@gnu.org; Tue, 03 Jul 2012 19:01:18 -0400
Received: from eggs.gnu.org ([208.118.235.92]:53999)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SmC5s-0001hp-J4
	for coreutils@gnu.org; Tue, 03 Jul 2012 19:01:17 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SmC5q-0002qB-Rz
	for coreutils@gnu.org; Tue, 03 Jul 2012 19:01:16 -0400
Received: from mx1.redhat.com ([209.132.183.28]:42247)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SmC5q-0002pa-JD
	for coreutils@gnu.org; Tue, 03 Jul 2012 19:01:14 -0400
Received: from int-mx01.intmail.prod.int.phx2.redhat.com
	(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q63N1Ags005254
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 3 Jul 2012 19:01:11 -0400
Received: from [10.3.113.77] (ovpn-113-77.phx2.redhat.com [10.3.113.77])
	by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id q63N0xqC025484
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 3 Jul 2012 19:01:07 -0400
Message-ID: <4FF379AB.6020608@draigBrady.com>
Date: Wed, 04 Jul 2012 01:00:59 +0200
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
Subject: Re: [PATCH 2/2] maint: add syntax-check rule to help avoid misuse
	of EXIT_FAILURE
References: <87fw984sii.fsf@rho.meyering.net>
In-Reply-To: <87fw984sii.fsf@rho.meyering.net>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=ISO-8859-1
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id
	q63N1Ags005254
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 03 Jul 2012 23:01:17 -0000

On 07/03/2012 08:19 PM, Jim Meyering wrote:
> Inspired by the EXIT_FAILURE problem P=E1draig spotted
> and that Paul just fixed, I wrote a new syntax-check rule
> to help avoid that sort of problem.  The following programs
> must avoid most new uses of EXIT_FAILURE:
>=20
>   chroot.c
>   env.c
>   expr.c
>   ls.c
>   nice.c
>   nohup.c
>   printenv.c
>   setuidgid.c
>   stdbuf.c
>   system.h
>   timeout.c
>   tty.c
>=20
> This new syntax-check rule caught a minor problem in
> our helper setuidgid (not installed) and I fixed another
> minor problem in the vicinity (dead code on error path).
>=20
> Here are the two patches:

Nice one.
That check is certainly warranted.
Both patches look fine from a quick glance.

cheers,
P=E1draig.


From MAILER-DAEMON Wed Jul 04 02:36:48 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SmJCi-0005BG-Oc
	for mharc-coreutils@gnu.org; Wed, 04 Jul 2012 02:36:48 -0400
Received: from eggs.gnu.org ([208.118.235.92]:55130)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SmJCg-0005AU-BF
	for coreutils@gnu.org; Wed, 04 Jul 2012 02:36:47 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SmJCe-0003pc-Qm
	for coreutils@gnu.org; Wed, 04 Jul 2012 02:36:45 -0400
Received: from mx.meyering.net ([88.168.87.75]:50075)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SmJCe-0003or-Ix
	for coreutils@gnu.org; Wed, 04 Jul 2012 02:36:44 -0400
Received: from rho.meyering.net (rho.meyering.net [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id A9BBE60489;
	Wed,  4 Jul 2012 08:36:42 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Subject: Re: [PATCH 2/2] maint: add syntax-check rule to help avoid misuse of
	EXIT_FAILURE
In-Reply-To: <4FF379AB.6020608@draigBrady.com> (=?iso-8859-1?Q?=22P=E1drai?=
	=?iso-8859-1?Q?g?= Brady"'s message of
	"Wed, 04 Jul 2012 01:00:59 +0200")
References: <87fw984sii.fsf@rho.meyering.net> <4FF379AB.6020608@draigBrady.com>
Date: Wed, 04 Jul 2012 08:36:42 +0200
Message-ID: <87vci42ft1.fsf@rho.meyering.net>
Lines: 31
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 04 Jul 2012 06:36:47 -0000

P=E1draig Brady wrote:
> On 07/03/2012 08:19 PM, Jim Meyering wrote:
>> Inspired by the EXIT_FAILURE problem P=E1draig spotted
>> and that Paul just fixed, I wrote a new syntax-check rule
>> to help avoid that sort of problem.  The following programs
>> must avoid most new uses of EXIT_FAILURE:
>>
>>   chroot.c
>>   env.c
>>   expr.c
>>   ls.c
>>   nice.c
>>   nohup.c
>>   printenv.c
>>   setuidgid.c
>>   stdbuf.c
>>   system.h
>>   timeout.c
>>   tty.c
>>
>> This new syntax-check rule caught a minor problem in
>> our helper setuidgid (not installed) and I fixed another
>> minor problem in the vicinity (dead code on error path).
>>
>> Here are the two patches:
>
> Nice one.
> That check is certainly warranted.
> Both patches look fine from a quick glance.

Thanks for the review.  Pushed.


From MAILER-DAEMON Thu Jul 05 09:04:59 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Smljv-0003sG-5d
	for mharc-coreutils@gnu.org; Thu, 05 Jul 2012 09:04:59 -0400
Received: from eggs.gnu.org ([208.118.235.92]:38049)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1Smljn-0003pc-5n
	for coreutils@gnu.org; Thu, 05 Jul 2012 09:04:56 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1Smljl-0000yl-Dd
	for coreutils@gnu.org; Thu, 05 Jul 2012 09:04:50 -0400
Received: from mx1.redhat.com ([209.132.183.28]:4183)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1Smljl-0000yC-5w
	for coreutils@gnu.org; Thu, 05 Jul 2012 09:04:49 -0400
Received: from int-mx02.intmail.prod.int.phx2.redhat.com
	(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q65D4iFa010299
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 5 Jul 2012 09:04:45 -0400
Received: from pb-n5110.redhat.com (ovpn-113-72.phx2.redhat.com [10.3.113.72])
	by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with
	ESMTP id q65D4hCP030161; Thu, 5 Jul 2012 09:04:44 -0400
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
To: coreutils@gnu.org
Subject: [PATCH] tests: sort-merge-fdlimit: reduce the limit by one
Date: Thu,  5 Jul 2012 14:04:41 +0100
Message-Id: <1341493481-2668-1-git-send-email-P@draigBrady.com>
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 05 Jul 2012 13:04:56 -0000

* tests/misc/sort-merge-fdlimit: As a consequence of commit
v8.17-34-g59daf05, we can reduce the descriptor limit by one.
---
 tests/misc/sort-merge-fdlimit |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tests/misc/sort-merge-fdlimit b/tests/misc/sort-merge-fdlimit
index ee1575a..7ce109c 100755
--- a/tests/misc/sort-merge-fdlimit
+++ b/tests/misc/sort-merge-fdlimit
@@ -65,7 +65,7 @@ done
 (seq 6 && echo 6) >exp || fail=1
 echo 6 >out || fail=1
 (exec 3<&- 4<&- 5<&- 6</dev/null 7<&6 8<&6 9<&6 &&
- ulimit -n 11 &&
+ ulimit -n 10 &&
  sort -n -m --batch-size=7 -o out out in/1 in/2 in/3 in/4 in/5 out
 ) &&
 compare exp out || fail=1
-- 
1.7.6.4



From MAILER-DAEMON Thu Jul 05 09:39:29 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SmmHJ-0004g2-BK
	for mharc-coreutils@gnu.org; Thu, 05 Jul 2012 09:39:29 -0400
Received: from eggs.gnu.org ([208.118.235.92]:43787)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SmmHA-0004eG-P2
	for coreutils@gnu.org; Thu, 05 Jul 2012 09:39:27 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SmmH4-0000Zl-M1
	for coreutils@gnu.org; Thu, 05 Jul 2012 09:39:20 -0400
Received: from mx.meyering.net ([88.168.87.75]:54661)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SmmH4-0000Ys-EH
	for coreutils@gnu.org; Thu, 05 Jul 2012 09:39:14 -0400
Received: from rho.meyering.net (rho.meyering.net [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 7AB2F606F5;
	Thu,  5 Jul 2012 15:39:11 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Subject: Re: [PATCH] tests: sort-merge-fdlimit: reduce the limit by one
In-Reply-To: <1341493481-2668-1-git-send-email-P@draigBrady.com>
	(=?iso-8859-1?Q?=22P=E1draig?=
	Brady"'s message of "Thu, 5 Jul 2012 14:04:41 +0100")
References: <1341493481-2668-1-git-send-email-P@draigBrady.com>
Date: Thu, 05 Jul 2012 15:39:11 +0200
Message-ID: <87y5myuy2o.fsf@rho.meyering.net>
Lines: 22
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 05 Jul 2012 13:39:27 -0000

P=E1draig Brady wrote:
> * tests/misc/sort-merge-fdlimit: As a consequence of commit
> v8.17-34-g59daf05, we can reduce the descriptor limit by one.

Good catch.  Thanks!

>  tests/misc/sort-merge-fdlimit |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/tests/misc/sort-merge-fdlimit b/tests/misc/sort-merge-fdlimit
> index ee1575a..7ce109c 100755
> --- a/tests/misc/sort-merge-fdlimit
> +++ b/tests/misc/sort-merge-fdlimit
> @@ -65,7 +65,7 @@ done
>  (seq 6 && echo 6) >exp || fail=3D1
>  echo 6 >out || fail=3D1
>  (exec 3<&- 4<&- 5<&- 6</dev/null 7<&6 8<&6 9<&6 &&
> - ulimit -n 11 &&
> + ulimit -n 10 &&
>   sort -n -m --batch-size=3D7 -o out out in/1 in/2 in/3 in/4 in/5 out
>  ) &&
>  compare exp out || fail=3D1


From MAILER-DAEMON Thu Jul 05 10:48:18 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SmnLu-0003Bm-Ji
	for mharc-coreutils@gnu.org; Thu, 05 Jul 2012 10:48:18 -0400
Received: from eggs.gnu.org ([208.118.235.92]:39675)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1SmnLq-0003Be-CQ
	for coreutils@gnu.org; Thu, 05 Jul 2012 10:48:17 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1SmnLo-00020F-Ms
	for coreutils@gnu.org; Thu, 05 Jul 2012 10:48:13 -0400
Received: from moutng.kundenserver.de ([212.227.126.187]:60586)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1SmnLo-0001zW-CH
	for coreutils@gnu.org; Thu, 05 Jul 2012 10:48:12 -0400
Received: from [192.168.2.108] (p4FF733EB.dip.t-dialin.net [79.247.51.235])
	by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis)
	id 0LyDKf-1RhLHo2Om5-015ctX; Thu, 05 Jul 2012 16:48:10 +0200
Message-ID: <4FF5A928.7030408@bernhard-voelker.de>
Date: Thu, 05 Jul 2012 16:48:08 +0200
From: Bernhard Voelker <mail@bernhard-voelker.de>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:13.0) Gecko/20120601 Thunderbird/13.0
MIME-Version: 1.0
To: Coreutils <coreutils@gnu.org>
Subject: df: -x value vs. next argument
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Provags-ID: V02:K0:gCnzcXo5vbDuXn9ZfKVgcQVLd0CkEhV30wAzHTM4n+K
	RYBJN5x0KtOYd4+R6bXkgCaSaum2qmrNhHYD35N2mG5JVFMWtH
	joHYJy4DSaCtYOqLgVLwwyNXRcl0cB/hlQyBxpIn5klpkFQvW8
	ITvWeT4Zrg8OT2vZyLB04ubxRVbLiRvZfd0R4BEzSvgWlS/p25
	/maFL5i0e2ypveIc33mLgI8BqfVkByDsSh+s6yKlNEKejs56kf
	iqh7ioIBkyT7FA3haxB7EDPhSVRx542rfPjEEIXSK97CH7532j
	5bfioXD11RIRUqms5Js0K3rn/HTTAcuk3nJepDPM8BIazo7N75
	qD0wMX9xMcsA/dRemOKLSpd6xa6xG69jb+uY+LLA6
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 212.227.126.187
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 05 Jul 2012 14:48:17 -0000

I stumbled upon this:

  $ df -x -h

It doesn't honor the -h option because that is taken as the value
for the -x option. Is that intended? Should it fail/warn/...?

Have a nice day,
Berny

It's pretty warm today, so maybe I don't see the obvious ...



From MAILER-DAEMON Thu Jul 05 10:52:04 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SmnPY-0004C8-R2
	for mharc-coreutils@gnu.org; Thu, 05 Jul 2012 10:52:04 -0400
Received: from eggs.gnu.org ([208.118.235.92]:56158)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SmnPR-0003tr-Ny
	for coreutils@gnu.org; Thu, 05 Jul 2012 10:52:03 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SmnPI-0003ZJ-WA
	for coreutils@gnu.org; Thu, 05 Jul 2012 10:51:57 -0400
Received: from mx1.redhat.com ([209.132.183.28]:3150)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SmnPI-0003Ys-OM
	for coreutils@gnu.org; Thu, 05 Jul 2012 10:51:48 -0400
Received: from int-mx02.intmail.prod.int.phx2.redhat.com
	(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q65Ephdt024216
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 5 Jul 2012 10:51:44 -0400
Received: from [10.3.113.17] ([10.3.113.17])
	by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id q65Eph07003002; Thu, 5 Jul 2012 10:51:43 -0400
Message-ID: <4FF5A9FE.5070407@redhat.com>
Date: Thu, 05 Jul 2012 08:51:42 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:13.0) Gecko/20120615 Thunderbird/13.0.1
MIME-Version: 1.0
To: Bernhard Voelker <mail@bernhard-voelker.de>
Subject: Re: df: -x value vs. next argument
References: <4FF5A928.7030408@bernhard-voelker.de>
In-Reply-To: <4FF5A928.7030408@bernhard-voelker.de>
X-Enigmail-Version: 1.4.2
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="------------enig7127DC055C52FC40B324DC29"
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 05 Jul 2012 14:52:03 -0000

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig7127DC055C52FC40B324DC29
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 07/05/2012 08:48 AM, Bernhard Voelker wrote:
> I stumbled upon this:
>=20
>   $ df -x -h
>=20
> It doesn't honor the -h option because that is taken as the value
> for the -x option. Is that intended? Should it fail/warn/...?

Intended that -x consumes the '-h' as its argument, but perhaps could be
improved to warn if the '-x' argument doesn't match any known file
system types.  (But NOT fail, as the rate of new file system additions
is shockingly high even today).

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




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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJP9an/AAoJEKeha0olJ0NqQjUH/i1zgRdlrjN5HhcX7+QfFl3K
IzQCBHPZUfsg6ImBJLA4TNoySCmFVffV1dO7R4cK687mUpxJ9Nec63RYzxr75aIZ
Ingx1XlvxvHZRgDKVCE3l4Qu8KrmGBehDigApZ7hQpSOLhlDA9O1OC0cA9WSTJkd
xgkFrpK8pc0eRT0elptTWhPL5/j/A8OD4T1tiDnfxDrJw/S0Q8bEwMNRnHeHbk1R
z4qneBTnZVCicNWPV+mMMIevD1ZVXH7m+K0adPpOE/9ytXS/MmkWQYpd+ZUnARBB
joolr6DmcBPJrdPS8a4sqbSO8aQ6adT7ijxwuCdLdD+qhh/ulBb57se9MFfL4d8=
=ad5x
-----END PGP SIGNATURE-----

--------------enig7127DC055C52FC40B324DC29--


From MAILER-DAEMON Thu Jul 05 11:34:19 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Smo4R-00014S-5K
	for mharc-coreutils@gnu.org; Thu, 05 Jul 2012 11:34:19 -0400
Received: from eggs.gnu.org ([208.118.235.92]:41509)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1Smo4J-00013p-Jc
	for coreutils@gnu.org; Thu, 05 Jul 2012 11:34:17 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1Smo4H-0008Fr-Uz
	for coreutils@gnu.org; Thu, 05 Jul 2012 11:34:11 -0400
Received: from moutng.kundenserver.de ([212.227.126.171]:55552)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1Smo4G-0008FY-TD
	for coreutils@gnu.org; Thu, 05 Jul 2012 11:34:09 -0400
Received: from [192.168.2.108] (p4FF733EB.dip.t-dialin.net [79.247.51.235])
	by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis)
	id 0M6RPb-1Ru0I72xnX-00xpHA; Thu, 05 Jul 2012 17:34:00 +0200
Message-ID: <4FF5B3E7.7040800@bernhard-voelker.de>
Date: Thu, 05 Jul 2012 17:33:59 +0200
From: Bernhard Voelker <mail@bernhard-voelker.de>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:13.0) Gecko/20120601 Thunderbird/13.0
MIME-Version: 1.0
To: Eric Blake <eblake@redhat.com>
Subject: Re: df: -x value vs. next argument
References: <4FF5A928.7030408@bernhard-voelker.de>
	<4FF5A9FE.5070407@redhat.com>
In-Reply-To: <4FF5A9FE.5070407@redhat.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Provags-ID: V02:K0:UO/FwGGg75LCKfjZvyN60LEdvPF/2S47IAcK2CsRyDJ
	/A7wc4rVMjhAa6+D2dHZFRyLzJRef9iCMz6+INmicSlsWNSH50
	GVeKSvZ2DIZpVIzwamiC1aU8jVkpHCRgL9XZ+36qjeQR5/oZec
	hJZuscNXrv/qTdp2HghKi8GFznTvZtbQvYrPduX50EWdm16NBc
	pE77Z4C6Mo+xXu+WC0ydrNLDxAcjUjx3P5uzSKwebSh6m5AJ9l
	1JxtWuWeq7qcrZCRVLtLDNbYgMUwfnHeQEsaWGUsE9MHNrTtVu
	EG8mkqhxaS5MMRypR3mKuYokfNlTNdk5rch4bP8vt8UNkE2mqW
	QQFFjToknn53u/cXx536ozuK8Hqi5KB47TCSkqVSo
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 212.227.126.171
Cc: Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 05 Jul 2012 15:34:17 -0000



On 07/05/2012 04:51 PM, Eric Blake wrote:
> On 07/05/2012 08:48 AM, Bernhard Voelker wrote:
>> I stumbled upon this:
>>
>>   $ df -x -h
>>
>> It doesn't honor the -h option because that is taken as the value
>> for the -x option. Is that intended? Should it fail/warn/...?
> 
> Intended that -x consumes the '-h' as its argument, but perhaps could be
> improved to warn if the '-x' argument doesn't match any known file
> system types.  (But NOT fail, as the rate of new file system additions
> is shockingly high even today).

Good idea, but that'd require a bit of re-factoring: the list of
file systems we maintain is in human_fstype() in stat.c.
Well, both (stat and df) handle with file systems, so it'd be
natural to have this list in a central place.
What do you think?

Have a nice day,
Berny


From MAILER-DAEMON Thu Jul 05 19:15:07 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SmvGN-0004Zj-Gu
	for mharc-coreutils@gnu.org; Thu, 05 Jul 2012 19:15:07 -0400
Received: from eggs.gnu.org ([208.118.235.92]:41683)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1SmvGI-0004Wb-1Y
	for coreutils@gnu.org; Thu, 05 Jul 2012 19:15:05 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1SmvGD-0003Vq-O4
	for coreutils@gnu.org; Thu, 05 Jul 2012 19:15:01 -0400
Received: from smtp.cs.ucla.edu ([131.179.128.62]:54580)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1SmvGD-0003Uy-9q
	for coreutils@gnu.org; Thu, 05 Jul 2012 19:14:57 -0400
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id B6A87A6001D
	for <coreutils@gnu.org>; Thu,  5 Jul 2012 16:14:47 -0700 (PDT)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
Received: from smtp.cs.ucla.edu ([127.0.0.1])
	by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 1tO8e5LhcrQO for <coreutils@gnu.org>;
	Thu,  5 Jul 2012 16:14:42 -0700 (PDT)
Received: from [192.168.1.4] (pool-108-23-119-2.lsanca.fios.verizon.net
	[108.23.119.2])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id ACE40A6000F
	for <coreutils@gnu.org>; Thu,  5 Jul 2012 16:14:41 -0700 (PDT)
Message-ID: <4FF61FDC.2080806@cs.ucla.edu>
Date: Thu, 05 Jul 2012 16:14:36 -0700
From: Paul Eggert <eggert@cs.ucla.edu>
Organization: UCLA Computer Science Department
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:13.0) Gecko/20120615 Thunderbird/13.0.1
MIME-Version: 1.0
To: Coreutils <coreutils@gnu.org>
Subject: [PATCH 1/2] doc: fix spacing
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 131.179.128.62
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 05 Jul 2012 23:15:05 -0000

* doc/coreutils.texi: Use right amount of spacing after punctuation.
---
 doc/coreutils.texi |  159 ++++++++++++++++++++++++++--------------------------
 1 files changed, 80 insertions(+), 79 deletions(-)

diff --git a/doc/coreutils.texi b/doc/coreutils.texi
index 954a1f8..3c7f4e5 100644
--- a/doc/coreutils.texi
+++ b/doc/coreutils.texi
@@ -585,7 +585,7 @@ symbolic link to a directory.  @xref{Target directory}.
 @opindex --null
 @cindex output @sc{nul}-byte-terminated lines
 Output a zero byte (@acronym{ASCII} @sc{nul}) at the end of each line,
-rather than a newline. This option enables other programs to parse the
+rather than a newline.  This option enables other programs to parse the
 output of @command{\cmd\} even when that output would contain data
 with embedded newlines.
 @end macro
@@ -1046,7 +1046,7 @@ floating point numbers such as @code{-0x.ep-3}, which stands for
 A @var{signal} may be a signal name like @samp{HUP}, or a signal
 number like @samp{1}, or an exit status of a process terminated by the
 signal.  A signal name can be given in canonical form or prefixed by
-@samp{SIG}.  The case of the letters is ignored. The following signal names
+@samp{SIG}@.  The case of the letters is ignored.  The following signal names
 and numbers are supported on all @acronym{POSIX} compliant systems:
 
 @table @samp
@@ -1141,10 +1141,10 @@ Since the @var{owner} and @var{group} arguments to @command{chown} and
 apparent ambiguity.
 What if a user or group @emph{name} is a string of digits?
 @footnote{Using a number as a user name is common in some environments.}
-Should the command interpret it as a user name or as an ID?
+Should the command interpret it as a user name or as an ID@?
 @acronym{POSIX} requires that @command{chown} and @command{chgrp}
 first attempt to resolve the specified string as a name, and
-only once that fails, then try to interpret it as an ID.
+only once that fails, then try to interpret it as an ID@.
 This is troublesome when you want to specify a numeric ID, say 42,
 and it must work even in a pathological situation where
 @samp{42} is a user name that maps to some other user ID, say 1000.
@@ -2482,7 +2482,7 @@ by @option{-o} option.  With multicolumn output priority is given to
 The TAB width is fixed to the value of the first column and does
 not change with different values of left @var{margin}.  That means a
 fixed number of spaces is always printed in the place of the
-@var{number-separator} TAB.  The tabification depends upon the output
+@var{number-separator} TAB@.  The tabification depends upon the output
 position.
 
 @item -N @var{line_number}
@@ -2583,7 +2583,7 @@ alignment is always used.  The separator options @option{-S} or @option{-s}
 don't affect the @option{-W} option.  Default is 72 characters.  Without
 @option{-W @var{page_width}} and without any of the column options NO line
 truncation is used (defined to keep downward compatibility and to meet
-most frequent tasks).  That's equivalent to @option{-W 72 -J}.  The header
+most frequent tasks).  That's equivalent to @option{-W 72 -J}@.  The header
 line is never truncated.
 
 @end table
@@ -3110,7 +3110,7 @@ want to specify @option{-a} to allow suffixes beyond @samp{99}.
 
 @itemx --additional-suffix=@var{suffix}
 @opindex --additional-suffix
-Append an additional @var{suffix} to output file names. @var{suffix}
+Append an additional @var{suffix} to output file names.  @var{suffix}
 must not contain slash.
 
 @item -e
@@ -3892,7 +3892,7 @@ sequence specified by the @env{LC_COLLATE} locale.@footnote{If you
 use a non-@acronym{POSIX} locale (e.g., by setting @env{LC_ALL}
 to @samp{en_US}), then @command{sort} may produce output that is sorted
 differently than you're accustomed to.  In that case, set the @env{LC_ALL}
-environment variable to @samp{C}.  Note that setting only @env{LC_COLLATE}
+environment variable to @samp{C}@.  Note that setting only @env{LC_COLLATE}
 has two problems.  First, it is ineffective if @env{LC_ALL} is also set.
 Second, it has undefined behavior if @env{LC_CTYPE} (or @env{LANG}, if
 @env{LC_CTYPE} is unset) is set to an incompatible value.  For example,
@@ -3966,8 +3966,8 @@ Fold lowercase characters into the equivalent uppercase characters when
 comparing so that, for example, @samp{b} and @samp{B} sort as equal.
 The @env{LC_CTYPE} locale determines character types.
 When used with @option{--unique} those lower case equivalent lines are
-thrown away. (There is currently no way to throw away the upper case
-equivalent instead. (Any @option{--reverse} given would only affect
+thrown away.  (There is currently no way to throw away the upper case
+equivalent instead.  (Any @option{--reverse} given would only affect
 the final result, after the throwing away.))
 
 @item -g
@@ -4044,7 +4044,7 @@ This option has no effect if the stronger @option{--dictionary-order}
 @vindex LC_TIME
 An initial string, consisting of any amount of blanks, followed
 by a month name abbreviation, is folded to UPPER case and
-compared in the order @samp{JAN} < @samp{FEB} < @dots{} < @samp{DEC}.
+compared in the order @samp{JAN} < @samp{FEB} < @dots{} < @samp{DEC}@.
 Invalid names compare low to valid names.  The @env{LC_TIME} locale
 category determines the month spellings.
 By default a blank is a space or a tab, but the @env{LC_CTYPE} locale
@@ -4171,7 +4171,7 @@ a temporary file, which is then used as an input in a subsequent merge.
 
 A large value of @var{nmerge} may improve merge performance and decrease
 temporary storage utilization at the expense of increased memory usage
-and I/O.  Conversely a small value of @var{nmerge} may reduce memory
+and I/O@.  Conversely a small value of @var{nmerge} may reduce memory
 requirements and I/O at the expense of temporary storage consumption and
 merge performance.
 
@@ -4195,7 +4195,7 @@ silently uses a smaller value.
 Write output to @var{output-file} instead of standard output.
 Normally, @command{sort} reads all input before opening
 @var{output-file}, so you can safely sort a file in place by using
-commands like @code{sort -o F F} and @code{cat F | sort -o F}.
+commands like @code{sort -o F F} and @code{cat F | sort -o F}@.
 However, @command{sort} with @option{--merge} (@option{-m}) can open
 the output file before reading all input, so a command like @code{cat
 F | sort -m -o F - G} is not safe as @command{sort} might start
@@ -4203,7 +4203,7 @@ writing @file{F} before @command{cat} is done reading it.
 
 @vindex POSIXLY_CORRECT
 On newer systems, @option{-o} cannot appear after an input file if
-@env{POSIXLY_CORRECT} is set, e.g., @samp{sort F -o F}.  Portable
+@env{POSIXLY_CORRECT} is set, e.g., @samp{sort F -o F}@.  Portable
 scripts should specify @option{-o @var{output-file}} before any input
 files.
 
@@ -4235,7 +4235,7 @@ Use a main-memory sort buffer of the given @var{size}.  By default,
 @var{size} to be interpreted as a percentage of physical memory.
 Appending @samp{K} multiplies @var{size} by 1024 (the default),
 @samp{M} by 1,048,576, @samp{G} by 1,073,741,824, and so on for
-@samp{T}, @samp{P}, @samp{E}, @samp{Z}, and @samp{Y}.  Appending
+@samp{T}, @samp{P}, @samp{E}, @samp{Z}, and @samp{Y}@.  Appending
 @samp{b} causes @var{size} to be interpreted as a byte count, with no
 multiplication.
 
@@ -4315,7 +4315,7 @@ uniq} inspects the entire line.  @xref{uniq invocation}.
 @opindex --zero-terminated
 @cindex process zero-terminated items
 Delimit items with a zero byte rather than a newline (@acronym{ASCII} @sc{lf}).
-I.E. treat input as items separated by @acronym{ASCII} @sc{nul}
+I.e., treat input as items separated by @acronym{ASCII} @sc{nul}
 and terminate output items with @acronym{ASCII} @sc{nul}.
 This option can be useful in conjunction with @samp{perl -0} or
 @samp{find -print0} and @samp{xargs -0} which do the same in order to
@@ -5155,7 +5155,7 @@ output line.
 
 Select the maximum output width of each final line.  If references are
 used, they are included or excluded from the maximum output width
-depending on the value of option @option{-R}.  If this option is not
+depending on the value of option @option{-R}@.  If this option is not
 selected, that is, when references are output before the left context,
 the maximum output width takes into account the maximum length of all
 references.  If this option is selected, that is, when references are
@@ -5194,7 +5194,7 @@ disabled.
 This option will request that any truncation in the output be reported
 using the string @var{string}.  Most output fields theoretically extend
 towards the beginning or the end of the current line, or current
-sentence, as selected with option @option{-S}.  But there is a maximum
+sentence, as selected with option @option{-S}@.  But there is a maximum
 allowed output line width, changeable through option @option{-w}, which is
 further divided into space for various output fields.  When a field has
 to be truncated because it cannot extend beyond the beginning or the end of
@@ -5321,8 +5321,9 @@ line width computations.
 @item
 All 256 bytes, even @acronym{ASCII} @sc{nul} bytes, are always read and
 processed from input file with no adverse effect, even if @sc{gnu} extensions
-are disabled. However, System V @command{ptx} does not accept 8-bit characters,
-a few control characters are rejected, and the tilde @kbd{~} is also rejected.
+are disabled.  However, System V @command{ptx} does not accept 8-bit
+characters, a few control characters are rejected, and the tilde
+@kbd{~} is also rejected.
 
 @item
 Input line length is only limited by available memory, even if @sc{gnu}
@@ -5792,12 +5793,12 @@ Do not check that both input files are in sorted order.  This is the default.
 @item -e @var{string}
 @opindex -e
 Replace those output fields that are missing in the input with @var{string}.
-I.E. missing fields specified with the @option{-12jo} options.
+I.e., missing fields specified with the @option{-12jo} options.
 
 @item --header
 @opindex --header
-Treat the first line of each input file as a header line. The header lines will
-be joined and printed as the first output line.  If @option{-o} is used to
+Treat the first line of each input file as a header line.  The header lines
+will be joined and printed as the first output line.  If @option{-o} is used to
 specify output format, the header line will be printed according to the
 specified format.  The header lines will not be checked for ordering even if
 @option{--check-order} is specified.  Also if the header lines from each file
@@ -6003,7 +6004,7 @@ as well as digits.
 Many historically common and even accepted uses of ranges are not
 portable.  For example, on @acronym{EBCDIC} hosts using the @samp{A-Z}
 range will not do what most would expect because @samp{A} through @samp{Z}
-are not contiguous as they are in @acronym{ASCII}.
+are not contiguous as they are in @acronym{ASCII}@.
 If you can rely on a @acronym{POSIX} compliant version of @command{tr}, then
 the best way to work around this is to use character classes (see below).
 Otherwise, it is most portable (and most ugly) to enumerate the members
@@ -6687,7 +6688,7 @@ $ ls -blog --dired 'a b'
 If you use a quoting style that adds quote marks
 (e.g., @option{--quoting-style=c}), then the offsets include the quote marks.
 So beware that the user may select the quoting style via the environment
-variable @env{QUOTING_STYLE}.  Hence, applications using @option{--dired}
+variable @env{QUOTING_STYLE}@.  Hence, applications using @option{--dired}
 should either specify an explicit @option{--quoting-style=literal} option
 (aka @option{-N} or @option{--literal}) on the command line, or else be
 prepared to parse the escaped names.
@@ -7021,7 +7022,7 @@ which has some caveats worth noting.
 @itemize @bullet
 @item @env{LC_COLLATE} is ignored, which means @samp{ls -v} and @samp{sort -V}
 will sort non-numeric prefixes as if the @env{LC_COLLATE} locale category
-was set to @samp{C}.
+was set to @samp{C}@.
 @item Some suffixes will not be matched by the regular
 expression mentioned above.  Consequently these examples may
 not sort as you expect:
@@ -7431,7 +7432,7 @@ this"} in the default C locale.  This looks nicer on many displays.
 @end table
 
 You can specify the default value of the @option{--quoting-style} option
-with the environment variable @env{QUOTING_STYLE}.  If that environment
+with the environment variable @env{QUOTING_STYLE}@.  If that environment
 variable is not set, the default value is @samp{literal}, but this
 default may change to @samp{shell} in a future version of this package.
 
@@ -7616,7 +7617,7 @@ link only when it refers to an existing regular file.
 However, when copying to a dangling symbolic link, @command{cp}
 refuses by default, and fails with a diagnostic, since the operation
 is inherently dangerous.  This behavior is contrary to historical
-practice and to @acronym{POSIX}.
+practice and to @acronym{POSIX}@.
 Set @env{POSIXLY_CORRECT} to make @command{cp} attempt to create
 the target of a dangling destination symlink, in spite of the possible risk.
 Also, when an option like
@@ -7737,7 +7738,7 @@ via recursive traversal.
 @opindex -i
 @opindex --interactive
 When copying a file other than a directory, prompt whether to
-overwrite an existing destination file. The @option{-i} option overrides
+overwrite an existing destination file.  The @option{-i} option overrides
 a previous @option{-n} option.
 
 @item -l
@@ -7759,8 +7760,8 @@ a regular file in the destination tree.
 @itemx --no-clobber
 @opindex -n
 @opindex --no-clobber
-Do not overwrite an existing file. The @option{-n} option overrides a previous
-@option{-i} option. This option is mutually exclusive with @option{-b} or
+Do not overwrite an existing file.  The @option{-n} option overrides a previous
+@option{-i} option.  This option is mutually exclusive with @option{-b} or
 @option{--backup} option.
 
 @item -P
@@ -7893,7 +7894,7 @@ implementations that dereference symbolic links by default.
 @cindex clone
 @cindex copy on write
 Perform a lightweight, copy-on-write (COW) copy, if supported by the
-file system. Once it has succeeded, beware that the source and destination
+file system.  Once it has succeeded, beware that the source and destination
 files share the same disk data blocks as long as they remain unmodified.
 Thus, if a disk I/O error affects data blocks of one of the files,
 the other suffers the same fate.
@@ -8120,18 +8121,18 @@ Conversions:
 @item ascii
 @opindex ascii@r{, converting to}
 Convert @acronym{EBCDIC} to @acronym{ASCII},
-using the conversion table specified by @acronym{POSIX}.
+using the conversion table specified by @acronym{POSIX}@.
 This provides a 1:1 translation for all 256 bytes.
 
 @item ebcdic
 @opindex ebcdic@r{, converting to}
-Convert @acronym{ASCII} to @acronym{EBCDIC}.
+Convert @acronym{ASCII} to @acronym{EBCDIC}@.
 This is the inverse of the @samp{ascii} conversion.
 
 @item ibm
 @opindex alternate ebcdic@r{, converting to}
 Convert @acronym{ASCII} to alternate @acronym{EBCDIC},
-using the alternate conversion table specified by @acronym{POSIX}.
+using the alternate conversion table specified by @acronym{POSIX}@.
 This is not a 1:1 translation, but reflects common historical practice
 for @samp{~}, @samp{[}, and @samp{]}.
 
@@ -8351,13 +8352,13 @@ Fail if the file has multiple hard links.
 @item binary
 @opindex binary
 @cindex binary I/O
-Use binary I/O.  This option has an effect only on nonstandard
+Use binary I/O@.  This option has an effect only on nonstandard
 platforms that distinguish binary from text I/O.
 
 @item text
 @opindex text
 @cindex text I/O
-Use text I/O.  Like @samp{binary}, this option has no effect on
+Use text I/O@.  Like @samp{binary}, this option has no effect on
 standard platforms.
 
 @item fullblock
@@ -8695,7 +8696,7 @@ when it might be a symlink to a directory.
 Otherwise, @command{mv} may do something very surprising, since
 its behavior depends on the underlying rename system call.
 On a system with a modern Linux-based kernel, it fails with
-@code{errno=ENOTDIR}.
+@code{errno=ENOTDIR}@.
 However, on other systems (at least FreeBSD 6.1 and Solaris 10) it silently
 renames not the symlink but rather the directory referenced by the symlink.
 @xref{Trailing slashes}.
@@ -8976,7 +8977,7 @@ assumption.  Exceptions include:
 @item
 Log-structured or journaled file systems, such as those supplied with
 AIX and Solaris, and JFS, ReiserFS, XFS, Ext3 (in @code{data=journal} mode),
-BFS, NTFS, etc.@: when they are configured to journal @emph{data}.
+BFS, NTFS, etc., when they are configured to journal @emph{data}.
 
 @item
 File systems that write redundant data and carry on even if some writes
@@ -8995,7 +8996,7 @@ Compressed file systems.
 
 In the particular case of ext3 file systems, the above disclaimer applies (and
 @command{shred} is thus of limited effectiveness) only in @code{data=journal}
-mode, which journals file data in addition to just metadata. In both
+mode, which journals file data in addition to just metadata.  In both
 the @code{data=ordered} (default) and @code{data=writeback} modes,
 @command{shred} works as usual.  Ext3 journaling modes can be changed
 by adding the @code{data=something} option to the mount options for a
@@ -9048,8 +9049,8 @@ Override file permissions if necessary to allow overwriting.
 @opindex --iterations=@var{number}
 @cindex iterations, selecting the number of
 By default, @command{shred} uses @value{SHRED_DEFAULT_PASSES} passes of
-overwrite. You can reduce this to save time, or increase it if you think it's
-appropriate. After 25 passes all of the internal overwrite patterns will have
+overwrite.  You can reduce this to save time, or increase it if you think it's
+appropriate.  After 25 passes all of the internal overwrite patterns will have
 been used at least once.
 
 @item --random-source=@var{file}
@@ -10442,7 +10443,7 @@ time zones, @samp{am} and @samp{pm}, @samp{yesterday}, etc.  For
 example, @option{--date="2004-02-27 14:19:13.489392193 +0530"}
 specifies the instant of time that is 489,392,193 nanoseconds after
 February 27, 2004 at 2:19:13 PM in a time zone that is 5 hours and 30
-minutes east of @acronym{UTC}.  @xref{Date input formats}.
+minutes east of @acronym{UTC}@.  @xref{Date input formats}.
 File systems that do not support high-resolution time stamps
 silently ignore any excess precision here.
 
@@ -11139,7 +11140,7 @@ precision preceded by a period to specify the number of digits to
 print after the decimal point.  For example, @samp{%.3X} outputs the
 last access time to millisecond precision.  If a period is given but no
 precision, @command{stat} uses 9 digits, so @samp{%.X} is equivalent to
-@samp{%.9X}.  When discarding excess precision, time stamps are truncated
+@samp{%.9X}@.  When discarding excess precision, time stamps are truncated
 toward minus infinity.
 
 @example
@@ -11236,7 +11237,7 @@ Any arguments are ignored, except for a lone @option{--help} or
 @cindex truncating, file sizes
 
 @command{truncate} shrinks or extends the size of each @var{file} to the
-specified size. Synopsis:
+specified size.  Synopsis:
 
 @example
 truncate @var{option}@dots{} @var{file}@dots{}
@@ -13160,7 +13161,7 @@ Disable modem control signals.  May be negated.
 @cindex hardware flow control
 @cindex flow control, hardware
 @cindex RTS/CTS flow control
-Enable RTS/CTS flow control.  Non-@acronym{POSIX}.  May be negated.
+Enable RTS/CTS flow control.  Non-@acronym{POSIX}@.  May be negated.
 @end table
 
 
@@ -13240,20 +13241,20 @@ empty again.  May be negated.
 @item iuclc
 @opindex iuclc
 @cindex uppercase, translating to lowercase
-Translate uppercase characters to lowercase.  Non-@acronym{POSIX}.  May be
-negated. Note ilcuc is not implemented, as one would not be able to issue
+Translate uppercase characters to lowercase.  Non-@acronym{POSIX}@.  May be
+negated.  Note ilcuc is not implemented, as one would not be able to issue
 almost any (lowercase) Unix command, after invoking it.
 
 @item ixany
 @opindex ixany
 Allow any character to restart output (only the start character
-if negated).  Non-@acronym{POSIX}.  May be negated.
+if negated).  Non-@acronym{POSIX}@.  May be negated.
 
 @item imaxbel
 @opindex imaxbel
 @cindex beeping at input buffer full
 Enable beeping and not flushing input buffer if a character arrives
-when the input buffer is full.  Non-@acronym{POSIX}.  May be negated.
+when the input buffer is full.  Non-@acronym{POSIX}@.  May be negated.
 @end table
 
 
@@ -13271,41 +13272,41 @@ Postprocess output.  May be negated.
 @item olcuc
 @opindex olcuc
 @cindex lowercase, translating to output
-Translate lowercase characters to uppercase.  Non-@acronym{POSIX}.  May be
-negated. (Note ouclc is not currently implemented.)
+Translate lowercase characters to uppercase.  Non-@acronym{POSIX}@.  May be
+negated.  (Note ouclc is not currently implemented.)
 
 @item ocrnl
 @opindex ocrnl
 @cindex return, translating to newline
-Translate carriage return to newline.  Non-@acronym{POSIX}.  May be negated.
+Translate carriage return to newline.  Non-@acronym{POSIX}@.  May be negated.
 
 @item onlcr
 @opindex onlcr
 @cindex newline, translating to crlf
-Translate newline to carriage return-newline.  Non-@acronym{POSIX}.  May be
+Translate newline to carriage return-newline.  Non-@acronym{POSIX}@.  May be
 negated.
 
 @item onocr
 @opindex onocr
-Do not print carriage returns in the first column.  Non-@acronym{POSIX}.
+Do not print carriage returns in the first column.  Non-@acronym{POSIX}@.
 May be negated.
 
 @item onlret
 @opindex onlret
-Newline performs a carriage return.  Non-@acronym{POSIX}.  May be negated.
+Newline performs a carriage return.  Non-@acronym{POSIX}@.  May be negated.
 
 @item ofill
 @opindex ofill
 @cindex pad instead of timing for delaying
 Use fill (padding) characters instead of timing for delays.
-Non-@acronym{POSIX}.
+Non-@acronym{POSIX}@.
 May be negated.
 
 @item ofdel
 @opindex ofdel
 @cindex pad character
 Use @acronym{ASCII} @sc{del} characters for fill instead of
-@acronym{ASCII} @sc{nul} characters.  Non-@acronym{POSIX}.
+@acronym{ASCII} @sc{nul} characters.  Non-@acronym{POSIX}@.
 May be negated.
 
 @item nl1
@@ -13396,12 +13397,12 @@ characters.  May be negated.
 @cindex case translation
 Enable input and output of uppercase characters by preceding their
 lowercase equivalents with @samp{\}, when @code{icanon} is set.
-Non-@acronym{POSIX}.  May be negated.
+Non-@acronym{POSIX}@.  May be negated.
 
 @item tostop
 @opindex tostop
 @cindex background jobs, stopping at terminal write
-Stop background jobs that try to write to the terminal.  Non-@acronym{POSIX}.
+Stop background jobs that try to write to the terminal.  Non-@acronym{POSIX}@.
 May be negated.
 
 @item echoprt
@@ -13409,7 +13410,7 @@ May be negated.
 @opindex echoprt
 @opindex prterase
 Echo erased characters backward, between @samp{\} and @samp{/}.
-Non-@acronym{POSIX}.  May be negated.
+Non-@acronym{POSIX}@.  May be negated.
 
 @item echoctl
 @itemx ctlecho
@@ -13418,7 +13419,7 @@ Non-@acronym{POSIX}.  May be negated.
 @cindex control characters, using @samp{^@var{c}}
 @cindex hat notation for control characters
 Echo control characters in hat notation (@samp{^@var{c}}) instead
-of literally.  Non-@acronym{POSIX}.  May be negated.
+of literally.  Non-@acronym{POSIX}@.  May be negated.
 
 @item echoke
 @itemx crtkill
@@ -13427,7 +13428,7 @@ of literally.  Non-@acronym{POSIX}.  May be negated.
 Echo the @code{kill} special character by erasing each character on
 the line as indicated by the @code{echoprt} and @code{echoe} settings,
 instead of by the @code{echoctl} and @code{echok} settings.
-Non-@acronym{POSIX}.
+Non-@acronym{POSIX}@.
 May be negated.
 @end table
 
@@ -13515,18 +13516,18 @@ If negated, same as @code{parenb istrip opost cs7}.
 
 @item decctlq
 @opindex decctlq
-Same as @option{-ixany}.  Non-@acronym{POSIX}.  May be negated.
+Same as @option{-ixany}.  Non-@acronym{POSIX}@.  May be negated.
 
 @item tabs
 @opindex tabs
-Same as @code{tab0}.  Non-@acronym{POSIX}.  May be negated.  If negated, same
+Same as @code{tab0}.  Non-@acronym{POSIX}@.  May be negated.  If negated, same
 as @code{tab3}.
 
 @item lcase
 @itemx LCASE
 @opindex lcase
 @opindex LCASE
-Same as @code{xcase iuclc olcuc}.  Non-@acronym{POSIX}.  May be negated.
+Same as @code{xcase iuclc olcuc}.  Non-@acronym{POSIX}@.  May be negated.
 (Used for terminals with uppercase characters only.)
 
 @item crt
@@ -13853,7 +13854,7 @@ Print the user or group name instead of the ID number.  Requires
 @itemx --real
 @opindex -r
 @opindex --real
-Print the real, instead of effective, user or group ID.  Requires
+Print the real, instead of effective, user or group ID@.  Requires
 @option{-u}, @option{-g}, or @option{-G}.
 
 @item -u
@@ -13915,7 +13916,7 @@ options}.
 @cindex printing the effective user ID
 
 @command{whoami} prints the user name associated with the current
-effective user ID.  It is equivalent to the command @samp{id -un}.
+effective user ID@.  It is equivalent to the command @samp{id -un}.
 
 The only options are @option{--help} and @option{--version}.  @xref{Common
 options}.
@@ -14217,10 +14218,10 @@ hour (@samp{00}@dots{}@samp{23})
 @item %I
 hour (@samp{01}@dots{}@samp{12})
 @item %k
-hour, space padded (@samp{ 0}@dots{}@samp{23}); equivalent to @samp{%_H}.
+hour, space padded (@samp{ 0}@dots{}@samp{23}); equivalent to @samp{%_H}@.
 This is a @acronym{GNU} extension.
 @item %l
-hour, space padded (@samp{ 1}@dots{}@samp{12}); equivalent to @samp{%_I}.
+hour, space padded (@samp{ 1}@dots{}@samp{12}); equivalent to @samp{%_I}@.
 This is a @acronym{GNU} extension.
 @item %M
 minute (@samp{00}@dots{}@samp{59})
@@ -14242,7 +14243,7 @@ locale's 12-hour clock time (e.g., @samp{11:11:04 PM})
 @cindex epoch, seconds since
 @cindex seconds since the epoch
 @cindex beginning of time
-seconds since the epoch, i.e., since 1970-01-01 00:00:00 UTC.
+seconds since the epoch, i.e., since 1970-01-01 00:00:00 UTC@.
 Leap seconds are not counted unless leap second support is available.
 @xref{%s-examples}, for examples.
 This is a @acronym{GNU} extension.
@@ -14527,7 +14528,7 @@ format.  It can contain month names, time zones, @samp{am} and @samp{pm},
 14:19:13.489392193 +0530"} specifies the instant of time that is
 489,392,193 nanoseconds after February 27, 2004 at 2:19:13 PM in a
 time zone that is 5 hours and 30 minutes east of @acronym{UTC}.@*
-Note: input currently must be in locale independent format. E.g., the
+Note: input currently must be in locale independent format.  E.g., the
 LC_TIME=C below is needed to print back the correct date in many locales:
 @example
 date -d "$(LC_TIME=C date)"
@@ -14622,7 +14623,7 @@ This is equivalent to the format @samp{%Y-%m-%d}.
 Print the full-date and full-time separated by a space, e.g.,
 @samp{2005-09-14 00:56:06+05:30}.  The output ends with a numeric
 time-offset; here the @samp{+05:30} means that local time is five
-hours and thirty minutes east of @acronym{UTC}.  This is equivalent to
+hours and thirty minutes east of @acronym{UTC}@.  This is equivalent to
 the format @samp{%Y-%m-%d %H:%M:%S%:z}.
 
 @item ns
@@ -15845,8 +15846,8 @@ the @var{command}.
 @opindex -s
 @opindex --signal
 Send this @var{signal} to @var{command} on timeout, rather than the
-default @samp{TERM} signal. @var{signal} may be a name like @samp{HUP}
-or a number. @xref{Signal specifications}.
+default @samp{TERM} signal.  @var{signal} may be a name like @samp{HUP}
+or a number.  @xref{Signal specifications}.
 @end table
 
 @cindex time units
@@ -15904,7 +15905,7 @@ kill [-l | --list | -t | --table] [@var{signal}]@dots{}
 
 The first form of the @command{kill} command sends a signal to all
 @var{pid} arguments.  The default signal to send if none is specified
-is @samp{TERM}.  The special signal number @samp{0} does not denote a
+is @samp{TERM}@.  The special signal number @samp{0} does not denote a
 valid signal, but can be used to test whether the @var{pid} arguments
 specify processes to which a signal could be sent.
 
@@ -15952,7 +15953,7 @@ The @command{kill} command also supports the @option{--help} and
 A @var{signal} may be a signal name like @samp{HUP}, or a signal
 number like @samp{1}, or an exit status of a process terminated by the
 signal.  A signal name can be given in canonical form or prefixed by
-@samp{SIG}.  The case of the letters is ignored, except for the
+@samp{SIG}@.  The case of the letters is ignored, except for the
 @option{-@var{signal}} option which must use upper case to avoid
 ambiguity with lower case option letters.
 @xref{Signal specifications}, for a list of supported
@@ -16119,7 +16120,7 @@ Options must precede operands.
 Print all numbers using @var{format}.
 @var{format} must contain exactly one of the @samp{printf}-style
 floating point conversion specifications @samp{%a}, @samp{%e},
-@samp{%f}, @samp{%g}, @samp{%A}, @samp{%E}, @samp{%F}, @samp{%G}.
+@samp{%f}, @samp{%g}, @samp{%A}, @samp{%E}, @samp{%F}, @samp{%G}@.
 The @samp{%} may be followed by zero or more flags taken from the set
 @samp{-+#0 '}, then an optional width containing one or more digits,
 then an optional precision consisting of a @samp{.} followed by zero
@@ -16221,7 +16222,7 @@ outputs 1.0000000000000000007 twice and skips 1.0000000000000000008.
 
 An earlier version of this chapter appeared in
 @uref{http://www.linuxjournal.com/article.php?sid=2762, the
-@cite{What's GNU?} column of the June 1994 @cite{Linux Journal}}.
+@cite{What's GNU@?} column of the June 1994 @cite{Linux Journal}}.
 It was written by Arnold Robbins.
 
 @menu
-- 
1.7.6.5



From MAILER-DAEMON Fri Jul 06 11:18:17 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SnAIT-0005vq-Tc
	for mharc-coreutils@gnu.org; Fri, 06 Jul 2012 11:18:17 -0400
Received: from eggs.gnu.org ([208.118.235.92]:44857)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1SnAIR-0005v7-5K
	for coreutils@gnu.org; Fri, 06 Jul 2012 11:18:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1SnAIM-0000pt-4w
	for coreutils@gnu.org; Fri, 06 Jul 2012 11:18:14 -0400
Received: from mail-ob0-f169.google.com ([209.85.214.169]:45016)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1SnAIL-0000pi-UJ
	for coreutils@gnu.org; Fri, 06 Jul 2012 11:18:10 -0400
Received: by obhx4 with SMTP id x4so12869441obh.0
	for <coreutils@gnu.org>; Fri, 06 Jul 2012 08:18:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=VKwE44r59MIEQ0ZhOVk6ygIiylzId//Ffl2YsfrAqII=;
	b=ALBuAjk28wy1WP03xsGO5tthVtzfwjsutvjfTQBxDgoMyhv6aVkahkkyOgKBvXHmtK
	TgXK13qqGzYVbVlm8V0X8F5z8HxkQa2AdrT8AD3TkefxhI2OJ66GLVYciKy2ZpOarzI/
	gzbaxwsft6GPCo83RqF+LhPX7uBilGl9FI2OeEQ40KoGLYKpEImJKdJzBoD+Xq93nuWb
	HWS09wZiE4C1TZgNOVP/5+IYhSpjNw3L+VpNnvyoJNcFGNdGyJTsXWdy+uulMYsaiS3J
	QpOOxx2XWX9McxfruWJblfaFmm6Oc+KVIA1vqSMmdYV77rUQxhR7qYtAFLXhj7s9Tk96
	UiTQ==
MIME-Version: 1.0
Received: by 10.182.53.103 with SMTP id a7mr25936587obp.3.1341587887240; Fri,
	06 Jul 2012 08:18:07 -0700 (PDT)
Received: by 10.182.33.68 with HTTP; Fri, 6 Jul 2012 08:18:06 -0700 (PDT)
Date: Fri, 6 Jul 2012 10:18:06 -0500
Message-ID: <CABrM6wmpHr+Gfmk9JKfCfKaQK2YPUrA1w40dJJB8V5ZG_Vk-9g@mail.gmail.com>
Subject: What is the difference between --binary and the default of md5sum?
From: Peng Yu <pengyu.ut@gmail.com>
To: Coreutils <coreutils@gnu.org>
Content-Type: text/plain; charset=ISO-8859-1
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.214.169
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 06 Jul 2012 15:18:16 -0000

Hi,

I don't see any difference between the two md5sum commands (on Mac OS).

~/linux/test/gnu/gnu/coreutils/md5sum/--binary$ ./main.sh
md5sum `which md5sum`
which md5sum
02389bdcb510f7a2667f94c4264bebd8  /opt/local/libexec/gnubin/md5sum
md5sum -b `which md5sum`
which md5sum
02389bdcb510f7a2667f94c4264bebd8 */opt/local/libexec/gnubin/md5sum

~/linux/test/gnu/gnu/coreutils/md5sum/--binary$ cat main.sh
#!/usr/bin/env bash

set -v
md5sum `which md5sum`
md5sum -b `which md5sum`

As mentioned at http://cygwin.com/cygwin-ug-net/using-textbinary.html,
the difference between --binary and default is only important on
windows, right?

-- 
Regards,
Peng


From MAILER-DAEMON Sun Jul 08 15:45:32 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SnxQC-0008QF-Bu
	for mharc-coreutils@gnu.org; Sun, 08 Jul 2012 15:45:32 -0400
Received: from eggs.gnu.org ([208.118.235.92]:54489)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SnxQ9-0008PO-Hx
	for coreutils@gnu.org; Sun, 08 Jul 2012 15:45:31 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SnxQ7-0000gN-KF
	for coreutils@gnu.org; Sun, 08 Jul 2012 15:45:29 -0400
Received: from mx.meyering.net ([88.168.87.75]:38960)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SnxQ7-0000ey-Cu
	for coreutils@gnu.org; Sun, 08 Jul 2012 15:45:27 -0400
Received: from rho.meyering.net (rho.meyering.net [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 2C21260178;
	Sun,  8 Jul 2012 21:45:25 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Jeff Janes <jeff.janes@gmail.com>
Subject: Re: [PATCH] maint: cleanup size determination in sort [was: overly
	aggressive memory usage by sort.c]
In-Reply-To: <4FE1D578.5020109@cs.ucla.edu> (Paul Eggert's message of "Wed, 20
	Jun 2012 06:51:52 -0700")
References: <CAMkU=1zDA=RFzxb-O_x2TG+EumrdUebZJb4UOJAM_xretGpCCA@mail.gmail.com>
	<4FD1431C.5010500@draigBrady.com> <878vfu9x7o.fsf@rho.meyering.net>
	<4FD5C249.7090907@cs.ucla.edu> <4FD5CF65.7000609@cs.ucla.edu>
	<A75C39900FCF0B42A2CE8B26F837D2C3010923@MCHP02MSX.global-ad.net>
	<4FD629CC.4030908@cs.ucla.edu> <4FD97E52.6070202@bernhard-voelker.de>
	<87r4tawizr.fsf@rho.meyering.net>
	<CAMkU=1xRUkL=ZEFhtJ5vU4h4dWXm=XdHR7Kc8gTux1vozUYRUg@mail.gmail.com>
	<87wr32up7y.fsf@rho.meyering.net> <4FE1D578.5020109@cs.ucla.edu>
Date: Sun, 08 Jul 2012 21:45:25 +0200
Message-ID: <87hatighpm.fsf@rho.meyering.net>
Lines: 56
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: 88.168.87.75
Cc: Paul Eggert <eggert@cs.ucla.edu>,
	Bernhard Voelker <mail@bernhard-voelker.de>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 08 Jul 2012 19:45:31 -0000

Paul Eggert wrote:
> On 06/20/2012 05:45 AM, Jim Meyering wrote:
>> Bernhard's patch was quite deliberately (as the commit log says)
>> intended to induce no semantic change.
>
> Following up on this, here's an updated version of a patch that
> should fix the problem that Jeff Janes reported in
> <http://lists.gnu.org/archive/html/coreutils/2012-06/msg00018.html>.,
> while not reintroducing bug 10877.  Jeff, can you please try this out in
> your environment?  It'd be nicer if it could be verified to work
> there.  Thanks.

Hi Jeff,
Does Paul's patch solve your problem?

>>From ad47c76273b84d64d1c612b2cc49e9679b187004 Mon Sep 17 00:00:00 2001
> From: Paul Eggert <eggert@cs.ucla.edu>
> Date: Mon, 11 Jun 2012 02:47:05 -0700
> Subject: [PATCH] sort: by default, do not exceed 3/4 of physical memory
>
> * src/sort.c (default_sort_size): Do not exceed 3/4 of total memory.
> See Jeff Janes's bug report in
> <http://lists.gnu.org/archive/html/coreutils/2012-06/msg00018.html>.
> ---
>  src/sort.c |   11 ++++++++---
>  1 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/src/sort.c b/src/sort.c
> index 5a48ce6..4036059 100644
> --- a/src/sort.c
> +++ b/src/sort.c
> @@ -1404,9 +1404,10 @@ specify_nthreads (int oi, char c, char const *s)
>  static size_t
>  default_sort_size (void)
>  {
> -  /* Let SIZE be MEM, but no more than the maximum object size or
> -     system resource limits.  Don't bother to check for values like
> -     RLIM_INFINITY since in practice they are not much less than SIZE_MAX.  */
> +  /* Let SIZE be MEM, but no more than the maximum object size,
> +     total memory, or system resource limits.  Don't bother to check
> +     for values like RLIM_INFINITY since in practice they are not much
> +     less than SIZE_MAX.  */
>    size_t size = SIZE_MAX;
>    struct rlimit rlimit;
>    if (getrlimit (RLIMIT_DATA, &rlimit) == 0 && rlimit.rlim_cur < size)
> @@ -1433,6 +1434,10 @@ default_sort_size (void)
>    double total = physmem_total ();
>    double mem = MAX (avail, total / 8);
>
> +  /* Leave a 1/4 margin for physical memory.  */
> +  if (total * 0.75 < size)
> +    size = total * 0.75;
> +
>    /* Return the minimum of MEM and SIZE, but no less than
>       MIN_SORT_SIZE.  Avoid the MIN macro here, as it is not quite
>       right when only one argument is floating point.  */


From MAILER-DAEMON Mon Jul 09 06:30:40 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SoBEm-0000b8-UO
	for mharc-coreutils@gnu.org; Mon, 09 Jul 2012 06:30:40 -0400
Received: from eggs.gnu.org ([208.118.235.92]:33593)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SoBEh-0000ZD-2d
	for coreutils@gnu.org; Mon, 09 Jul 2012 06:30:39 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SoBEa-0005cP-MZ
	for coreutils@gnu.org; Mon, 09 Jul 2012 06:30:34 -0400
Received: from mx1.redhat.com ([209.132.183.28]:42660)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SoBEa-0005b3-CG
	for coreutils@gnu.org; Mon, 09 Jul 2012 06:30:28 -0400
Received: from int-mx02.intmail.prod.int.phx2.redhat.com
	(int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q69AUPQ6025886
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 9 Jul 2012 06:30:25 -0400
Received: from [10.3.113.26] (ovpn-113-26.phx2.redhat.com [10.3.113.26])
	by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id q69AUO93005924; Mon, 9 Jul 2012 06:30:24 -0400
Message-ID: <4FFAB2BF.6010404@redhat.com>
Date: Mon, 09 Jul 2012 04:30:23 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:13.0) Gecko/20120615 Thunderbird/13.0.1
MIME-Version: 1.0
To: Peng Yu <pengyu.ut@gmail.com>
Subject: Re: What is the difference between --binary and the default of md5sum?
References: <CABrM6wmpHr+Gfmk9JKfCfKaQK2YPUrA1w40dJJB8V5ZG_Vk-9g@mail.gmail.com>
In-Reply-To: <CABrM6wmpHr+Gfmk9JKfCfKaQK2YPUrA1w40dJJB8V5ZG_Vk-9g@mail.gmail.com>
X-Enigmail-Version: 1.4.2
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="------------enig5F837D4EFDF347DEF97101C6"
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Jul 2012 10:30:40 -0000

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig5F837D4EFDF347DEF97101C6
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 07/06/2012 09:18 AM, Peng Yu wrote:
> Hi,
>=20
> I don't see any difference between the two md5sum commands (on Mac OS).=

>=20
> ~/linux/test/gnu/gnu/coreutils/md5sum/--binary$ ./main.sh
> md5sum `which md5sum`
> which md5sum
> 02389bdcb510f7a2667f94c4264bebd8  /opt/local/libexec/gnubin/md5sum
> md5sum -b `which md5sum`
> which md5sum
> 02389bdcb510f7a2667f94c4264bebd8 */opt/local/libexec/gnubin/md5sum
>=20
> ~/linux/test/gnu/gnu/coreutils/md5sum/--binary$ cat main.sh
> #!/usr/bin/env bash
>=20
> set -v
> md5sum `which md5sum`
> md5sum -b `which md5sum`
>=20
> As mentioned at http://cygwin.com/cygwin-ug-net/using-textbinary.html,
> the difference between --binary and default is only important on
> windows, right?

It only matters on non-posix systems where fopen(name,"rb") behaves
differently from fopen(name,"r").  Windows is the most popular of these
systems; and you are correct that Mac OS is not impacted.

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




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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJP+rLAAAoJEKeha0olJ0Nq1+UH/2GbAnJNKPnquKDCJNDCgP8l
e6klRHd7x9OQFrScYuQXCF68icwLE58YaW5ZzjYBj+5Va0OwkUV2m56JzCP/vToY
WlqLBI9ZEXAFbq6NkTbbWBcp5wcL5p3LF4qhhvlLyynQitOF7Uo1dtZjDzq35DIC
XpkeY2ft/3svej4DLImUHF1BlZGdnzn4k3YI7S+mwdEuuN9TksOlqYoUuuJvG2iS
qhW1rHJbpKDgz4ynlpktVohIyhD3fgtMRX1H8zf8uPAS5bSySgCq5uVSsoW3ppAM
3YRJFTIw/nhK0lTqJmFZCmzaVtT2Us7CYtmv/NIFDNDj5uHiSwQpyqhfj5SAT1Q=
=t89R
-----END PGP SIGNATURE-----

--------------enig5F837D4EFDF347DEF97101C6--


From MAILER-DAEMON Mon Jul 09 09:27:28 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SoDzs-0005h1-QV
	for mharc-coreutils@gnu.org; Mon, 09 Jul 2012 09:27:28 -0400
Received: from eggs.gnu.org ([208.118.235.92]:48504)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SoDzj-00059G-8E
	for coreutils@gnu.org; Mon, 09 Jul 2012 09:27:25 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SoDzd-0002HI-C3
	for coreutils@gnu.org; Mon, 09 Jul 2012 09:27:18 -0400
Received: from mx.meyering.net ([88.168.87.75]:41481)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SoDzd-0002Gz-1D
	for coreutils@gnu.org; Mon, 09 Jul 2012 09:27:13 -0400
Received: from rho.meyering.net (rho.meyering.net [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id AE0D260475;
	Mon,  9 Jul 2012 15:27:11 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: kerolasa@gmail.com
Subject: Re: rename: move command from util-linux to coreutils
In-Reply-To: <CAG27Bk3B9qH8g5aaFv-b0ASATb7sFCMrOJ8gWkif278O1bD+ow@mail.gmail.com>
	(Sami Kerola's message of "Sun, 17 Jun 2012 23:22:47 +0200")
References: <CAG27Bk0dwWn9L8MJ8x5TBchNvZ5CY2y+ATeAmypDqZi1Y8esZw@mail.gmail.com>
	<871ulmc3bj.fsf@rho.meyering.net>
	<CAG27Bk0VuuGbe2nC9-gW+bEoGjA3v6Lw30V-enUSNAHT5cTbfw@mail.gmail.com>
	<87k3ze9xfd.fsf@rho.meyering.net>
	<CAG27Bk3B9qH8g5aaFv-b0ASATb7sFCMrOJ8gWkif278O1bD+ow@mail.gmail.com>
Date: Mon, 09 Jul 2012 15:27:11 +0200
Message-ID: <87r4sldpzk.fsf@rho.meyering.net>
Lines: 95
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Jul 2012 13:27:26 -0000

Sami Kerola wrote:
> On Mon, Jun 11, 2012 at 8:26 AM, Jim Meyering <jim@meyering.net> wrote:
>> Sami Kerola wrote:
>>> On Sun, Jun 10, 2012 at 10:36 PM, Jim Meyering <jim@meyering.net> wrote:
>>>> Here's some quick feedback after a very cursory look:
>>>> I see unchecked syscalls, from write and waitpid to close and dup2.
>>>
>>> I'll correct that to my git tomorrow.
>>>
>>>> Style nits: I saw "TYPE * var_name" in at least one declaration.
>>>> I think it was a parameter list.
>>>> It should be "TYPE *var_name".
>>>
>>> Uh, oh. I cannot trust 'indent -gnu rename.c' fixing everything. I
>>> will fix this at same go with unchecked syscalls.
>>
>> With GNU indent, you have to specify types that are unknown
>> to it via e.g., -Tuintmax_t
>>
>>>> I also saw a TAB or two used in indentation. =A0Use only spaces.
>>>> If you run "make syntax-check", it will show you where.
>>>
>>> Same for this.
>>
>> Use indent --no-tabs
>>
>>>> Providing more test coverage would be most useful/welcome.
>>>
>>> I will write at least --exec test.
>>
>> Good. =A0Thanks!
>
> Hi Jim et.al.
>
> My most sincerest apologies, I should not promise do anything during
> weekdays (I said something about delivering fixes at Tuesday). Now at
> the end of weekend there are some fixes in my branch, which are pushed
> with force.
>
>   git://github.com/kerolasa/coreutils.git rename
>
> * Attempt to find, and do something, for all system calls which return
> value was not checked.
> * Style fixes, e.g. pointer types, tabs etc.
> * All issues 'make syntax-check' reported are fixed.
> * There is a very basic --exec option test.
>
> Hopefully the change is now closer to ready.

Hi Sami,

Thanks for the fixes.
There is too much new and untested code to include this new program
in the upcoming release.

A few things should be changed regardless.
For consistency with other GNU tools:

  s/--test/--dry-run/

Also, please ensure that your new code compiles
when configure with --enable-gcc-warnings.
Currently I see several warnings:

  ...
  rename.c: In function 'construct_dest_name':
  rename.c:122:34: error: declaration of 'replacement' shadows a global dec=
laration [-Werror=3Dshadow]
                        const char *replacement)
                                    ^
  rename.c:71:14: error: shadowed declaration is here [-Werror=3Dshadow]
   static char *replacement;
                ^
  rename.c: In function 'main':
  rename.c:446:24: error: assignment discards 'const' qualifier from pointe=
r target type [-Werror]
               files_from =3D "-";
                          ^
  rename.c:458:24: error: assignment discards 'const' qualifier from pointe=
r target type [-Werror]
               files_from =3D "-";
                          ^
  rename.c:527:18: error: assignment discards 'const' qualifier from pointe=
r target type [-Werror]
         files_from =3D "-";
                    ^
  rename.c: In function 'request_child':
  rename.c:234:18: error: ignoring return value of 'fgets_unlocked', declar=
ed with attribute warn_unused_result [-Werror=3Dunused-result]
     fgets (ret + skip, PATH_MAX - skip, mother_file);
                    ^
  cc1: all warnings being treated as errors
  make[3]: *** [rename.o] Error 1
  make[3]: *** Waiting for unfinished jobs....
  make[3]: Leaving directory `/h/j/w/co/cu-sami-kerola-rename/src'
  make[2]: *** [all] Error 2
  make[2]: Leaving directory `/h/j/w/co/cu-sami-kerola-rename/src'
  make[1]: *** [all-recursive] Error 1
  make[1]: Leaving directory `/h/j/w/co/cu-sami-kerola-rename'
  make: *** [all] Error 2


From MAILER-DAEMON Mon Jul 09 12:16:07 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SoGd5-0001WF-FJ
	for mharc-coreutils@gnu.org; Mon, 09 Jul 2012 12:16:07 -0400
Received: from eggs.gnu.org ([208.118.235.92]:43836)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SoGd2-0001Ut-Np
	for coreutils@gnu.org; Mon, 09 Jul 2012 12:16:06 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SoGcx-0002ut-1b
	for coreutils@gnu.org; Mon, 09 Jul 2012 12:16:04 -0400
Received: from qmta01.emeryville.ca.mail.comcast.net ([76.96.30.16]:48811)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SoGcw-0002uI-On
	for coreutils@gnu.org; Mon, 09 Jul 2012 12:15:58 -0400
Received: from omta21.emeryville.ca.mail.comcast.net ([76.96.30.88])
	by qmta01.emeryville.ca.mail.comcast.net with comcast
	id YF4v1j0091u4NiLA1GFwg3; Mon, 09 Jul 2012 16:15:56 +0000
Received: from [192.168.0.16] ([24.10.251.25])
	by omta21.emeryville.ca.mail.comcast.net with comcast
	id YGFv1j00H0ZdyUg8hGFwu9; Mon, 09 Jul 2012 16:15:56 +0000
Message-ID: <4FFB03B9.6090806@redhat.com>
Date: Mon, 09 Jul 2012 10:15:53 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:13.0) Gecko/20120615 Thunderbird/13.0.1
MIME-Version: 1.0
To: Karel Zak <kzak@redhat.com>
Subject: Re: ifdef HAVE_DECL_
References: <20120613093233.GA10561@x2.net.home>
	<20120613094533.GB10561@x2.net.home>
In-Reply-To: <20120613094533.GB10561@x2.net.home>
X-Enigmail-Version: 1.4.2
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="------------enigBDC3E5AA5BA5F2567013943E"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 76.96.30.16
Cc: bug-gnulib <bug-gnulib@gnu.org>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 09 Jul 2012 16:16:06 -0000

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigBDC3E5AA5BA5F2567013943E
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

[adding gnulib]

On 06/13/2012 03:45 AM, Karel Zak wrote:
> On Wed, Jun 13, 2012 at 11:32:33AM +0200, Karel Zak wrote:
> =20
>>  More complex (and I hope without false positives) solution:
> =20
>  well... ;-)
>=20
>>
>>  for decl in $(awk '/define HAVE_DECL_.*ac_have_decl/ { print $2 }' co=
nfigure); do=20
>>     grep -rnE '[[:blank:]]*#[[:blank:]]*if(ndef|def)[[:blank:]]*'$decl=
 *; done | sort -u
>>

>>  gnulib/lib/argp-parse.c:882:#ifdef HAVE_DECL_PROGRAM_INVOCATION_NAME
>>  gnulib/lib/argp-parse.c:886:#ifdef HAVE_DECL_PROGRAM_INVOCATION_SHORT=
_NAME
>=20
>  this seems like a bug

Indeed.  Coreutils isn't using gnulib's argp-parse, but other projects ar=
e.

>=20
>>  gnulib/lib/error.c:103:#  ifndef HAVE_DECL_STRERROR_R
>>  gnulib/lib/fpending.h:24:#ifndef HAVE_DECL___FPENDING
>>  gnulib/lib/strtoimax.c:31:# ifndef HAVE_DECL_STRTOULL
>>  gnulib/lib/strtoimax.c:40:# ifndef HAVE_DECL_STRTOLL

>=20
>  and this like false positives (there is #if before #ifndef)

Yes, those are false positives.

>=20
>>  m4/strndup.m4:27:#ifndef HAVE_DECL_STRNDUP
>=20
>  not sure

Like argp-parse.c, this is indeed a bug in gnulib; and in this case, it
does affect coreutils.

--=20

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



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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJP+wO6AAoJEKeha0olJ0NqlKIH/AuBmbc8PzGjXPBOjkmnRkdJ
ctA3OH2Fn0abluWx3TMY1C5+fCF1zzP4nDMAUuwJnMceQJqQ9fh/WVJ9VSRZua7i
ELnQ6uCtXecMXOeQ9z9x0fIb09hKIV5TYo07xpPbRU+Xo3PhQifbO6o4IC5TkXsl
YlYtT0nqps0hsL9Oa1KCb8QyTcMk1uXSv45mPnb8I8EhY87PU3fwl9vPSoTJjqIb
pSEYH/HA+MghPq1s3AIO/X9hZCGpKAoJTFixiuQkrBPNnNrGGruj2m/izGbBk+p2
UksWMRBG/U3V+KBl7Onng2k+18E7g+aU73iqTvTI5RD2p/BS2bW4+l3quAb6LXQ=
=3Dw5
-----END PGP SIGNATURE-----

--------------enigBDC3E5AA5BA5F2567013943E--


From MAILER-DAEMON Tue Jul 10 10:32:06 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SobTy-0002TJ-Tz
	for mharc-coreutils@gnu.org; Tue, 10 Jul 2012 10:32:06 -0400
Received: from eggs.gnu.org ([208.118.235.92]:34330)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jeff.janes@gmail.com>) id 1SobTr-0002SF-Sg
	for coreutils@gnu.org; Tue, 10 Jul 2012 10:32:05 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jeff.janes@gmail.com>) id 1SobTl-0007KJ-G5
	for coreutils@gnu.org; Tue, 10 Jul 2012 10:31:59 -0400
Received: from mail-qc0-f169.google.com ([209.85.216.169]:49839)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jeff.janes@gmail.com>) id 1SobTl-0007K6-9S
	for coreutils@gnu.org; Tue, 10 Jul 2012 10:31:53 -0400
Received: by qcsd16 with SMTP id d16so47451qcs.0
	for <coreutils@gnu.org>; Tue, 10 Jul 2012 07:31:50 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:content-transfer-encoding;
	bh=NNXT8tywQcRYJBfLmMC4U2Itz6my6hJEqIxTlqrQfrU=;
	b=zzUFD2kXjxIo9I8O1Eztq3YmZ82f9B+gXDHtTWvBEFViejC1vQG8N5yuaYzqAjbXmv
	y1hdu0O4IiF71caMw87iRubwUIpmMG/WczxrYqIoUP5c9EXM4eN+93ANuyKkNZ8aBIsD
	DGpc3WlJwNOaObitq7+5UW3eXVisE2xgI6gTJwLKo6wEmYOvWiGUGH5IilEuvjGKbpFj
	hixjhT7dyI1sNVw2351Joo0nKoi8Ys8frq7LHPee5TC1PZlJnO/ScO1cBrmrMpMDMt03
	AD0Vvxc+uR0NtM8vSedOBizvynG+SBTGnOCI0gDtdouoh/xH3yGPZYdV6slMhRu+NO4h
	ra8w==
MIME-Version: 1.0
Received: by 10.50.46.230 with SMTP id y6mr11425467igm.20.1341930710524; Tue,
	10 Jul 2012 07:31:50 -0700 (PDT)
Received: by 10.42.80.65 with HTTP; Tue, 10 Jul 2012 07:31:50 -0700 (PDT)
In-Reply-To: <87hatighpm.fsf@rho.meyering.net>
References: <CAMkU=1zDA=RFzxb-O_x2TG+EumrdUebZJb4UOJAM_xretGpCCA@mail.gmail.com>
	<4FD1431C.5010500@draigBrady.com> <878vfu9x7o.fsf@rho.meyering.net>
	<4FD5C249.7090907@cs.ucla.edu> <4FD5CF65.7000609@cs.ucla.edu>
	<A75C39900FCF0B42A2CE8B26F837D2C3010923@MCHP02MSX.global-ad.net>
	<4FD629CC.4030908@cs.ucla.edu>
	<4FD97E52.6070202@bernhard-voelker.de>
	<87r4tawizr.fsf@rho.meyering.net>
	<CAMkU=1xRUkL=ZEFhtJ5vU4h4dWXm=XdHR7Kc8gTux1vozUYRUg@mail.gmail.com>
	<87wr32up7y.fsf@rho.meyering.net> <4FE1D578.5020109@cs.ucla.edu>
	<87hatighpm.fsf@rho.meyering.net>
Date: Tue, 10 Jul 2012 07:31:50 -0700
Message-ID: <CAMkU=1zKqeBt2KRAue=HNjnXzim0zRqpjQwrtLWaf-=zNswkVw@mail.gmail.com>
Subject: Re: [PATCH] maint: cleanup size determination in sort [was: overly
	aggressive memory usage by sort.c]
From: Jeff Janes <jeff.janes@gmail.com>
To: Jim Meyering <jim@meyering.net>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.216.169
Cc: Paul Eggert <eggert@cs.ucla.edu>,
	Bernhard Voelker <mail@bernhard-voelker.de>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Jul 2012 14:32:05 -0000

On Sun, Jul 8, 2012 at 12:45 PM, Jim Meyering <jim@meyering.net> wrote:
> Paul Eggert wrote:
>> On 06/20/2012 05:45 AM, Jim Meyering wrote:
>>> Bernhard's patch was quite deliberately (as the commit log says)
>>> intended to induce no semantic change.
>>
>> Following up on this, here's an updated version of a patch that
>> should fix the problem that Jeff Janes reported in
>> <http://lists.gnu.org/archive/html/coreutils/2012-06/msg00018.html>.,
>> while not reintroducing bug 10877. =A0Jeff, can you please try this out =
in
>> your environment? =A0It'd be nicer if it could be verified to work
>> there. =A0Thanks.
>
> Hi Jeff,
> Does Paul's patch solve your problem?

Sorry, after taking the time to test it, I forgot to report the results.

Yes, that fixed the problem.

Thanks,

Jeff


From MAILER-DAEMON Tue Jul 10 19:17:34 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SojgU-0001KC-1n
	for mharc-coreutils@gnu.org; Tue, 10 Jul 2012 19:17:34 -0400
Received: from eggs.gnu.org ([208.118.235.92]:54579)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1SojgS-0001Jl-BR
	for coreutils@gnu.org; Tue, 10 Jul 2012 19:17:33 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1SojgQ-0002LM-Ne
	for coreutils@gnu.org; Tue, 10 Jul 2012 19:17:31 -0400
Received: from smtp.cs.ucla.edu ([131.179.128.62]:54629)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1SojgQ-0002Kv-Hs
	for coreutils@gnu.org; Tue, 10 Jul 2012 19:17:30 -0400
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id 7FA0039E800A;
	Tue, 10 Jul 2012 16:17:28 -0700 (PDT)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
Received: from smtp.cs.ucla.edu ([127.0.0.1])
	by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id KGmYXyuCgGF0; Tue, 10 Jul 2012 16:17:28 -0700 (PDT)
Received: from [192.168.1.4] (pool-108-23-119-2.lsanca.fios.verizon.net
	[108.23.119.2])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 1512E39E8007;
	Tue, 10 Jul 2012 16:17:28 -0700 (PDT)
Message-ID: <4FFCB808.5010108@cs.ucla.edu>
Date: Tue, 10 Jul 2012 16:17:28 -0700
From: Paul Eggert <eggert@cs.ucla.edu>
Organization: UCLA Computer Science Department
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:13.0) Gecko/20120615 Thunderbird/13.0.1
MIME-Version: 1.0
To: Jeff Janes <jeff.janes@gmail.com>
Subject: Re: [PATCH] maint: cleanup size determination in sort [was: overly
	aggressive memory usage by sort.c]
References: <CAMkU=1zDA=RFzxb-O_x2TG+EumrdUebZJb4UOJAM_xretGpCCA@mail.gmail.com>
	<4FD1431C.5010500@draigBrady.com> <878vfu9x7o.fsf@rho.meyering.net>
	<4FD5C249.7090907@cs.ucla.edu> <4FD5CF65.7000609@cs.ucla.edu>
	<A75C39900FCF0B42A2CE8B26F837D2C3010923@MCHP02MSX.global-ad.net>
	<4FD629CC.4030908@cs.ucla.edu>
	<4FD97E52.6070202@bernhard-voelker.de>
	<87r4tawizr.fsf@rho.meyering.net>
	<CAMkU=1xRUkL=ZEFhtJ5vU4h4dWXm=XdHR7Kc8gTux1vozUYRUg@mail.gmail.com>
	<87wr32up7y.fsf@rho.meyering.net> <4FE1D578.5020109@cs.ucla.edu>
	<87hatighpm.fsf@rho.meyering.net>
	<CAMkU=1zKqeBt2KRAue=HNjnXzim0zRqpjQwrtLWaf-=zNswkVw@mail.gmail.com>
In-Reply-To: <CAMkU=1zKqeBt2KRAue=HNjnXzim0zRqpjQwrtLWaf-=zNswkVw@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 131.179.128.62
Cc: Bernhard Voelker <mail@bernhard-voelker.de>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 10 Jul 2012 23:17:33 -0000

On 07/10/2012 07:31 AM, Jeff Janes wrote:
> Yes, that fixed the problem.

OK, thanks for checking; I pushed it into the coreutils
master on savannah.


From MAILER-DAEMON Wed Jul 11 12:28:15 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sozlv-0002BK-7K
	for mharc-coreutils@gnu.org; Wed, 11 Jul 2012 12:28:15 -0400
Received: from eggs.gnu.org ([208.118.235.92]:39002)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1Sozlo-00029B-82
	for coreutils@gnu.org; Wed, 11 Jul 2012 12:28:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1Sozlj-0002t1-KG
	for coreutils@gnu.org; Wed, 11 Jul 2012 12:28:07 -0400
Received: from mail-ob0-f169.google.com ([209.85.214.169]:55978)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1Sozlj-0002si-Cr
	for coreutils@gnu.org; Wed, 11 Jul 2012 12:28:03 -0400
Received: by obhx4 with SMTP id x4so2165988obh.0
	for <coreutils@gnu.org>; Wed, 11 Jul 2012 09:27:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=wf8eJtTMYMFiXKIQ/b1k8AOOSB9lQH+D4lXpIbzWxq0=;
	b=lOvBKm4a1T6ZTClNMqYMHYEAFjctGnfcm/08IVFZEersyIJjlNfVBEcRUNndIrooxu
	xoST4fkenA18AvKVDS5eqdjCzvVLhv0v7mxtnar3Kk35vWVFK4MZnik6btb+3++DC6ka
	/BORIEI7BcriIiZpXtZfk+HdmXk1NpVMWcRKmRt66wbP0eXf95Nz4zQTaL5bAQ0hiH9b
	/5oGCqacD3vtCu2RDjxb+/kUqQWQ3zXYoNQsW+zLXhUX7YNYGe0F0pd5LMuozb5qcf4j
	UHRKGaYVIhApXc27x7hUERqVOMN72+CLlAE2EkQlcr5YasfP8GL2Hupedz3tSUhzwuW6
	h0CQ==
MIME-Version: 1.0
Received: by 10.60.26.65 with SMTP id j1mr52053463oeg.9.1342024078649; Wed, 11
	Jul 2012 09:27:58 -0700 (PDT)
Received: by 10.182.33.68 with HTTP; Wed, 11 Jul 2012 09:27:58 -0700 (PDT)
Date: Wed, 11 Jul 2012 11:27:58 -0500
Message-ID: <CABrM6wnSpqmdz-OaYYQ12ph-BJ9+mFmZbHq=JVBM5YkgL++iYw@mail.gmail.com>
Subject: cp with subdirectories following some pattern removed?
From: Peng Yu <pengyu.ut@gmail.com>
To: Coreutils <coreutils@gnu.org>
Content-Type: text/plain; charset=ISO-8859-1
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.214.169
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Jul 2012 16:28:14 -0000

Hi,

I need to cp a directories with all the the subdirectories matching a
pattern removed (ignore all the test* subdirectories). There can be
many solutions to this problem. I'm wondering if anybody is aware of
an easy and robust solution. Thanks!

-- 
Regards,
Peng


From MAILER-DAEMON Wed Jul 11 14:36:37 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sp1m9-0005PK-NF
	for mharc-coreutils@gnu.org; Wed, 11 Jul 2012 14:36:37 -0400
Received: from eggs.gnu.org ([208.118.235.92]:48819)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1Sp1m7-0005OS-HZ
	for coreutils@gnu.org; Wed, 11 Jul 2012 14:36:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1Sp1m6-000877-FP
	for coreutils@gnu.org; Wed, 11 Jul 2012 14:36:35 -0400
Received: from mx1.redhat.com ([209.132.183.28]:24656)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1Sp1m6-00086v-7Q
	for coreutils@gnu.org; Wed, 11 Jul 2012 14:36:34 -0400
Received: from int-mx11.intmail.prod.int.phx2.redhat.com
	(int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6BIa2uX029387
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 11 Jul 2012 14:36:31 -0400
Received: from [10.36.116.75] (ovpn-116-75.ams2.redhat.com [10.36.116.75])
	by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q6BHK6NR014795
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Wed, 11 Jul 2012 13:20:07 -0400
Message-ID: <4FFDB5C5.7050903@draigBrady.com>
Date: Wed, 11 Jul 2012 18:20:05 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Peng Yu <pengyu.ut@gmail.com>
Subject: Re: cp with subdirectories following some pattern removed?
References: <CABrM6wnSpqmdz-OaYYQ12ph-BJ9+mFmZbHq=JVBM5YkgL++iYw@mail.gmail.com>
	<4FFDB423.30900@draigBrady.com>
In-Reply-To: <4FFDB423.30900@draigBrady.com>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=ISO-8859-1
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id
	q6BIa2uX029387
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Jul 2012 18:36:36 -0000

On 07/11/2012 06:13 PM, P=E1draig Brady wrote:
> On 07/11/2012 05:27 PM, Peng Yu wrote:
>> Hi,
>>
>> I need to cp a directories with all the the subdirectories matching a
>> pattern removed (ignore all the test* subdirectories). There can be
>> many solutions to this problem. I'm wondering if anybody is aware of
>> an easy and robust solution. Thanks!
>=20
> This sort of thing is surprisingly tricky.
> I've used something like the following in the past:
>=20
> (cd dir1 && find -mindepth 1 \( -type d -a -name 'test*' \) -prune -o -=
print0 |
>  tar --null -T- -c) |
> (cd dir2 && tar -x)
>=20
> The above can be easily extended by putting ssh in the pipe.

The first tar should have --no-recursion specified also for efficiency

cheers,
P=E1draig.


From MAILER-DAEMON Wed Jul 11 14:36:45 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sp1mH-0005Sn-Rh
	for mharc-coreutils@gnu.org; Wed, 11 Jul 2012 14:36:45 -0400
Received: from eggs.gnu.org ([208.118.235.92]:48870)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1Sp1mF-0005S2-Ji
	for coreutils@gnu.org; Wed, 11 Jul 2012 14:36:44 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1Sp1mE-000891-Lt
	for coreutils@gnu.org; Wed, 11 Jul 2012 14:36:43 -0400
Received: from mx1.redhat.com ([209.132.183.28]:33132)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1Sp1mE-00088n-Dc
	for coreutils@gnu.org; Wed, 11 Jul 2012 14:36:42 -0400
Received: from int-mx12.intmail.prod.int.phx2.redhat.com
	(int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6BIaMon012455
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 11 Jul 2012 14:36:41 -0400
Received: from [10.36.116.75] (ovpn-116-75.ams2.redhat.com [10.36.116.75])
	by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q6BHD7vn020316
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Wed, 11 Jul 2012 13:13:09 -0400
Message-ID: <4FFDB423.30900@draigBrady.com>
Date: Wed, 11 Jul 2012 18:13:07 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Peng Yu <pengyu.ut@gmail.com>
Subject: Re: cp with subdirectories following some pattern removed?
References: <CABrM6wnSpqmdz-OaYYQ12ph-BJ9+mFmZbHq=JVBM5YkgL++iYw@mail.gmail.com>
In-Reply-To: <CABrM6wnSpqmdz-OaYYQ12ph-BJ9+mFmZbHq=JVBM5YkgL++iYw@mail.gmail.com>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=ISO-8859-1
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id
	q6BIaMon012455
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Jul 2012 18:36:44 -0000

On 07/11/2012 05:27 PM, Peng Yu wrote:
> Hi,
>=20
> I need to cp a directories with all the the subdirectories matching a
> pattern removed (ignore all the test* subdirectories). There can be
> many solutions to this problem. I'm wondering if anybody is aware of
> an easy and robust solution. Thanks!

This sort of thing is surprisingly tricky.
I've used something like the following in the past:

(cd dir1 && find -mindepth 1 \( -type d -a -name 'test*' \) -prune -o -pr=
int0 |
 tar --null -T- -c) |
(cd dir2 && tar -x)

The above can be easily extended by putting ssh in the pipe.

cheers,
P=E1draig.


From MAILER-DAEMON Wed Jul 11 14:44:18 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sp1ta-0008EJ-LX
	for mharc-coreutils@gnu.org; Wed, 11 Jul 2012 14:44:18 -0400
Received: from eggs.gnu.org ([208.118.235.92]:38547)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Sp1tX-0008DT-Ss
	for coreutils@gnu.org; Wed, 11 Jul 2012 14:44:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Sp1tX-0002Bj-3o
	for coreutils@gnu.org; Wed, 11 Jul 2012 14:44:15 -0400
Received: from mx.meyering.net ([88.168.87.75]:50094)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Sp1tW-0002Bc-TN
	for coreutils@gnu.org; Wed, 11 Jul 2012 14:44:15 -0400
Received: from rho.meyering.net (rho.meyering.net [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 37BFF600BB;
	Wed, 11 Jul 2012 20:44:14 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Peng Yu <pengyu.ut@gmail.com>
Subject: Re: cp with subdirectories following some pattern removed?
In-Reply-To: <CABrM6wnSpqmdz-OaYYQ12ph-BJ9+mFmZbHq=JVBM5YkgL++iYw@mail.gmail.com>
	(Peng Yu's message of "Wed, 11 Jul 2012 11:27:58 -0500")
References: <CABrM6wnSpqmdz-OaYYQ12ph-BJ9+mFmZbHq=JVBM5YkgL++iYw@mail.gmail.com>
Date: Wed, 11 Jul 2012 20:44:14 +0200
Message-ID: <87a9z62l4x.fsf@rho.meyering.net>
Lines: 9
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: 88.168.87.75
Cc: Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Jul 2012 18:44:17 -0000

Peng Yu wrote:
> I need to cp a directories with all the the subdirectories matching a
> pattern removed (ignore all the test* subdirectories). There can be
> many solutions to this problem. I'm wondering if anybody is aware of
> an easy and robust solution. Thanks!

I would use rsync for that:

    rsync -avP --exclude='test*' A B


From MAILER-DAEMON Wed Jul 11 17:49:34 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sp4mr-0007DQ-Vu
	for mharc-coreutils@gnu.org; Wed, 11 Jul 2012 17:49:33 -0400
Received: from eggs.gnu.org ([208.118.235.92]:37030)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1Sp4mq-0007BZ-4K
	for coreutils@gnu.org; Wed, 11 Jul 2012 17:49:32 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1Sp4mp-0001G2-6w
	for coreutils@gnu.org; Wed, 11 Jul 2012 17:49:32 -0400
Received: from mx1.redhat.com ([209.132.183.28]:15451)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1Sp4mo-0001Fn-V7
	for coreutils@gnu.org; Wed, 11 Jul 2012 17:49:31 -0400
Received: from int-mx11.intmail.prod.int.phx2.redhat.com
	(int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6BLnRlI016206
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 11 Jul 2012 17:49:28 -0400
Received: from [10.36.116.75] (ovpn-116-75.ams2.redhat.com [10.36.116.75])
	by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q6BLnPId001920
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Wed, 11 Jul 2012 17:49:26 -0400
Message-ID: <4FFDF4E4.8030409@draigBrady.com>
Date: Wed, 11 Jul 2012 22:49:24 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
Subject: Re: cp with subdirectories following some pattern removed?
References: <CABrM6wnSpqmdz-OaYYQ12ph-BJ9+mFmZbHq=JVBM5YkgL++iYw@mail.gmail.com>
	<87a9z62l4x.fsf@rho.meyering.net>
In-Reply-To: <87a9z62l4x.fsf@rho.meyering.net>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=ISO-8859-1
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id
	q6BLnRlI016206
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: Coreutils <coreutils@gnu.org>, Peng Yu <pengyu.ut@gmail.com>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 11 Jul 2012 21:49:32 -0000

On 07/11/2012 07:44 PM, Jim Meyering wrote:
> Peng Yu wrote:
>> I need to cp a directories with all the the subdirectories matching a
>> pattern removed (ignore all the test* subdirectories). There can be
>> many solutions to this problem. I'm wondering if anybody is aware of
>> an easy and robust solution. Thanks!
>=20
> I would use rsync for that:
>=20
>     rsync -avP --exclude=3D'test*' A B

Nice one.
I learned today that rsync prunes whole branches based on the above.
I also notice rsync supports sophisticated --filter rules
which are not needed for simple filtering like this.

Note however that the 'test*' above should end in '/'
so as to apply to just directories and leave any test*
files (not under a test* dir) in the copy.

cheers,
P=E1draig.


From MAILER-DAEMON Thu Jul 12 03:37:23 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SpDxj-0000g1-Dn
	for mharc-coreutils@gnu.org; Thu, 12 Jul 2012 03:37:23 -0400
Received: from eggs.gnu.org ([208.118.235.92]:47519)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SpDxg-0000eL-UK
	for coreutils@gnu.org; Thu, 12 Jul 2012 03:37:21 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SpDxb-00071g-0J
	for coreutils@gnu.org; Thu, 12 Jul 2012 03:37:20 -0400
Received: from mx.meyering.net ([88.168.87.75]:52040)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SpDxa-00071P-QY
	for coreutils@gnu.org; Thu, 12 Jul 2012 03:37:14 -0400
Received: from rho.meyering.net (rho.meyering.net [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id D6A65600A5;
	Thu, 12 Jul 2012 09:37:12 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Subject: Re: cp with subdirectories following some pattern removed?
In-Reply-To: <4FFDF4E4.8030409@draigBrady.com> (=?iso-8859-1?Q?=22P=E1drai?=
	=?iso-8859-1?Q?g?= Brady"'s message of
	"Wed, 11 Jul 2012 22:49:24 +0100")
References: <CABrM6wnSpqmdz-OaYYQ12ph-BJ9+mFmZbHq=JVBM5YkgL++iYw@mail.gmail.com>
	<87a9z62l4x.fsf@rho.meyering.net> <4FFDF4E4.8030409@draigBrady.com>
Date: Thu, 12 Jul 2012 09:37:12 +0200
Message-ID: <87txxdzazb.fsf@rho.meyering.net>
Lines: 25
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
Cc: Coreutils <coreutils@gnu.org>, Peng Yu <pengyu.ut@gmail.com>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Jul 2012 07:37:21 -0000

P=E1draig Brady wrote:
> On 07/11/2012 07:44 PM, Jim Meyering wrote:
>> Peng Yu wrote:
>>> I need to cp a directories with all the the subdirectories matching a
>>> pattern removed (ignore all the test* subdirectories). There can be
>>> many solutions to this problem. I'm wondering if anybody is aware of
>>> an easy and robust solution. Thanks!
>>
>> I would use rsync for that:
>>
>>     rsync -avP --exclude=3D'test*' A B
>
> Nice one.
> I learned today that rsync prunes whole branches based on the above.
> I also notice rsync supports sophisticated --filter rules
> which are not needed for simple filtering like this.

Yes, between the usable --include/exclude{-from} options and the
more general/complete --filter, there's nothing rsync can't do ;-)

> Note however that the 'test*' above should end in '/'
> so as to apply to just directories and leave any test*
> files (not under a test* dir) in the copy.

Good point.  Thanks.


From MAILER-DAEMON Thu Jul 12 04:54:03 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SpF9v-0001qX-Gg
	for mharc-coreutils@gnu.org; Thu, 12 Jul 2012 04:54:03 -0400
Received: from eggs.gnu.org ([208.118.235.92]:52504)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SpF9j-0001nv-OT
	for coreutils@gnu.org; Thu, 12 Jul 2012 04:54:01 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SpF91-0001qO-9z
	for coreutils@gnu.org; Thu, 12 Jul 2012 04:53:51 -0400
Received: from mx.meyering.net ([88.168.87.75]:52237)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SpF91-0001qG-2s
	for coreutils@gnu.org; Thu, 12 Jul 2012 04:53:07 -0400
Received: from rho.meyering.net (rho.meyering.net [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id DE534604C9;
	Thu, 12 Jul 2012 10:53:05 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Paul Eggert <eggert@cs.ucla.edu>
Subject: Re: [PATCH 1/2] doc: fix spacing
In-Reply-To: <4FF61FDC.2080806@cs.ucla.edu> (Paul Eggert's message of "Thu, 05
	Jul 2012 16:14:36 -0700")
References: <4FF61FDC.2080806@cs.ucla.edu>
Date: Thu, 12 Jul 2012 10:53:05 +0200
Message-ID: <87k3y9z7gu.fsf@rho.meyering.net>
Lines: 33
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: 88.168.87.75
Cc: Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Jul 2012 08:54:01 -0000

Paul Eggert wrote:
> * doc/coreutils.texi: Use right amount of spacing after punctuation.
> ---
>  doc/coreutils.texi |  159 ++++++++++++++++++++++++++--------------------------
>  1 files changed, 80 insertions(+), 79 deletions(-)
>
> diff --git a/doc/coreutils.texi b/doc/coreutils.texi
> index 954a1f8..3c7f4e5 100644
> --- a/doc/coreutils.texi
> +++ b/doc/coreutils.texi
> @@ -585,7 +585,7 @@ symbolic link to a directory.  @xref{Target directory}.
>  @opindex --null
>  @cindex output @sc{nul}-byte-terminated lines
>  Output a zero byte (@acronym{ASCII} @sc{nul}) at the end of each line,
> -rather than a newline. This option enables other programs to parse the
> +rather than a newline.  This option enables other programs to parse the
>  output of @command{\cmd\} even when that output would contain data
>  with embedded newlines.
>  @end macro
> @@ -1046,7 +1046,7 @@ floating point numbers such as @code{-0x.ep-3},
> which stands for
>  A @var{signal} may be a signal name like @samp{HUP}, or a signal
>  number like @samp{1}, or an exit status of a process terminated by the
>  signal.  A signal name can be given in canonical form or prefixed by
> -@samp{SIG}.  The case of the letters is ignored. The following signal names
> +@samp{SIG}@.  The case of the letters is ignored.  The following signal names
>  and numbers are supported on all @acronym{POSIX} compliant systems:

Thanks!  This looks like something we could automate a check for,
otherwise I'll surely forget and introduce new instances.
Do you know of tools to help with that?

I'd say grep, but we'd need more context to filter out false positives.


From MAILER-DAEMON Thu Jul 12 10:05:27 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SpK1H-0005WZ-40
	for mharc-coreutils@gnu.org; Thu, 12 Jul 2012 10:05:27 -0400
Received: from eggs.gnu.org ([208.118.235.92]:43736)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SpK1C-0005WG-8K
	for coreutils@gnu.org; Thu, 12 Jul 2012 10:05:26 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SpK13-0006yn-Ja
	for coreutils@gnu.org; Thu, 12 Jul 2012 10:05:22 -0400
Received: from mx1.redhat.com ([209.132.183.28]:37903)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SpK13-0006yW-Bl
	for coreutils@gnu.org; Thu, 12 Jul 2012 10:05:13 -0400
Received: from int-mx09.intmail.prod.int.phx2.redhat.com
	(int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6CE4rOX005484
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 12 Jul 2012 10:04:57 -0400
Received: from [10.36.116.67] (ovpn-116-67.ams2.redhat.com [10.36.116.67])
	by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q6CE4oPx016717
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Thu, 12 Jul 2012 10:04:51 -0400
Message-ID: <4FFED981.3040904@draigBrady.com>
Date: Thu, 12 Jul 2012 15:04:49 +0100
From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Paul Eggert <eggert@cs.ucla.edu>
Subject: Re: overly aggressive memory usage by sort.c
References: <CAMkU=1zDA=RFzxb-O_x2TG+EumrdUebZJb4UOJAM_xretGpCCA@mail.gmail.com>
	<4FD1431C.5010500@draigBrady.com> <878vfu9x7o.fsf@rho.meyering.net>
	<4FD5C249.7090907@cs.ucla.edu> <4FD5CF65.7000609@cs.ucla.edu>
	<A75C39900FCF0B42A2CE8B26F837D2C3010923@MCHP02MSX.global-ad.net>
	<4FD629CC.4030908@cs.ucla.edu>
	<4FD97E52.6070202@bernhard-voelker.de>
	<87r4tawizr.fsf@rho.meyering.net>
	<CAMkU=1xRUkL=ZEFhtJ5vU4h4dWXm=XdHR7Kc8gTux1vozUYRUg@mail.gmail.com>
	<87wr32up7y.fsf@rho.meyering.net> <4FE1D578.5020109@cs.ucla.edu>
	<87hatighpm.fsf@rho.meyering.net>
	<CAMkU=1zKqeBt2KRAue=HNjnXzim0zRqpjQwrtLWaf-=zNswkVw@mail.gmail.com>
	<4FFCB808.5010108@cs.ucla.edu>
In-Reply-To: <4FFCB808.5010108@cs.ucla.edu>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=UTF-8
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id
	q6CE4rOX005484
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: Bernhard Voelker <mail@bernhard-voelker.de>,
	Jeff Janes <jeff.janes@gmail.com>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Jul 2012 14:05:26 -0000

On 07/11/2012 12:17 AM, Paul Eggert wrote:
> On 07/10/2012 07:31 AM, Jeff Janes wrote:
>> Yes, that fixed the problem.
>=20
> OK, thanks for checking; I pushed it into the coreutils
> master on savannah.

Probably worth mentioning in NEWS because
of the significant potential performance impact?

commit 96168117cbde9cb68dabbce2cf34848957462d49
Author: P=C3=A1draig Brady <P@draigBrady.com>
Date:   Thu Jul 12 15:02:19 2012 +0100

    doc: mention the improved sort memory allocation

    * NEWS: Mention the improvement.

diff --git a/NEWS b/NEWS
index 3aff3a8..836ecec 100644
--- a/NEWS
+++ b/NEWS
@@ -52,6 +52,10 @@ GNU coreutils NEWS                                    =
-*- outline -*-
   or unwritable output.  Sort now diagnoses certain errors at start-up,
   rather than after potentially expensive processing.

+  sort by default, will not directly use more than 75% of physical memor=
y,
+  to better share system resources, and thus operate more efficiently.
+  [The default max memory usage changed from 50% to 100% in coreutils-8.=
16]
+

 * Noteworthy changes in release 8.17 (2012-05-10) [stable]



From MAILER-DAEMON Thu Jul 12 11:07:51 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SpKzf-0000yZ-37
	for mharc-coreutils@gnu.org; Thu, 12 Jul 2012 11:07:51 -0400
Received: from eggs.gnu.org ([208.118.235.92]:43693)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1SpKzT-0000uC-Sm
	for coreutils@gnu.org; Thu, 12 Jul 2012 11:07:49 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1SpKzN-0001aY-SV
	for coreutils@gnu.org; Thu, 12 Jul 2012 11:07:39 -0400
Received: from smtp.cs.ucla.edu ([131.179.128.62]:53261)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1SpKzN-0001aQ-NT
	for coreutils@gnu.org; Thu, 12 Jul 2012 11:07:33 -0400
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id 11AABA60005;
	Thu, 12 Jul 2012 08:07:32 -0700 (PDT)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
Received: from smtp.cs.ucla.edu ([127.0.0.1])
	by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id i2rVqEhxFE8D; Thu, 12 Jul 2012 08:07:31 -0700 (PDT)
Received: from [192.168.1.4] (pool-108-23-119-2.lsanca.fios.verizon.net
	[108.23.119.2])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 8B403A60003;
	Thu, 12 Jul 2012 08:07:31 -0700 (PDT)
Message-ID: <4FFEE82E.6000702@cs.ucla.edu>
Date: Thu, 12 Jul 2012 08:07:26 -0700
From: Paul Eggert <eggert@cs.ucla.edu>
Organization: UCLA Computer Science Department
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:13.0) Gecko/20120615 Thunderbird/13.0.1
MIME-Version: 1.0
To: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@draigBrady.com>
Subject: Re: overly aggressive memory usage by sort.c
References: <CAMkU=1zDA=RFzxb-O_x2TG+EumrdUebZJb4UOJAM_xretGpCCA@mail.gmail.com>
	<4FD1431C.5010500@draigBrady.com> <878vfu9x7o.fsf@rho.meyering.net>
	<4FD5C249.7090907@cs.ucla.edu> <4FD5CF65.7000609@cs.ucla.edu>
	<A75C39900FCF0B42A2CE8B26F837D2C3010923@MCHP02MSX.global-ad.net>
	<4FD629CC.4030908@cs.ucla.edu>
	<4FD97E52.6070202@bernhard-voelker.de>
	<87r4tawizr.fsf@rho.meyering.net>
	<CAMkU=1xRUkL=ZEFhtJ5vU4h4dWXm=XdHR7Kc8gTux1vozUYRUg@mail.gmail.com>
	<87wr32up7y.fsf@rho.meyering.net> <4FE1D578.5020109@cs.ucla.edu>
	<87hatighpm.fsf@rho.meyering.net>
	<CAMkU=1zKqeBt2KRAue=HNjnXzim0zRqpjQwrtLWaf-=zNswkVw@mail.gmail.com>
	<4FFCB808.5010108@cs.ucla.edu> <4FFED981.3040904@draigBrady.com>
In-Reply-To: <4FFED981.3040904@draigBrady.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 131.179.128.62
Cc: Bernhard Voelker <mail@bernhard-voelker.de>,
	Jeff Janes <jeff.janes@gmail.com>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Jul 2012 15:07:49 -0000

On 07/12/2012 07:04 AM, P=C3=A1draig Brady wrote:
> Probably worth mentioning in NEWS because
> of the significant potential performance impact?

Sure, that'd be fine.


From MAILER-DAEMON Thu Jul 12 11:15:58 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SpL7W-0003f7-3R
	for mharc-coreutils@gnu.org; Thu, 12 Jul 2012 11:15:58 -0400
Received: from eggs.gnu.org ([208.118.235.92]:58873)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1SpL7T-0003f1-NJ
	for coreutils@gnu.org; Thu, 12 Jul 2012 11:15:57 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1SpL7P-0004Ae-0f
	for coreutils@gnu.org; Thu, 12 Jul 2012 11:15:55 -0400
Received: from smtp.cs.ucla.edu ([131.179.128.62]:53598)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eggert@cs.ucla.edu>) id 1SpL7O-0004AK-Fv
	for coreutils@gnu.org; Thu, 12 Jul 2012 11:15:50 -0400
Received: from localhost (localhost.localdomain [127.0.0.1])
	by smtp.cs.ucla.edu (Postfix) with ESMTP id D5B42A60003;
	Thu, 12 Jul 2012 08:15:49 -0700 (PDT)
X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu
Received: from smtp.cs.ucla.edu ([127.0.0.1])
	by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id 49nxOQ82dz8B; Thu, 12 Jul 2012 08:15:49 -0700 (PDT)
Received: from [192.168.1.4] (pool-108-23-119-2.lsanca.fios.verizon.net
	[108.23.119.2])
	by smtp.cs.ucla.edu (Postfix) with ESMTPSA id 86262A60001;
	Thu, 12 Jul 2012 08:15:49 -0700 (PDT)
Message-ID: <4FFEEA25.2080809@cs.ucla.edu>
Date: Thu, 12 Jul 2012 08:15:49 -0700
From: Paul Eggert <eggert@cs.ucla.edu>
Organization: UCLA Computer Science Department
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:13.0) Gecko/20120615 Thunderbird/13.0.1
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
Subject: Re: [PATCH 1/2] doc: fix spacing
References: <4FF61FDC.2080806@cs.ucla.edu> <87k3y9z7gu.fsf@rho.meyering.net>
In-Reply-To: <87k3y9z7gu.fsf@rho.meyering.net>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 131.179.128.62
Cc: Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Jul 2012 15:15:57 -0000

On 07/12/2012 01:53 AM, Jim Meyering wrote:
> I'd say grep, but we'd need more context to filter out false positives.

I'm afraid that grep is what I used, and yes,
it required some manual filtering.


From MAILER-DAEMON Thu Jul 12 16:38:28 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SpQ9c-0000Fb-0n
	for mharc-coreutils@gnu.org; Thu, 12 Jul 2012 16:38:28 -0400
Received: from eggs.gnu.org ([208.118.235.92]:47206)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SpQ9a-0000En-2G
	for coreutils@gnu.org; Thu, 12 Jul 2012 16:38:27 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SpQ9Y-00038H-NT
	for coreutils@gnu.org; Thu, 12 Jul 2012 16:38:26 -0400
Received: from mx.meyering.net ([88.168.87.75]:54093)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SpQ9Y-00037V-G0
	for coreutils@gnu.org; Thu, 12 Jul 2012 16:38:24 -0400
Received: from rho.meyering.net (rho.meyering.net [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id B944B6009B;
	Thu, 12 Jul 2012 22:38:23 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Subject: Re: overly aggressive memory usage by sort.c
In-Reply-To: <4FFED981.3040904@draigBrady.com> (=?iso-8859-1?Q?=22P=E1drai?=
	=?iso-8859-1?Q?g?= Brady"'s message of
	"Thu, 12 Jul 2012 15:04:49 +0100")
References: <CAMkU=1zDA=RFzxb-O_x2TG+EumrdUebZJb4UOJAM_xretGpCCA@mail.gmail.com>
	<4FD1431C.5010500@draigBrady.com> <878vfu9x7o.fsf@rho.meyering.net>
	<4FD5C249.7090907@cs.ucla.edu> <4FD5CF65.7000609@cs.ucla.edu>
	<A75C39900FCF0B42A2CE8B26F837D2C3010923@MCHP02MSX.global-ad.net>
	<4FD629CC.4030908@cs.ucla.edu> <4FD97E52.6070202@bernhard-voelker.de>
	<87r4tawizr.fsf@rho.meyering.net>
	<CAMkU=1xRUkL=ZEFhtJ5vU4h4dWXm=XdHR7Kc8gTux1vozUYRUg@mail.gmail.com>
	<87wr32up7y.fsf@rho.meyering.net> <4FE1D578.5020109@cs.ucla.edu>
	<87hatighpm.fsf@rho.meyering.net>
	<CAMkU=1zKqeBt2KRAue=HNjnXzim0zRqpjQwrtLWaf-=zNswkVw@mail.gmail.com>
	<4FFCB808.5010108@cs.ucla.edu> <4FFED981.3040904@draigBrady.com>
Date: Thu, 12 Jul 2012 22:38:23 +0200
Message-ID: <87bojkvhog.fsf@rho.meyering.net>
Lines: 39
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
Cc: Paul Eggert <eggert@cs.ucla.edu>,
	Bernhard Voelker <mail@bernhard-voelker.de>,
	Jeff Janes <jeff.janes@gmail.com>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 12 Jul 2012 20:38:27 -0000

P=E1draig Brady wrote:
> On 07/11/2012 12:17 AM, Paul Eggert wrote:
>> On 07/10/2012 07:31 AM, Jeff Janes wrote:
>>> Yes, that fixed the problem.
>>
>> OK, thanks for checking; I pushed it into the coreutils
>> master on savannah.
>
> Probably worth mentioning in NEWS because
> of the significant potential performance impact?

Yes, definitely.  Good catch.

> commit 96168117cbde9cb68dabbce2cf34848957462d49
> Author: P=E1draig Brady <P@draigBrady.com>
> Date:   Thu Jul 12 15:02:19 2012 +0100
>
>     doc: mention the improved sort memory allocation
>
>     * NEWS: Mention the improvement.
>
> diff --git a/NEWS b/NEWS
> index 3aff3a8..836ecec 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -52,6 +52,10 @@ GNU coreutils NEWS                                    =
-*- outline -*-
>    or unwritable output.  Sort now diagnoses certain errors at start-up,
>    rather than after potentially expensive processing.
>
> +  sort by default, will not directly use more than 75% of physical memor=
y,

How about changing tense and moving the "by default"?

     sort now allocates no more than 75% of physical memory by default,

> +  to better share system resources, and thus operate more efficiently.
> +  [The default max memory usage changed from 50% to 100% in coreutils-8.=
16]

Thanks.


From MAILER-DAEMON Sun Jul 15 09:57:20 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SqPK4-0007UO-6O
	for mharc-coreutils@gnu.org; Sun, 15 Jul 2012 09:57:20 -0400
Received: from eggs.gnu.org ([208.118.235.92]:47544)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SqPK1-0007TR-At
	for coreutils@gnu.org; Sun, 15 Jul 2012 09:57:18 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SqPK0-0000mS-0g
	for coreutils@gnu.org; Sun, 15 Jul 2012 09:57:17 -0400
Received: from mx.meyering.net ([88.168.87.75]:35988)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SqPJz-0000mN-Lb
	for coreutils@gnu.org; Sun, 15 Jul 2012 09:57:15 -0400
Received: from rho.meyering.net (rho.meyering.net [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id EB1EB63C98
	for <coreutils@gnu.org>; Sun, 15 Jul 2012 15:57:14 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: removing coreutils' final strncpy uses
Date: Sun, 15 Jul 2012 15:57:14 +0200
Message-ID: <87629pnn45.fsf@rho.meyering.net>
Lines: 154
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: 88.168.87.75
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Jul 2012 13:57:18 -0000

Remember the strncpy prohibition I added to "make syntax-check"
not too long ago?  I exempted the uses in pinky.c and who.c
because those programs don't really matter and their uses were
not obviously bad.  Plus, I just didn't feel like it.

Well, today I did, so removed them and, along the way, was surprised
to see that while not officially wrong, they were unwarranted:  they
would uselessly zero-pad out to the end of each destination buffer.
It felt good to remove them (and the exemption), making the
code more compact and more readable, to boot.

The 2nd commit below updates to the latest from gnulib.


>From f79263da4da048bf3a071e22530a0d2c02aff0df Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Sun, 15 Jul 2012 11:38:51 +0200
Subject: [PATCH 1/2] maint: remove unwarranted uses of strncpy

* src/pinky.c (print_entry): Remove unwarranted uses of strncpy.
Instead, use stpcpy and stpncpy.
* src/who.c (print_user): Likewise.
* cfg.mk: Remove strncpy exemptions.
---
 cfg.mk      |  3 ---
 src/pinky.c | 21 ++++++---------------
 src/who.c   | 19 +++++--------------
 3 files changed, 11 insertions(+), 32 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index 6620eaf..790238c 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -493,6 +493,3 @@ exclude_file_name_regexp--sc_prohibit_test_backticks = \
 # Exempt test.c, since it's nominally shared, and relatively static.
 exclude_file_name_regexp--sc_prohibit_operator_at_end_of_line = \
   ^src/(ptx|test|head)\.c$$
-
-# Exempt pinky and who: their uses of this function appear to be correct.
-exclude_file_name_regexp--sc_prohibit_strncpy = ^src/(pinky|who)\.c$$
diff --git a/src/pinky.c b/src/pinky.c
index 597bc56..c01b124 100644
--- a/src/pinky.c
+++ b/src/pinky.c
@@ -208,21 +208,14 @@ print_entry (const STRUCT_UTMP *utmp_ent)
 #define DEV_DIR_LEN (sizeof (DEV_DIR_WITH_TRAILING_SLASH) - 1)

   char line[sizeof (utmp_ent->ut_line) + DEV_DIR_LEN + 1];
+  char *p = line;

   /* Copy ut_line into LINE, prepending '/dev/' if ut_line is not
      already an absolute file name.  Some system may put the full,
      absolute file name in ut_line.  */
-  if (utmp_ent->ut_line[0] == '/')
-    {
-      strncpy (line, utmp_ent->ut_line, sizeof (utmp_ent->ut_line));
-      line[sizeof (utmp_ent->ut_line)] = '\0';
-    }
-  else
-    {
-      strcpy (line, DEV_DIR_WITH_TRAILING_SLASH);
-      strncpy (line + DEV_DIR_LEN, utmp_ent->ut_line, sizeof utmp_ent->ut_line);
-      line[DEV_DIR_LEN + sizeof (utmp_ent->ut_line)] = '\0';
-    }
+  if ( ! IS_ABSOLUTE_FILE_NAME (utmp_ent->ut_line))
+    p = stpcpy (p, DEV_DIR_WITH_TRAILING_SLASH);
+  stpncpy (p, utmp_ent->ut_line, sizeof (utmp_ent->ut_line));

   if (stat (line, &stats) == 0)
     {
@@ -242,8 +235,7 @@ print_entry (const STRUCT_UTMP *utmp_ent)
       struct passwd *pw;
       char name[UT_USER_SIZE + 1];

-      strncpy (name, UT_USER (utmp_ent), UT_USER_SIZE);
-      name[UT_USER_SIZE] = '\0';
+      stpncpy (name, UT_USER (utmp_ent), UT_USER_SIZE);
       pw = getpwnam (name);
       if (pw == NULL)
         /* TRANSLATORS: Real name is unknown; at most 19 characters. */
@@ -284,8 +276,7 @@ print_entry (const STRUCT_UTMP *utmp_ent)
       char *display = NULL;

       /* Copy the host name into UT_HOST, and ensure it's nul terminated. */
-      strncpy (ut_host, utmp_ent->ut_host, (int) sizeof (utmp_ent->ut_host));
-      ut_host[sizeof (utmp_ent->ut_host)] = '\0';
+      stpncpy (ut_host, utmp_ent->ut_host, sizeof (utmp_ent->ut_host));

       /* Look for an X display.  */
       display = strchr (ut_host, ':');
diff --git a/src/who.c b/src/who.c
index c875b1d..3ad8004 100644
--- a/src/who.c
+++ b/src/who.c
@@ -342,23 +342,15 @@ print_user (const STRUCT_UTMP *utmp_ent, time_t boottime)
 #define DEV_DIR_LEN (sizeof (DEV_DIR_WITH_TRAILING_SLASH) - 1)

   char line[sizeof (utmp_ent->ut_line) + DEV_DIR_LEN + 1];
+  char *p = line;
   PIDSTR_DECL_AND_INIT (pidstr, utmp_ent);

   /* Copy ut_line into LINE, prepending '/dev/' if ut_line is not
      already an absolute file name.  Some systems may put the full,
      absolute file name in ut_line.  */
-  if (utmp_ent->ut_line[0] == '/')
-    {
-      strncpy (line, utmp_ent->ut_line, sizeof (utmp_ent->ut_line));
-      line[sizeof (utmp_ent->ut_line)] = '\0';
-    }
-  else
-    {
-      strcpy (line, DEV_DIR_WITH_TRAILING_SLASH);
-      strncpy (line + DEV_DIR_LEN, utmp_ent->ut_line,
-               sizeof (utmp_ent->ut_line));
-      line[DEV_DIR_LEN + sizeof (utmp_ent->ut_line)] = '\0';
-    }
+  if ( ! IS_ABSOLUTE_FILE_NAME (utmp_ent->ut_line))
+    p = stpcpy (p, DEV_DIR_WITH_TRAILING_SLASH);
+  stpncpy (p, utmp_ent->ut_line, sizeof (utmp_ent->ut_line));

   if (stat (line, &stats) == 0)
     {
@@ -384,8 +376,7 @@ print_user (const STRUCT_UTMP *utmp_ent, time_t boottime)
       char *display = NULL;

       /* Copy the host name into UT_HOST, and ensure it's nul terminated. */
-      strncpy (ut_host, utmp_ent->ut_host, sizeof (utmp_ent->ut_host));
-      ut_host[sizeof (utmp_ent->ut_host)] = '\0';
+      stpncpy (ut_host, utmp_ent->ut_host, sizeof (utmp_ent->ut_host));

       /* Look for an X display.  */
       display = strchr (ut_host, ':');
--
1.7.11.2.194.g7bdb748


>From e380221333f4efd8d49b29b2690375c36eb90505 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Sun, 15 Jul 2012 13:50:36 +0200
Subject: [PATCH 2/2] build: update gnulib submodule to latest

---
 gnulib | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnulib b/gnulib
index d8f90ad..696aa74 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit d8f90adf5f01512958b6da46bd5eea01294a434e
+Subproject commit 696aa74b38f8c109c21e4c01194faab53fb4cefc
--
1.7.11.2.194.g7bdb748


From MAILER-DAEMON Sun Jul 15 11:40:28 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SqQvs-0000wz-52
	for mharc-coreutils@gnu.org; Sun, 15 Jul 2012 11:40:28 -0400
Received: from eggs.gnu.org ([208.118.235.92]:34976)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <auerswal@unix-ag.uni-kl.de>) id 1SqQvp-0000wi-LT
	for coreutils@gnu.org; Sun, 15 Jul 2012 11:40:26 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <auerswal@unix-ag.uni-kl.de>) id 1SqQvo-0007or-C1
	for coreutils@gnu.org; Sun, 15 Jul 2012 11:40:25 -0400
Received: from mailgw1.uni-kl.de ([131.246.120.220]:37489)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <auerswal@unix-ag.uni-kl.de>) id 1SqQvo-0007oU-14
	for coreutils@gnu.org; Sun, 15 Jul 2012 11:40:24 -0400
Received: from sushi.unix-ag.uni-kl.de (sushi.unix-ag.uni-kl.de
	[IPv6:2001:638:208:ef34:0:ff:fe00:65])
	by mailgw1.uni-kl.de (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id
	q6FFeKug019976
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <coreutils@gnu.org>; Sun, 15 Jul 2012 17:40:20 +0200
Received: from [127.0.0.1] (localhost [127.0.0.1])
	by sushi.unix-ag.uni-kl.de (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP
	id q6FFeJol006571
	for <coreutils@gnu.org>; Sun, 15 Jul 2012 17:40:20 +0200
Message-ID: <5002E463.40105@unix-ag.uni-kl.de>
Date: Sun, 15 Jul 2012 17:40:19 +0200
From: Erik Auerswald <auerswal@unix-ag.uni-kl.de>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:10.0.5) Gecko/20120624 Icedove/10.0.5
MIME-Version: 1.0
To: coreutils@gnu.org
Subject: Re: removing coreutils' final strncpy uses
References: <87629pnn45.fsf@rho.meyering.net>
In-Reply-To: <87629pnn45.fsf@rho.meyering.net>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 131.246.120.220
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Jul 2012 15:40:26 -0000

Hi,

On 07/15/2012 03:57 PM, Jim Meyering wrote:
> Remember the strncpy prohibition I added to "make syntax-check"
> not too long ago?  I exempted the uses in pinky.c and who.c
> because those programs don't really matter and their uses were
> not obviously bad.  Plus, I just didn't feel like it.
>
> Well, today I did, so removed them and, along the way, was surprised
> to see that while not officially wrong, they were unwarranted:  they
> would uselessly zero-pad out to the end of each destination buffer.

 From reading the man pages of strncpy and stpncpy, stpncpy does the 
same. From the stpncpy man page on debian/unstable (date 2011-09-28, 
from Linux man-pages 3.40):

DESCRIPTION
  The stpncpy() function copies at most n characters from the string
  pointed to by src, including the terminating null byte ('\0'), to the
  array pointed to by dest. Exactly n characters are written at dest.
  If the length strlen(src) is smaller than n, the remaining characters
  in the array pointed to by dest are filled with null bytes ('\0'), If
  the length strlen(src) is greater or equal to n, the string pointed to
  by dest will not be null-terminated.

As written above the copied string may be unterminated after stpncpy as 
well as after strncpy. What exactly is won by using stpncpy over strncpy?

> diff --git a/src/pinky.c b/src/pinky.c
> index 597bc56..c01b124 100644
> --- a/src/pinky.c
> +++ b/src/pinky.c
> @@ -208,21 +208,14 @@ print_entry (const STRUCT_UTMP *utmp_ent)
>   #define DEV_DIR_LEN (sizeof (DEV_DIR_WITH_TRAILING_SLASH) - 1)
>
>     char line[sizeof (utmp_ent->ut_line) + DEV_DIR_LEN + 1];
> +  char *p = line;
>
>     /* Copy ut_line into LINE, prepending '/dev/' if ut_line is not
>        already an absolute file name.  Some system may put the full,
>        absolute file name in ut_line.  */
> -  if (utmp_ent->ut_line[0] == '/')
> -    {
> -      strncpy (line, utmp_ent->ut_line, sizeof (utmp_ent->ut_line));
> -      line[sizeof (utmp_ent->ut_line)] = '\0';
> -    }
> -  else
> -    {
> -      strcpy (line, DEV_DIR_WITH_TRAILING_SLASH);
> -      strncpy (line + DEV_DIR_LEN, utmp_ent->ut_line, sizeof utmp_ent->ut_line);
> -      line[DEV_DIR_LEN + sizeof (utmp_ent->ut_line)] = '\0';
> -    }
> +  if ( ! IS_ABSOLUTE_FILE_NAME (utmp_ent->ut_line))
> +    p = stpcpy (p, DEV_DIR_WITH_TRAILING_SLASH);
> +  stpncpy (p, utmp_ent->ut_line, sizeof (utmp_ent->ut_line));

I don't see any guarantee that line is null-terminated.

>     if (stat (line,&stats) == 0)
>       {
> @@ -242,8 +235,7 @@ print_entry (const STRUCT_UTMP *utmp_ent)
>         struct passwd *pw;
>         char name[UT_USER_SIZE + 1];
>
> -      strncpy (name, UT_USER (utmp_ent), UT_USER_SIZE);
> -      name[UT_USER_SIZE] = '\0';
> +      stpncpy (name, UT_USER (utmp_ent), UT_USER_SIZE);
>         pw = getpwnam (name);
>         if (pw == NULL)
>           /* TRANSLATORS: Real name is unknown; at most 19 characters. */
> @@ -284,8 +276,7 @@ print_entry (const STRUCT_UTMP *utmp_ent)
>         char *display = NULL;
>
>         /* Copy the host name into UT_HOST, and ensure it's nul terminated. */
> -      strncpy (ut_host, utmp_ent->ut_host, (int) sizeof (utmp_ent->ut_host));
> -      ut_host[sizeof (utmp_ent->ut_host)] = '\0';
> +      stpncpy (ut_host, utmp_ent->ut_host, sizeof (utmp_ent->ut_host));

I don't see any guarantee that utmp_ent->ut_host is null-terminated.

> diff --git a/src/who.c b/src/who.c
> index c875b1d..3ad8004 100644
> --- a/src/who.c
> +++ b/src/who.c
> @@ -342,23 +342,15 @@ print_user (const STRUCT_UTMP *utmp_ent, time_t boottime)
>   #define DEV_DIR_LEN (sizeof (DEV_DIR_WITH_TRAILING_SLASH) - 1)
>
>     char line[sizeof (utmp_ent->ut_line) + DEV_DIR_LEN + 1];
> +  char *p = line;
>     PIDSTR_DECL_AND_INIT (pidstr, utmp_ent);
>
>     /* Copy ut_line into LINE, prepending '/dev/' if ut_line is not
>        already an absolute file name.  Some systems may put the full,
>        absolute file name in ut_line.  */
> -  if (utmp_ent->ut_line[0] == '/')
> -    {
> -      strncpy (line, utmp_ent->ut_line, sizeof (utmp_ent->ut_line));
> -      line[sizeof (utmp_ent->ut_line)] = '\0';
> -    }
> -  else
> -    {
> -      strcpy (line, DEV_DIR_WITH_TRAILING_SLASH);
> -      strncpy (line + DEV_DIR_LEN, utmp_ent->ut_line,
> -               sizeof (utmp_ent->ut_line));
> -      line[DEV_DIR_LEN + sizeof (utmp_ent->ut_line)] = '\0';
> -    }
> +  if ( ! IS_ABSOLUTE_FILE_NAME (utmp_ent->ut_line))
> +    p = stpcpy (p, DEV_DIR_WITH_TRAILING_SLASH);
> +  stpncpy (p, utmp_ent->ut_line, sizeof (utmp_ent->ut_line));

I don't see any guarantee that line is null-terminated.

> @@ -384,8 +376,7 @@ print_user (const STRUCT_UTMP *utmp_ent, time_t boottime)
>         char *display = NULL;
>
>         /* Copy the host name into UT_HOST, and ensure it's nul terminated. */
> -      strncpy (ut_host, utmp_ent->ut_host, sizeof (utmp_ent->ut_host));
> -      ut_host[sizeof (utmp_ent->ut_host)] = '\0';
> +      stpncpy (ut_host, utmp_ent->ut_host, sizeof (utmp_ent->ut_host));

I don't see any guarantee that utmp_ent->ut_host is null-terminated.

Disclaimer: I have read the man page found on my system only, I don't 
have experience using str[n]cpy. But I was curious about this change and 
don't see the improvement.

Thanks,
Erik


From MAILER-DAEMON Sun Jul 15 12:33:12 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SqRku-00075t-Qu
	for mharc-coreutils@gnu.org; Sun, 15 Jul 2012 12:33:12 -0400
Received: from eggs.gnu.org ([208.118.235.92]:60743)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SqRkr-00075h-RV
	for coreutils@gnu.org; Sun, 15 Jul 2012 12:33:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SqRkq-0003Og-Cn
	for coreutils@gnu.org; Sun, 15 Jul 2012 12:33:09 -0400
Received: from mx.meyering.net ([88.168.87.75]:36391)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SqRkq-0003Ki-1X
	for coreutils@gnu.org; Sun, 15 Jul 2012 12:33:08 -0400
Received: from rho.meyering.net (rho.meyering.net [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id DEA4A63953;
	Sun, 15 Jul 2012 18:33:06 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Erik Auerswald <auerswal@unix-ag.uni-kl.de>
Subject: Re: removing coreutils' final strncpy uses
In-Reply-To: <5002E463.40105@unix-ag.uni-kl.de> (Erik Auerswald's message of
	"Sun, 15 Jul 2012 17:40:19 +0200")
References: <87629pnn45.fsf@rho.meyering.net>
	<5002E463.40105@unix-ag.uni-kl.de>
Date: Sun, 15 Jul 2012 18:33:06 +0200
Message-ID: <87pq7xm1bx.fsf@rho.meyering.net>
Lines: 140
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: 88.168.87.75
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Jul 2012 16:33:11 -0000

Erik Auerswald wrote:
> On 07/15/2012 03:57 PM, Jim Meyering wrote:
>> Remember the strncpy prohibition I added to "make syntax-check"
>> not too long ago?  I exempted the uses in pinky.c and who.c
>> because those programs don't really matter and their uses were
>> not obviously bad.  Plus, I just didn't feel like it.
>>
>> Well, today I did, so removed them and, along the way, was surprised
>> to see that while not officially wrong, they were unwarranted:  they
>> would uselessly zero-pad out to the end of each destination buffer.
>
> From reading the man pages of strncpy and stpncpy, stpncpy does the
> same. From the stpncpy man page on debian/unstable (date 2011-09-28,
> from Linux man-pages 3.40):
>
> DESCRIPTION
>  The stpncpy() function copies at most n characters from the string
>  pointed to by src, including the terminating null byte ('\0'), to the
>  array pointed to by dest. Exactly n characters are written at dest.
>  If the length strlen(src) is smaller than n, the remaining characters
>  in the array pointed to by dest are filled with null bytes ('\0'), If
>  the length strlen(src) is greater or equal to n, the string pointed to
>  by dest will not be null-terminated.
>
> As written above the copied string may be unterminated after stpncpy
> as well as after strncpy. What exactly is won by using stpncpy over
> strncpy?
...
>
> I don't see any guarantee that utmp_ent->ut_host is null-terminated.
>
> Disclaimer: I have read the man page found on my system only, I don't
> have experience using str[n]cpy. But I was curious about this change
> and don't see the improvement.

I knew I shouldn't have pushed that without review.

Introducing bugs is definitely not an improvement.
Thanks for spotting that.

Here's a proposed fix:

>From 8de642149caac9e9114eb3ad3e3d71d151f691a3 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Sun, 15 Jul 2012 18:18:03 +0200
Subject: [PATCH] pinky,who: fix bug in latest change

* src/system.h (stzncpy): New function.
* src/pinky.c (print_entry): Use stzncpy, not stpncpy.
The latter does not NUL-terminate.  I assumed that strncpy was
the only function with such a horrible API.  Today I learned that
stpncpy also may not NUL-terminate its result.
* src/who.c (print_user): Likewise.
Thanks to Erik Auerswald for spotting my error.
---
 src/pinky.c  |  6 +++---
 src/system.h | 14 ++++++++++++++
 src/who.c    |  4 ++--
 3 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/src/pinky.c b/src/pinky.c
index c01b124..385949a 100644
--- a/src/pinky.c
+++ b/src/pinky.c
@@ -215,7 +215,7 @@ print_entry (const STRUCT_UTMP *utmp_ent)
      absolute file name in ut_line.  */
   if ( ! IS_ABSOLUTE_FILE_NAME (utmp_ent->ut_line))
     p = stpcpy (p, DEV_DIR_WITH_TRAILING_SLASH);
-  stpncpy (p, utmp_ent->ut_line, sizeof (utmp_ent->ut_line));
+  stzncpy (p, utmp_ent->ut_line, sizeof (utmp_ent->ut_line));

   if (stat (line, &stats) == 0)
     {
@@ -235,7 +235,7 @@ print_entry (const STRUCT_UTMP *utmp_ent)
       struct passwd *pw;
       char name[UT_USER_SIZE + 1];

-      stpncpy (name, UT_USER (utmp_ent), UT_USER_SIZE);
+      stzncpy (name, UT_USER (utmp_ent), UT_USER_SIZE);
       pw = getpwnam (name);
       if (pw == NULL)
         /* TRANSLATORS: Real name is unknown; at most 19 characters. */
@@ -276,7 +276,7 @@ print_entry (const STRUCT_UTMP *utmp_ent)
       char *display = NULL;

       /* Copy the host name into UT_HOST, and ensure it's nul terminated. */
-      stpncpy (ut_host, utmp_ent->ut_host, sizeof (utmp_ent->ut_host));
+      stzncpy (ut_host, utmp_ent->ut_host, sizeof (utmp_ent->ut_host));

       /* Look for an X display.  */
       display = strchr (ut_host, ':');
diff --git a/src/system.h b/src/system.h
index 5e3b3cb..6907603 100644
--- a/src/system.h
+++ b/src/system.h
@@ -626,6 +626,20 @@ The following directory is part of the cycle:\n  %s\n"), \
     }					\
   while (0)

+/* Like stpncpy, but do ensure that the result is NUL-terminated,
+   and do not NUL-pad out to LEN.  I.e., when strnlen (src, len) == len,
+   this function writes a NUL byte into dest[len].  Thus, the destination
+   buffer must be at least LEN+1 bytes long.  */
+static inline char *
+stzncpy (char *dest, char const *src, size_t len)
+{
+  char const *src_end = src + len;
+  while (src < src_end && *src)
+    *dest++ = *src++;
+  *dest = 0;
+  return dest;
+}
+
 #ifndef ARRAY_CARDINALITY
 # define ARRAY_CARDINALITY(Array) (sizeof (Array) / sizeof *(Array))
 #endif
diff --git a/src/who.c b/src/who.c
index 3ad8004..00a6e37 100644
--- a/src/who.c
+++ b/src/who.c
@@ -350,7 +350,7 @@ print_user (const STRUCT_UTMP *utmp_ent, time_t boottime)
      absolute file name in ut_line.  */
   if ( ! IS_ABSOLUTE_FILE_NAME (utmp_ent->ut_line))
     p = stpcpy (p, DEV_DIR_WITH_TRAILING_SLASH);
-  stpncpy (p, utmp_ent->ut_line, sizeof (utmp_ent->ut_line));
+  stzncpy (p, utmp_ent->ut_line, sizeof (utmp_ent->ut_line));

   if (stat (line, &stats) == 0)
     {
@@ -376,7 +376,7 @@ print_user (const STRUCT_UTMP *utmp_ent, time_t boottime)
       char *display = NULL;

       /* Copy the host name into UT_HOST, and ensure it's nul terminated. */
-      stpncpy (ut_host, utmp_ent->ut_host, sizeof (utmp_ent->ut_host));
+      stzncpy (ut_host, utmp_ent->ut_host, sizeof (utmp_ent->ut_host));

       /* Look for an X display.  */
       display = strchr (ut_host, ':');
--
1.7.11.2.194.g7bdb748


From MAILER-DAEMON Sun Jul 15 13:39:01 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SqSmb-0008Kz-3x
	for mharc-coreutils@gnu.org; Sun, 15 Jul 2012 13:39:01 -0400
Received: from eggs.gnu.org ([208.118.235.92]:54093)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <auerswal@unix-ag.uni-kl.de>) id 1SqSmZ-0008Kg-15
	for coreutils@gnu.org; Sun, 15 Jul 2012 13:38:59 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <auerswal@unix-ag.uni-kl.de>) id 1SqSmY-0001Wv-5L
	for coreutils@gnu.org; Sun, 15 Jul 2012 13:38:58 -0400
Received: from mailgw1.uni-kl.de ([131.246.120.220]:41140)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <auerswal@unix-ag.uni-kl.de>) id 1SqSmX-0001Wf-QC
	for coreutils@gnu.org; Sun, 15 Jul 2012 13:38:58 -0400
Received: from sushi.unix-ag.uni-kl.de (sushi.unix-ag.uni-kl.de
	[IPv6:2001:638:208:ef34:0:ff:fe00:65])
	by mailgw1.uni-kl.de (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id
	q6FHctt0025853
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Sun, 15 Jul 2012 19:38:55 +0200
Received: from [127.0.0.1] (localhost [127.0.0.1])
	by sushi.unix-ag.uni-kl.de (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP
	id q6FHcsiq011110; Sun, 15 Jul 2012 19:38:55 +0200
Message-ID: <5003002E.4080000@unix-ag.uni-kl.de>
Date: Sun, 15 Jul 2012 19:38:54 +0200
From: Erik Auerswald <auerswal@unix-ag.uni-kl.de>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:10.0.5) Gecko/20120624 Icedove/10.0.5
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
Subject: Re: removing coreutils' final strncpy uses
References: <87629pnn45.fsf@rho.meyering.net>
	<5002E463.40105@unix-ag.uni-kl.de>
	<87pq7xm1bx.fsf@rho.meyering.net>
In-Reply-To: <87pq7xm1bx.fsf@rho.meyering.net>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 131.246.120.220
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Jul 2012 17:39:00 -0000

Hi Jim,

On 07/15/2012 06:33 PM, Jim Meyering wrote:
> Erik Auerswald wrote:
>> On 07/15/2012 03:57 PM, Jim Meyering wrote:
>>> Remember the strncpy prohibition I added to "make syntax-check"
>>> not too long ago?  I exempted the uses in pinky.c and who.c
>>> because those programs don't really matter and their uses were
>>> not obviously bad.  Plus, I just didn't feel like it.
>>>
>>> Well, today I did, so removed them and, along the way, was surprised
>>> to see that while not officially wrong, they were unwarranted:  they
>>> would uselessly zero-pad out to the end of each destination buffer.
>>
>>  From reading the man pages of strncpy and stpncpy, stpncpy does the
>> same. From the stpncpy man page on debian/unstable (date 2011-09-28,
>> from Linux man-pages 3.40):
>>
>> DESCRIPTION
>>   The stpncpy() function copies at most n characters from the string
>>   pointed to by src, including the terminating null byte ('\0'), to the
>>   array pointed to by dest. Exactly n characters are written at dest.
>>   If the length strlen(src) is smaller than n, the remaining characters
>>   in the array pointed to by dest are filled with null bytes ('\0'), If
>>   the length strlen(src) is greater or equal to n, the string pointed to
>>   by dest will not be null-terminated.
>>
>> As written above the copied string may be unterminated after stpncpy
>> as well as after strncpy. What exactly is won by using stpncpy over
>> strncpy?
> ...
>>
>> I don't see any guarantee that utmp_ent->ut_host is null-terminated.
>>
>> Disclaimer: I have read the man page found on my system only, I don't
>> have experience using str[n]cpy. But I was curious about this change
                            ^
I meant st_p_[n]cpy...

>> and don't see the improvement.
>
> I knew I shouldn't have pushed that without review.
>
> Introducing bugs is definitely not an improvement.
> Thanks for spotting that.
>
> Here's a proposed fix:

[...]

Looks good to me.

Erik


From MAILER-DAEMON Sun Jul 15 14:12:40 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SqTJA-0003KO-9Z
	for mharc-coreutils@gnu.org; Sun, 15 Jul 2012 14:12:40 -0400
Received: from eggs.gnu.org ([208.118.235.92]:48461)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SqTJ7-0003Im-MM
	for coreutils@gnu.org; Sun, 15 Jul 2012 14:12:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SqTJ6-0000it-RU
	for coreutils@gnu.org; Sun, 15 Jul 2012 14:12:37 -0400
Received: from mx.meyering.net ([88.168.87.75]:36656)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SqTJ6-0000ip-Kk
	for coreutils@gnu.org; Sun, 15 Jul 2012 14:12:36 -0400
Received: from rho.meyering.net (rho.meyering.net [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id E202B639B3;
	Sun, 15 Jul 2012 20:12:35 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Erik Auerswald <auerswal@unix-ag.uni-kl.de>
Subject: Re: removing coreutils' final strncpy uses
In-Reply-To: <5003002E.4080000@unix-ag.uni-kl.de> (Erik Auerswald's message of
	"Sun, 15 Jul 2012 19:38:54 +0200")
References: <87629pnn45.fsf@rho.meyering.net>
	<5002E463.40105@unix-ag.uni-kl.de> <87pq7xm1bx.fsf@rho.meyering.net>
	<5003002E.4080000@unix-ag.uni-kl.de>
Date: Sun, 15 Jul 2012 20:12:35 +0200
Message-ID: <878veknbak.fsf@rho.meyering.net>
Lines: 5
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: 88.168.87.75
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sun, 15 Jul 2012 18:12:38 -0000

Erik Auerswald wrote:
...
> Looks good to me.

Thanks for the review.  Pushed.


From MAILER-DAEMON Sun Jul 15 22:04:12 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SqafU-0000lx-H2
	for mharc-coreutils@gnu.org; Sun, 15 Jul 2012 22:04:12 -0400
Received: from eggs.gnu.org ([208.118.235.92]:33907)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SqafS-0000lh-Qq
	for coreutils@gnu.org; Sun, 15 Jul 2012 22:04:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SqafR-0000Lg-QN
	for coreutils@gnu.org; Sun, 15 Jul 2012 22:04:10 -0400
Received: from mx1.redhat.com ([209.132.183.28]:18329)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SqafR-0000LU-I0
	for coreutils@gnu.org; Sun, 15 Jul 2012 22:04:09 -0400
Received: from int-mx10.intmail.prod.int.phx2.redhat.com
	(int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6G243mc019069
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Sun, 15 Jul 2012 22:04:03 -0400
Received: from pb-n5110.redhat.com (ovpn-116-17.ams2.redhat.com [10.36.116.17])
	by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q6G242Bg001854; Sun, 15 Jul 2012 22:04:02 -0400
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
To: coreutils@gnu.org
Subject: [PATCH] maint: move two df tests from tests/misc to tests/df
Date: Mon, 16 Jul 2012 03:03:59 +0100
Message-Id: <1342404239-4426-1-git-send-email-P@draigBrady.com>
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 16 Jul 2012 02:04:11 -0000

* test/Makefile.am: Reference the moved tests.
---
 tests/Makefile.am            |    4 ++--
 tests/{misc => df}/df-P      |    0
 tests/{misc/df => df/header} |    0
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename tests/{misc => df}/df-P (100%)
 rename tests/{misc/df => df/header} (100%)

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 944c7d2..4e7ea58 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -167,7 +167,6 @@ TESTS =						\
   misc/pr					\
   misc/join					\
   pr/pr-tests					\
-  misc/df-P					\
   misc/pwd-option				\
   misc/chcon-fail				\
   misc/cut					\
@@ -187,7 +186,6 @@ TESTS =						\
   misc/csplit-heap				\
   misc/date-sec					\
   misc/dircolors				\
-  misc/df					\
   misc/dirname					\
   misc/env-null					\
   misc/expand					\
@@ -374,6 +372,8 @@ TESTS =						\
   cp/src-base-dot				\
   cp/symlink-slash				\
   cp/thru-dangling				\
+  df/header					\
+  df/df-P					\
   df/unreadable					\
   dd/direct					\
   dd/misc					\
diff --git a/tests/misc/df-P b/tests/df/df-P
similarity index 100%
rename from tests/misc/df-P
rename to tests/df/df-P
diff --git a/tests/misc/df b/tests/df/header
similarity index 100%
rename from tests/misc/df
rename to tests/df/header
-- 
1.7.6.4



From MAILER-DAEMON Tue Jul 17 05:27:56 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sr44S-0004dd-9A
	for mharc-coreutils@gnu.org; Tue, 17 Jul 2012 05:27:56 -0400
Received: from eggs.gnu.org ([208.118.235.92]:59128)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Sr44N-0004dP-Sh
	for coreutils@gnu.org; Tue, 17 Jul 2012 05:27:55 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Sr44H-0001ub-VY
	for coreutils@gnu.org; Tue, 17 Jul 2012 05:27:51 -0400
Received: from mx.meyering.net ([88.168.87.75]:43036)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Sr44H-0001uG-OS
	for coreutils@gnu.org; Tue, 17 Jul 2012 05:27:45 -0400
Received: from rho.meyering.net (rho.meyering.net [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 7648360091;
	Tue, 17 Jul 2012 11:27:43 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: ohav chochmah <philomath868@gmail.com>
Subject: Re: removing coreutils' final strncpy uses
In-Reply-To: <CABOpGfuXR4k8_uN4wcn=GPHnW8kMWJj-Xdf8Bt0NvQs77W8opw@mail.gmail.com>
	(ohav chochmah's message of "Tue, 17 Jul 2012 10:37:49 +0200")
References: <CABOpGfuXR4k8_uN4wcn=GPHnW8kMWJj-Xdf8Bt0NvQs77W8opw@mail.gmail.com>
Date: Tue, 17 Jul 2012 11:27:43 +0200
Message-ID: <87394qohyo.fsf@rho.meyering.net>
Lines: 38
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: 88.168.87.75
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 17 Jul 2012 09:27:55 -0000

ohav chochmah wrote:
> Why not reuse memccpy (in glibc)? as in 'memccpy(to, from, '\0', size)'.
> Not only for sake of reusing, but memccpy is highly optimized for
> ia64, and may be optimized for other arches in the future.

Thanks for the suggestion, but that returns NULL
when it finds no NUL byte in the first SIZE bytes of FROM.
I could implement stzncpy in terms of that function instead
of open-coding the loop:

diff --git a/src/system.h b/src/system.h
index 6907603..10b04b2 100644
--- a/src/system.h
+++ b/src/system.h
@@ -633,11 +633,13 @@ The following directory is part of the cycle:\n  %s\n"), \
 static inline char *
 stzncpy (char *dest, char const *src, size_t len)
 {
-  char const *src_end = src + len;
-  while (src < src_end && *src)
-    *dest++ = *src++;
-  *dest = 0;
-  return dest;
+  char *p = memccpy (dest, src, 0, len);
+  if (p == NULL)
+    {
+      p = dest + len;
+      *p = 0;
+    }
+  return p;
 }

 #ifndef ARRAY_CARDINALITY

but (for portability) that would require a gnulib module for memccpy.
Such a module would be welcome regardless, but here it seems like
it's not worth the complication, since the few uses of stzncpy are not
performance sensitive.


From MAILER-DAEMON Tue Jul 17 07:29:48 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sr5yO-0000xF-7S
	for mharc-coreutils@gnu.org; Tue, 17 Jul 2012 07:29:48 -0400
Received: from eggs.gnu.org ([208.118.235.92]:34276)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1Sr5yI-0000wq-SP
	for coreutils@gnu.org; Tue, 17 Jul 2012 07:29:46 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1Sr5yH-0005f1-Nn
	for coreutils@gnu.org; Tue, 17 Jul 2012 07:29:42 -0400
Received: from mx1.redhat.com ([209.132.183.28]:9666)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1Sr5yH-0005ew-EV
	for coreutils@gnu.org; Tue, 17 Jul 2012 07:29:41 -0400
Received: from int-mx01.intmail.prod.int.phx2.redhat.com
	(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6HBTd3I008630
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 17 Jul 2012 07:29:40 -0400
Received: from [10.3.113.126] (ovpn-113-126.phx2.redhat.com [10.3.113.126])
	by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id q6HBTdIi000717; Tue, 17 Jul 2012 07:29:39 -0400
Message-ID: <50054CA2.3000502@redhat.com>
Date: Tue, 17 Jul 2012 05:29:38 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:13.0) Gecko/20120615 Thunderbird/13.0.1
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
Subject: Re: removing coreutils' final strncpy uses
References: <CABOpGfuXR4k8_uN4wcn=GPHnW8kMWJj-Xdf8Bt0NvQs77W8opw@mail.gmail.com>
	<87394qohyo.fsf@rho.meyering.net>
In-Reply-To: <87394qohyo.fsf@rho.meyering.net>
X-Enigmail-Version: 1.4.3
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="------------enig4F13876E9F786F9754E359C3"
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: ohav chochmah <philomath868@gmail.com>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 17 Jul 2012 11:29:47 -0000

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

On 07/17/2012 03:27 AM, Jim Meyering wrote:
> ohav chochmah wrote:
>> Why not reuse memccpy (in glibc)? as in 'memccpy(to, from, '\0', size)=
'.
>> Not only for sake of reusing, but memccpy is highly optimized for
>> ia64, and may be optimized for other arches in the future.
>=20

>=20
> but (for portability) that would require a gnulib module for memccpy.
> Such a module would be welcome regardless, but here it seems like
> it's not worth the complication, since the few uses of stzncpy are not
> performance sensitive.

An additional point: memccpy is POSIX, stzncpy is not.  We should
implement a memccpy module in gnulib anyways, but according to the
current glibc docs, it is already portable to pretty much everywhere but
BeOS (even mingw has it).

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


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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJQBUyjAAoJEKeha0olJ0NqthkH/RxA4OSc+iObENLJjEblJmhN
CeMZjSNyzy+2DH5y5Fjf86UmkwNE3WiCvVRJL8On7WfWWkpwlZpawKzDf2RFcmyc
R1maP+1qKCNRUBYwuoMa0aJA0Bv1ojsJZ1tP12ajovRM0Xa3P0+nua+bm/N/ZAtI
JAJrFc2xGsy1V1uxNWEuZAO8gMuSWkqeWIlM2/ej9S8q4CBY+sDQ8Ab8Y8O3rxao
A4HCLJS0Q59H09sg4HZmruAOOiaSmmVl1+n516xtbmqPYNjK4B/SgxWaQEKVEXqu
6/iPdXraF+T3UrK1F5miL/mmTuAfO+1Sriv55owhV1ZDl2juLwYdf+knTvhalaQ=
=HuU8
-----END PGP SIGNATURE-----

--------------enig4F13876E9F786F9754E359C3--


From MAILER-DAEMON Tue Jul 17 07:40:20 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sr68a-00021G-Qc
	for mharc-coreutils@gnu.org; Tue, 17 Jul 2012 07:40:20 -0400
Received: from eggs.gnu.org ([208.118.235.92]:56583)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <philomath868@gmail.com>) id 1Sr3Hz-0006kX-8b
	for coreutils@gnu.org; Tue, 17 Jul 2012 04:37:52 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <philomath868@gmail.com>) id 1Sr3Hy-0004WQ-AI
	for coreutils@gnu.org; Tue, 17 Jul 2012 04:37:51 -0400
Received: from mail-ob0-f169.google.com ([209.85.214.169]:65120)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <philomath868@gmail.com>) id 1Sr3Hy-0004WM-4T
	for coreutils@gnu.org; Tue, 17 Jul 2012 04:37:50 -0400
Received: by obhx4 with SMTP id x4so335954obh.0
	for <coreutils@gnu.org>; Tue, 17 Jul 2012 01:37:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:cc:content-type;
	bh=BLf08S6X3T9AX3zU1ZgqbWv/Hcx5NyrUGIetA7bwRjc=;
	b=ihJNajgcI3ThNkS0nDiBF5s+sylK9ZO1QIwMl0kXadlfSns88kcgD6KzVJgliyJxg8
	rdtDvr2PeWWlzaPHXXGHir+luF0YUWCRMoc1XkgDrzuQTeaaCVIDWNYGlAChy++w/rPj
	8KJoC4YA5ptNqDbZi235MFhwlSt8980dERkhqhHo+YvAQr9TLZuDj0OSh51qUeM5xugM
	3lpm1IjLlq14Y1Badr0TiX3VQ4Vu+5coq+GbtumkvpWZAHhWvVs6arSobe2i6SdfnL/y
	3yrrdjZ6Q7SYF+0Y4L5bvdsmy4rAV5VGoUm3I2DOMPT/RdhWE95V54mL8c8uJ48B4g4U
	N4tg==
MIME-Version: 1.0
Received: by 10.182.228.6 with SMTP id se6mr2104777obc.29.1342514269036; Tue,
	17 Jul 2012 01:37:49 -0700 (PDT)
Received: by 10.182.155.1 with HTTP; Tue, 17 Jul 2012 01:37:49 -0700 (PDT)
Date: Tue, 17 Jul 2012 10:37:49 +0200
Message-ID: <CABOpGfuXR4k8_uN4wcn=GPHnW8kMWJj-Xdf8Bt0NvQs77W8opw@mail.gmail.com>
Subject: Re: removing coreutils' final strncpy uses
From: ohav chochmah <philomath868@gmail.com>
To: Jim Meyering <jim@meyering.net>, coreutils@gnu.org
Content-Type: text/plain; charset=ISO-8859-1
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.214.169
X-Mailman-Approved-At: Tue, 17 Jul 2012 07:40:19 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 17 Jul 2012 08:37:52 -0000

Hi,

Why not reuse memccpy (in glibc)? as in 'memccpy(to, from, '\0', size)'.
Not only for sake of reusing, but memccpy is highly optimized for
ia64, and may be optimized for other arches in the future.

Cheers,
philomath.


From MAILER-DAEMON Tue Jul 17 07:40:20 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sr68a-00021T-U9
	for mharc-coreutils@gnu.org; Tue, 17 Jul 2012 07:40:20 -0400
Received: from eggs.gnu.org ([208.118.235.92]:58606)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <philomath868@gmail.com>) id 1Sr41i-0004OP-T9
	for coreutils@gnu.org; Tue, 17 Jul 2012 05:25:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <philomath868@gmail.com>) id 1Sr41Z-00016D-AP
	for coreutils@gnu.org; Tue, 17 Jul 2012 05:25:06 -0400
Received: from mail-ob0-f169.google.com ([209.85.214.169]:43621)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <philomath868@gmail.com>) id 1Sr41Y-000160-UD
	for coreutils@gnu.org; Tue, 17 Jul 2012 05:24:57 -0400
Received: by obhx4 with SMTP id x4so405689obh.0
	for <coreutils@gnu.org>; Tue, 17 Jul 2012 02:24:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=T7yKeVeV59aF0n74nVKTF2JzbIPeBF8XOOjSipiLYyU=;
	b=L4rTRuRShMr31uQZNEGO9IpsXWjhblKj4l1qcP3cuW2/NBMUzeoIOo2tLWODW10gjX
	nbPdSfFgH1cVf2bJcLh0yBpcyQZLZvwFtroI5b82zTNRvQD65yJBndS3igA9QEL8KNQo
	+aOgFum0t/d9KNXwhTqYNrF26kJri1BJSmp5+ixBIn6wBhaVgaX+CfMkePHR4g8q2bne
	cKx84cSZ0jS6qOpQxOnYZvvmspl2m0HhNgdPjbSQxLUJvk47XQ66zPzWqeUMT9WHb81G
	ej+8F+sAP0DvSsTMDwY3Mz+3lgez22Xq/wUf7bccJhG/JDPPPfi5uX1CySnyKcsFBJHg
	TsCg==
MIME-Version: 1.0
Received: by 10.182.50.98 with SMTP id b2mr2327440obo.28.1342517096424; Tue,
	17 Jul 2012 02:24:56 -0700 (PDT)
Received: by 10.182.155.1 with HTTP; Tue, 17 Jul 2012 02:24:56 -0700 (PDT)
In-Reply-To: <CABOpGfuXR4k8_uN4wcn=GPHnW8kMWJj-Xdf8Bt0NvQs77W8opw@mail.gmail.com>
References: <CABOpGfuXR4k8_uN4wcn=GPHnW8kMWJj-Xdf8Bt0NvQs77W8opw@mail.gmail.com>
Date: Tue, 17 Jul 2012 11:24:56 +0200
Message-ID: <CABOpGfvaheshUYJeSTM6bwzO=v1OyscHRYOMbSNOxnSvt4GG2A@mail.gmail.com>
Subject: Re: removing coreutils' final strncpy uses
From: ohav chochmah <philomath868@gmail.com>
To: Jim Meyering <jim@meyering.net>, coreutils@gnu.org
Content-Type: text/plain; charset=ISO-8859-1
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.214.169
X-Mailman-Approved-At: Tue, 17 Jul 2012 07:40:19 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 17 Jul 2012 09:25:16 -0000

Oops, never mind.  memccpy may not nul-terminate, too...
(there is strlcpy in libbsd, though).

Cheers.

On 7/17/12, ohav chochmah <philomath868@gmail.com> wrote:
> Hi,
>
> Why not reuse memccpy (in glibc)? as in 'memccpy(to, from, '\0', size)'.
> Not only for sake of reusing, but memccpy is highly optimized for
> ia64, and may be optimized for other arches in the future.
>
> Cheers,
> philomath.
>


From MAILER-DAEMON Tue Jul 17 11:10:31 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sr9Pz-0002Cs-CE
	for mharc-coreutils@gnu.org; Tue, 17 Jul 2012 11:10:31 -0400
Received: from eggs.gnu.org ([208.118.235.92]:33298)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kerolasa@gmail.com>) id 1Sr9Pu-0002Br-0Q
	for coreutils@gnu.org; Tue, 17 Jul 2012 11:10:30 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <kerolasa@gmail.com>) id 1Sr9Pl-000792-Ry
	for coreutils@gnu.org; Tue, 17 Jul 2012 11:10:25 -0400
Received: from mail-wg0-f49.google.com ([74.125.82.49]:50145)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kerolasa@gmail.com>) id 1Sr9Pl-00078x-Jl
	for coreutils@gnu.org; Tue, 17 Jul 2012 11:10:17 -0400
Received: by wgbez12 with SMTP id ez12so348162wgb.30
	for <coreutils@gnu.org>; Tue, 17 Jul 2012 08:10:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:reply-to:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=BLJvfeyNE2ABrt3jDx5wKXGR11vAJFKasSYCEd5FN30=;
	b=A5S1kxuj7G4sZHUVGEh2aeQ0O1E3v5RUkaazQR1aR4epijmYltfRshtaWs/1auEfH5
	XgtbGYfQasbjod/7BHxTzV1iN+Ehl8Kl5mPJrFq/4RuYZfqUHYHjM7X/d4k23TkJQ8Es
	w6NCPTSJIaOP2B+4tQl80i9faHwfTkVAAYaeIxRCxTYh6Z8cfEwaXrn+QaOhxdmgWQuS
	VccghBJoNooL0crpLTumfRWFbtLuvLQGugOoZoHwCikXIGWMt1PA0W3leJTdJp7Nf8cl
	EY2LjaZAWJ6TUCAksH8rwp1zNPKGPfoi1khaECqTKr5X7KP6JaYd0BTmk0iuP9Yrjyab
	knRA==
MIME-Version: 1.0
Received: by 10.180.78.99 with SMTP id a3mr5029386wix.15.1342537816796; Tue,
	17 Jul 2012 08:10:16 -0700 (PDT)
Sender: kerolasa@gmail.com
Received: by 10.194.34.170 with HTTP; Tue, 17 Jul 2012 08:10:16 -0700 (PDT)
In-Reply-To: <87r4sldpzk.fsf@rho.meyering.net>
References: <CAG27Bk0dwWn9L8MJ8x5TBchNvZ5CY2y+ATeAmypDqZi1Y8esZw@mail.gmail.com>
	<871ulmc3bj.fsf@rho.meyering.net>
	<CAG27Bk0VuuGbe2nC9-gW+bEoGjA3v6Lw30V-enUSNAHT5cTbfw@mail.gmail.com>
	<87k3ze9xfd.fsf@rho.meyering.net>
	<CAG27Bk3B9qH8g5aaFv-b0ASATb7sFCMrOJ8gWkif278O1bD+ow@mail.gmail.com>
	<87r4sldpzk.fsf@rho.meyering.net>
Date: Tue, 17 Jul 2012 17:10:16 +0200
X-Google-Sender-Auth: qnMPrFwVv75IN7BSc8hfGm9hUvI
Message-ID: <CAG27Bk2x-G35Ln0Zpy7KO9Exi-HzTBDA+PAQ+kVswX-Ut1opFA@mail.gmail.com>
Subject: Re: rename: move command from util-linux to coreutils
From: Sami Kerola <kerolasa@iki.fi>
To: Jim Meyering <jim@meyering.net>
Content-Type: text/plain; charset=ISO-8859-1
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 74.125.82.49
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: kerolasa@gmail.com
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 17 Jul 2012 15:10:30 -0000

On Mon, Jul 9, 2012 at 3:27 PM, Jim Meyering <jim@meyering.net> wrote:

Hi Jim,

> Thanks for the fixes.

You're welcome.

> There is too much new and untested code to include this new program
> in the upcoming release.

That is ok. Perhaps coreutils 8.19 or 8.20 is suitable release target
for this command.

> A few things should be changed regardless.
> For consistency with other GNU tools:
>
>   s/--test/--dry-run/

I changed the option to '-u, --dry-run' which is exact match with mktemp.

> Also, please ensure that your new code compiles
> when configure with --enable-gcc-warnings.

All errors and warnings are fixed. Thank you for mentioning the
--enable-gcc-warnings, I missed it in README.hacking.

The patch is also moved on top of upstream HEAD. As I do not expect
the patch to be either rejected or accepted any time soon I probably
will have to do the same few times more, which is not a problem other
than you will see forced pushes on my side.


The following changes since commit 2f90a1b19161d4924c251dce9cf5ff8a6d4c1d13:

  maint: move two df tests from tests/misc to tests/df (2012-07-16
02:51:41 +0100)

are available in the git repository at:

  git://github.com/kerolasa/coreutils.git rename


-- 
   Sami Kerola
   http://www.iki.fi/kerolasa/


From MAILER-DAEMON Tue Jul 17 14:57:17 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SrCxR-0005Y8-Jb
	for mharc-coreutils@gnu.org; Tue, 17 Jul 2012 14:57:17 -0400
Received: from eggs.gnu.org ([208.118.235.92]:57767)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <auerswal@unix-ag.uni-kl.de>) id 1SrCxP-0005Xi-4e
	for coreutils@gnu.org; Tue, 17 Jul 2012 14:57:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <auerswal@unix-ag.uni-kl.de>) id 1SrCxO-0004CW-6b
	for coreutils@gnu.org; Tue, 17 Jul 2012 14:57:15 -0400
Received: from mailgw1.uni-kl.de ([131.246.120.220]:59146)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <auerswal@unix-ag.uni-kl.de>) id 1SrCxN-0004Bz-SZ
	for coreutils@gnu.org; Tue, 17 Jul 2012 14:57:14 -0400
Received: from sushi.unix-ag.uni-kl.de (sushi.unix-ag.uni-kl.de
	[IPv6:2001:638:208:ef34:0:ff:fe00:65])
	by mailgw1.uni-kl.de (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id
	q6HIv93r005790
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT);
	Tue, 17 Jul 2012 20:57:09 +0200
Received: from [127.0.0.1] (localhost [127.0.0.1])
	by sushi.unix-ag.uni-kl.de (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP
	id q6HIv8vG001035; Tue, 17 Jul 2012 20:57:09 +0200
Message-ID: <5005B584.7030304@unix-ag.uni-kl.de>
Date: Tue, 17 Jul 2012 20:57:08 +0200
From: Erik Auerswald <auerswal@unix-ag.uni-kl.de>
User-Agent: Mozilla/5.0 (X11; Linux i686;
	rv:10.0.5) Gecko/20120624 Icedove/10.0.5
MIME-Version: 1.0
To: coreutils@gnu.org
Subject: Re: rename: move command from util-linux to coreutils
References: <CAG27Bk0dwWn9L8MJ8x5TBchNvZ5CY2y+ATeAmypDqZi1Y8esZw@mail.gmail.com>
	<871ulmc3bj.fsf@rho.meyering.net>
	<CAG27Bk0VuuGbe2nC9-gW+bEoGjA3v6Lw30V-enUSNAHT5cTbfw@mail.gmail.com>
	<87k3ze9xfd.fsf@rho.meyering.net>
	<CAG27Bk3B9qH8g5aaFv-b0ASATb7sFCMrOJ8gWkif278O1bD+ow@mail.gmail.com>
	<87r4sldpzk.fsf@rho.meyering.net>
	<CAG27Bk2x-G35Ln0Zpy7KO9Exi-HzTBDA+PAQ+kVswX-Ut1opFA@mail.gmail.com>
In-Reply-To: <CAG27Bk2x-G35Ln0Zpy7KO9Exi-HzTBDA+PAQ+kVswX-Ut1opFA@mail.gmail.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 131.246.120.220
Cc: kerolasa@gmail.com
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 17 Jul 2012 18:57:16 -0000

Hi,

On 07/17/2012 05:10 PM, Sami Kerola wrote:
> On Mon, Jul 9, 2012 at 3:27 PM, Jim Meyering<jim@meyering.net>  wrote:
> [...]
>> A few things should be changed regardless.
>> For consistency with other GNU tools:
>>
>>    s/--test/--dry-run/
>
> I changed the option to '-u, --dry-run' which is exact match with mktemp.

I don't like the short option '-u'. On debian, the PERL rename 
(/usr/bin/prename, see update-alternatives --list rename) uses the short 
option '-n' for dry-run functionality. Not sure about other rename programs.

I'd prefer just the long option '--dry-run'.

Thanks,
Erik


From MAILER-DAEMON Tue Jul 17 16:07:27 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SrE3L-00026F-24
	for mharc-coreutils@gnu.org; Tue, 17 Jul 2012 16:07:27 -0400
Received: from eggs.gnu.org ([208.118.235.92]:40434)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SrE3I-00024e-JM
	for coreutils@gnu.org; Tue, 17 Jul 2012 16:07:25 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SrE3H-0006bK-Co
	for coreutils@gnu.org; Tue, 17 Jul 2012 16:07:24 -0400
Received: from mx.meyering.net ([88.168.87.75]:44745)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SrE3H-0006bD-61
	for coreutils@gnu.org; Tue, 17 Jul 2012 16:07:23 -0400
Received: from rho.meyering.net (rho.meyering.net [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 32BE4600A5;
	Tue, 17 Jul 2012 22:07:22 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Erik Auerswald <auerswal@unix-ag.uni-kl.de>
Subject: Re: rename: move command from util-linux to coreutils
In-Reply-To: <5005B584.7030304@unix-ag.uni-kl.de> (Erik Auerswald's message of
	"Tue, 17 Jul 2012 20:57:08 +0200")
References: <CAG27Bk0dwWn9L8MJ8x5TBchNvZ5CY2y+ATeAmypDqZi1Y8esZw@mail.gmail.com>
	<871ulmc3bj.fsf@rho.meyering.net>
	<CAG27Bk0VuuGbe2nC9-gW+bEoGjA3v6Lw30V-enUSNAHT5cTbfw@mail.gmail.com>
	<87k3ze9xfd.fsf@rho.meyering.net>
	<CAG27Bk3B9qH8g5aaFv-b0ASATb7sFCMrOJ8gWkif278O1bD+ow@mail.gmail.com>
	<87r4sldpzk.fsf@rho.meyering.net>
	<CAG27Bk2x-G35Ln0Zpy7KO9Exi-HzTBDA+PAQ+kVswX-Ut1opFA@mail.gmail.com>
	<5005B584.7030304@unix-ag.uni-kl.de>
Date: Tue, 17 Jul 2012 22:07:22 +0200
Message-ID: <87mx2ydudh.fsf@rho.meyering.net>
Lines: 25
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: 88.168.87.75
Cc: coreutils@gnu.org, kerolasa@gmail.com
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 17 Jul 2012 20:07:25 -0000

Erik Auerswald wrote:
> On 07/17/2012 05:10 PM, Sami Kerola wrote:
>> On Mon, Jul 9, 2012 at 3:27 PM, Jim Meyering<jim@meyering.net>  wrote:
>> [...]
>>> A few things should be changed regardless.
>>> For consistency with other GNU tools:
>>>
>>>    s/--test/--dry-run/
>>
>> I changed the option to '-u, --dry-run' which is exact match with mktemp.
>
> I don't like the short option '-u'. On debian, the PERL rename
> (/usr/bin/prename, see update-alternatives --list rename) uses the
> short option '-n' for dry-run functionality. Not sure about other
> rename programs.
>
> I'd prefer just the long option '--dry-run'.

I agree.  Using no short option is probably best,
especially when you realize that you can abbreviate
it as "--d" (assuming there's no other --d... option).

However, if you feel a short-named option is required,
then "-n" is more standard.  For example, GNU make and numerous
git commands provide -n as a synonym for --dry-run.


From MAILER-DAEMON Wed Jul 18 16:01:11 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SraQp-0001wf-SK
	for mharc-coreutils@gnu.org; Wed, 18 Jul 2012 16:01:11 -0400
Received: from eggs.gnu.org ([208.118.235.92]:43140)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SraQl-0001vC-Mt
	for coreutils@gnu.org; Wed, 18 Jul 2012 16:01:10 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SraQk-0005QY-CW
	for coreutils@gnu.org; Wed, 18 Jul 2012 16:01:07 -0400
Received: from mx1.redhat.com ([209.132.183.28]:38989)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SraQj-0005QK-U1
	for coreutils@gnu.org; Wed, 18 Jul 2012 16:01:06 -0400
Received: from int-mx11.intmail.prod.int.phx2.redhat.com
	(int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6IK14Xn015804
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <coreutils@gnu.org>; Wed, 18 Jul 2012 16:01:04 -0400
Received: from [10.3.113.126] (ovpn-113-126.phx2.redhat.com [10.3.113.126])
	by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q6IK11Ef017100
	for <coreutils@gnu.org>; Wed, 18 Jul 2012 16:01:04 -0400
Resent-From: Eric Blake <eblake@redhat.com>
Resent-To: Coreutils <coreutils@gnu.org>
Resent-Date: Wed, 18 Jul 2012 14:01:01 -0600
Resent-Message-Id: <500715FD.6030503@redhat.com>
Resent-User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:13.0) Gecko/20120615 Thunderbird/13.0.1
Received: from eggs.gnu.org ([208.118.235.92]:52237)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <enda_k2@yahoo.com>) id 1SrZ2X-0006wa-Og
	for coreutils@gnu.org; Wed, 18 Jul 2012 14:32:06 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <enda_k2@yahoo.com>) id 1SrZ2W-00039d-Sz
	for coreutils@gnu.org; Wed, 18 Jul 2012 14:32:01 -0400
Received: from nm38-vm1.bullet.mail.bf1.yahoo.com ([72.30.239.17]:26143)
	by eggs.gnu.org with smtp (Exim 4.71)
	(envelope-from <enda_k2@yahoo.com>) id 1SrZ2W-00039X-Mn
	for coreutils@gnu.org; Wed, 18 Jul 2012 14:32:00 -0400
Received: from [98.139.215.141] by nm38.bullet.mail.bf1.yahoo.com with NNFMP;
	18 Jul 2012 18:31:59 -0000
Received: from [98.139.212.242] by tm12.bullet.mail.bf1.yahoo.com with NNFMP;
	18 Jul 2012 18:31:59 -0000
Received: from [127.0.0.1] by omp1051.mail.bf1.yahoo.com with NNFMP;
	18 Jul 2012 18:31:59 -0000
X-Yahoo-Newman-Property: ymail-3
X-Yahoo-Newman-Id: 708868.89784.bm@omp1051.mail.bf1.yahoo.com
Received: (qmail 54505 invoked by uid 60001); 18 Jul 2012 18:31:59 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024;
	t=1342636319; bh=5x80TPqqD022XKM1ye154j7cywkWVcOjX97sUVky9H0=;
	h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type;
	b=6bDh6F6uTo6m1xWt0TFz4WDdJVraVDtDRO4NnAeBG98wysC3jBUQ/e0GV+C3QYFUbprX222n+et6s/B/NIdW1KqHnrAh95kKYA1otrx3PoXUc8qgG9TIYpp6U7/q07rjwPpBW/CALvoIOw7y0AwEDHiNrGrjpYrejYI1tDb5r+c=
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com;
	h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type;
	b=fLI3edo/OSYu3inZS1y6Fgq1xOYq46cP8VEmJ+mWZgXkpW0JCbCyvQMt77NlXV+/lGBxV4Tzt+p45WUfRfWyc8sNn7GfdpRw0bxPUWHm5tmM5+h306MHPyrFv7A0OCFjhcgEZMmDyPelz25LVth5io5zvFsnx4Yv7ZntFWN/eQI=;
X-YMail-OSG: V501T5sVM1mLyadLfr7ai9dSAQ_mHWhw9NTiL62vHUXJmOA
	O3J2esdwEkV.nYAPEtfd9i9FWt.RZ6KH0uowgUlGcWU3HiLQxqPkO9EX_ul8
	iXJROi2Ls7FvmMP7fDLp9bGYpqLv15KWldGPGxe7JWM2sAHaNMS8DiGtK8LI
	0QIpMmXUYWmKmQWUuHMUZQUi_reLdO8BjJvWupb8_MWUqncnrd9kfzpB4wNG
	4g547ABAbwZVw8JUgByxyIj_m8VY2uWWLbvlgv.MIvhh4gRRrRVezv_ifc26
	io81Sb1dsM7OuM_giSbAUaBcsBUIztDiStQikWblGcSi9mqUtgV2bMoia28m
	F5AacNN7k_60yhdXZj.490U0ceGFkpz3rmexeGDroevRmGXdNzEJ1ReiHv5o
	zzsN1Np8viXizwPVjxd4wlw--
Received: from [143.239.7.7] by web163106.mail.bf1.yahoo.com via HTTP;
	Wed, 18 Jul 2012 11:31:59 PDT
Message-ID: <1342636319.54314.YahooMailNeo@web163106.mail.bf1.yahoo.com>
Date: Wed, 18 Jul 2012 11:31:59 -0700 (PDT)
From: Enda <enda_k2@yahoo.com>
Subject: ls files that were modified on a certain date
To: "coreutils@gnu.org" <coreutils@gnu.org>
MIME-Version: 1.0
Content-Type: multipart/alternative;
	boundary="-1423285701-2082152787-1342636319=:54314"
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: Enda <enda_k2@yahoo.com>
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 18 Jul 2012 20:01:10 -0000

---1423285701-2082152787-1342636319=:54314
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

How do I list files=A0that were modified on (or since) a certain date?=0A=
=0A- Enda
---1423285701-2082152787-1342636319=:54314
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable

<html><body><div style=3D"color:#000; background-color:#fff; font-family:ta=
homa, new york, times, serif;font-size:12pt"><div><font face=3D"tahoma, new=
 york, times, serif">How do I list files&nbsp;</font><span style=3D"font-fa=
mily: tahoma, 'new york', times, serif; ">that were modified on (or since) =
a certain date?</span></div><div><span style=3D"font-family: tahoma, 'new y=
ork', times, serif; "><br></span></div><div><span style=3D"font-family: tah=
oma, 'new york', times, serif; ">- Enda</span></div></div></body></html>
---1423285701-2082152787-1342636319=:54314--



From MAILER-DAEMON Wed Jul 18 16:04:53 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SraUO-0002EJ-Vj
	for mharc-coreutils@gnu.org; Wed, 18 Jul 2012 16:04:52 -0400
Received: from eggs.gnu.org ([208.118.235.92]:50893)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SraUM-0002Cu-CP
	for coreutils@gnu.org; Wed, 18 Jul 2012 16:04:51 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SraUL-0006PV-5B
	for coreutils@gnu.org; Wed, 18 Jul 2012 16:04:50 -0400
Received: from mx1.redhat.com ([209.132.183.28]:47094)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SraUK-0006P2-Td
	for coreutils@gnu.org; Wed, 18 Jul 2012 16:04:49 -0400
Received: from int-mx11.intmail.prod.int.phx2.redhat.com
	(int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6IK4l4t016349
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 18 Jul 2012 16:04:47 -0400
Received: from [10.36.116.55] (ovpn-116-55.ams2.redhat.com [10.36.116.55])
	by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q6IK4jKe018125
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Wed, 18 Jul 2012 16:04:47 -0400
Message-ID: <500716DD.6070304@draigBrady.com>
Date: Wed, 18 Jul 2012 21:04:45 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Enda <enda_k2@yahoo.com>
Subject: Re: ls files that were modified on a certain date
References: <1342636319.54314.YahooMailNeo@web163106.mail.bf1.yahoo.com>
In-Reply-To: <1342636319.54314.YahooMailNeo@web163106.mail.bf1.yahoo.com>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=ISO-8859-1
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id
	q6IK4l4t016349
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: "coreutils@gnu.org" <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 18 Jul 2012 20:04:51 -0000

On 07/18/2012 07:31 PM, Enda wrote:
> How do I list files that were modified on (or since) a certain date?

find ....

Here's a script that shows the concept:

http://www.pixelbeat.org/scripts/find_mm_yyyy

cheers,
P=E1draig.


From MAILER-DAEMON Wed Jul 18 16:10:25 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SraZl-0002dP-LS
	for mharc-coreutils@gnu.org; Wed, 18 Jul 2012 16:10:25 -0400
Received: from eggs.gnu.org ([208.118.235.92]:33928)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SraZi-0002bT-Le
	for coreutils@gnu.org; Wed, 18 Jul 2012 16:10:23 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SraZh-0008Bx-F4
	for coreutils@gnu.org; Wed, 18 Jul 2012 16:10:22 -0400
Received: from mx1.redhat.com ([209.132.183.28]:35771)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1SraZh-0008Bh-68
	for coreutils@gnu.org; Wed, 18 Jul 2012 16:10:21 -0400
Received: from int-mx09.intmail.prod.int.phx2.redhat.com
	(int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6IKAKGW019049
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 18 Jul 2012 16:10:20 -0400
Received: from [10.3.113.126] (ovpn-113-126.phx2.redhat.com [10.3.113.126])
	by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q6IKAKOI029848; Wed, 18 Jul 2012 16:10:20 -0400
Message-ID: <5007182B.408@redhat.com>
Date: Wed, 18 Jul 2012 14:10:19 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:13.0) Gecko/20120615 Thunderbird/13.0.1
MIME-Version: 1.0
To: Enda <enda_k2@yahoo.com>
Subject: Re: ls files that were modified on a certain date
References: <1342636319.54314.YahooMailNeo@web163106.mail.bf1.yahoo.com>
In-Reply-To: <1342636319.54314.YahooMailNeo@web163106.mail.bf1.yahoo.com>
X-Enigmail-Version: 1.4.3
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="------------enigAC5A7B4240492CBAC637162E"
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: "coreutils@gnu.org" <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 18 Jul 2012 20:10:23 -0000

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enigAC5A7B4240492CBAC637162E
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 07/18/2012 12:31 PM, Enda wrote:
> How do I list files that were modified on (or since) a certain date?

By using 'find'.  GNU findutils includes this example in its documentatio=
n:

       find $HOME -mtime 0

       Search for files in your home directory which have been modified
in the
       last twenty-four hours.  This command works this way because  the
 time
       since  each  file  was  last  modified  is  divided by 24 hours
and any
       remainder is discarded.  That means that to match -mtime 0, a
file will
       have  to  have  a  modification in the past which is less than 24
hours
       ago.


Further questions on 'find' should be directed to the findutils list, as
this is not part of coreutils.  But if you need help figuring out how to
use $(()) and 'date' to do a shell computation of the value of the
argument to pass to find's -mtime flag, then this is the right place to
ask.  For example, finding files touched this year:

find -mtime $(( ( $(date +%s) - $(date -d 'Jan 1') ) / 24 / 60 / 60 ))

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


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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJQBxgrAAoJEKeha0olJ0NqC60H/1BCEJxThn9iuHPlXWIGbHXN
7+Hvr3fCspdhv7KCs18pfRO00p1rfhDfaJ0cG8nS+ge564hEFqIboCsfsaUX1ao4
mxJhhvXhzTGF9R+SwF54Fs/ekEp23rOtWmLRdGEu7YmZXs6qk9QoD/M/jzsMTp+N
310LUH4BHXwMM/iv4xvZU+rBcVxRJjFVICfGPgv3vQTR+UBsqxRVDSwCVQqBzCbs
QvU8ICaC5sQ+XEP8WOvkmfa7UTMFXcdPVkjRDyrIucHULJmMFUUS6Uh/anuWJaCo
UR2EJShyelCZk7NkhyPx/LV4H5bKCt25W8f+8WZFB+62cW9i//g7SuIIv4mR6Ak=
=9To8
-----END PGP SIGNATURE-----

--------------enigAC5A7B4240492CBAC637162E--


From MAILER-DAEMON Wed Jul 18 16:32:08 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sraum-0004iV-PV
	for mharc-coreutils@gnu.org; Wed, 18 Jul 2012 16:32:08 -0400
Received: from eggs.gnu.org ([208.118.235.92]:35830)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <whitebox@nefkom.net>) id 1Srauk-0004iI-Rh
	for coreutils@gnu.org; Wed, 18 Jul 2012 16:32:07 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <whitebox@nefkom.net>) id 1Srauj-00065S-OS
	for coreutils@gnu.org; Wed, 18 Jul 2012 16:32:06 -0400
Received: from mail-out.m-online.net ([212.18.0.9]:50592)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <whitebox@nefkom.net>) id 1Srauj-00065O-IV
	for coreutils@gnu.org; Wed, 18 Jul 2012 16:32:05 -0400
Received: from frontend4.mail.m-online.net (unknown [192.168.8.180])
	by mail-out.m-online.net (Postfix) with ESMTP id 3WcqnV0G0lz4KK6V;
	Wed, 18 Jul 2012 22:33:33 +0200 (CEST)
Received: from igel.home (ppp-93-104-147-56.dynamic.mnet-online.de
	[93.104.147.56])
	by mail.mnet-online.de (Postfix) with ESMTPA id 3Wcqlm6J4wzbbkw;
	Wed, 18 Jul 2012 22:32:04 +0200 (CEST)
Received: by igel.home (Postfix, from userid 501)
	id 9AC0ACA2A4; Wed, 18 Jul 2012 22:32:04 +0200 (CEST)
From: Andreas Schwab <schwab@linux-m68k.org>
To: Eric Blake <eblake-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
Subject: Re: ls files that were modified on a certain date
In-Reply-To: <5007182B.408@redhat.com> (Eric Blake's message of "Wed, 18 Jul
	2012 14:10:19 -0600")
References: <1342636319.54314.YahooMailNeo@web163106.mail.bf1.yahoo.com>
	<5007182B.408@redhat.com>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)
X-Yow: Impudent..  Yet possessing a certain ALUMINUM SILICATE
	overbite....Needs REDDY-WHIP!!
Date: Wed, 18 Jul 2012 22:32:04 +0200
Message-ID: <m2ipdkkdyz.fsf@igel.home>
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older,
	4)
X-Received-From: 212.18.0.9
Cc: Enda <enda_k2-/E1597aS9LQAvxtiuMwx3w@public.gmane.org>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 18 Jul 2012 20:32:07 -0000

Eric Blake <eblake-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> writes:

> find -mtime $(( ( $(date +%s) - $(date -d 'Jan 1') ) / 24 / 60 / 60 ))
                                        +%s

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."


From MAILER-DAEMON Wed Jul 18 18:16:38 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SrcXu-00027E-Tk
	for mharc-coreutils@gnu.org; Wed, 18 Jul 2012 18:16:38 -0400
Received: from eggs.gnu.org ([208.118.235.92]:50788)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SrcXs-00024F-2o
	for coreutils@gnu.org; Wed, 18 Jul 2012 18:16:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SrcXq-0001uM-Sj
	for coreutils@gnu.org; Wed, 18 Jul 2012 18:16:36 -0400
Received: from mx.meyering.net ([88.168.87.75]:48845)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SrcXq-0001uF-Lz
	for coreutils@gnu.org; Wed, 18 Jul 2012 18:16:34 -0400
Received: from rho.meyering.net (rho.meyering.net [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id CA66C600A5;
	Thu, 19 Jul 2012 00:16:32 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Enda <enda_k2@yahoo.com>
Subject: Re: ls files that were modified on a certain date
In-Reply-To: <1342636319.54314.YahooMailNeo@web163106.mail.bf1.yahoo.com>
	(Enda's message of "Wed, 18 Jul 2012 11:31:59 -0700 (PDT)")
References: <1342636319.54314.YahooMailNeo@web163106.mail.bf1.yahoo.com>
Date: Thu, 19 Jul 2012 00:16:32 +0200
Message-ID: <87y5mgbtq7.fsf@rho.meyering.net>
Lines: 8
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: 88.168.87.75
Cc: "coreutils@gnu.org" <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 18 Jul 2012 22:16:37 -0000

Enda wrote:
> How do I list files that were modified on (or since) a certain date?

One simple way is to create a time stamp file with the specified date,
and then to use find's "-newer FILE" predicate:

    touch -d '1999-01-01 12:00:01' stamp
    find dir ... -type f -newer stamp


From MAILER-DAEMON Thu Jul 19 15:09:20 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Srw6C-0000lu-Ey
	for mharc-coreutils@gnu.org; Thu, 19 Jul 2012 15:09:20 -0400
Received: from eggs.gnu.org ([208.118.235.92]:34484)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kerolasa@gmail.com>) id 1Srw69-0000kp-R4
	for coreutils@gnu.org; Thu, 19 Jul 2012 15:09:18 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <kerolasa@gmail.com>) id 1Srw68-0003xL-0x
	for coreutils@gnu.org; Thu, 19 Jul 2012 15:09:17 -0400
Received: from mail-wi0-f171.google.com ([209.85.212.171]:52176)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kerolasa@gmail.com>) id 1Srw67-0003wi-Ne
	for coreutils@gnu.org; Thu, 19 Jul 2012 15:09:15 -0400
Received: by wibhq4 with SMTP id hq4so4729795wib.12
	for <coreutils@gnu.org>; Thu, 19 Jul 2012 12:09:13 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:reply-to:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=J6BUcikpGPKamw8vbEDz2grC08Vtd05U+Yo4MWUkGvc=;
	b=vFrSM1eeZoEgrrCbNjlGa4jcKlFlcm/KGaNilRu4xsj3iIwjTgTGwMm47iJ66ex3dE
	fh9DtVdgx7nv3W0lgwTQCPLi7nzDJNKgaWcyUZkiLwzeQugGtcWx2CCdnTxTrVh4OobB
	9M+8W6z7NgGUVQ7xpB1zFeftt4mXn06czt36MDkFu3+YR2ETp1uM484IYvZiGse9V1ZP
	ogpDak2fHZO6bq+Awu9LPrvO6RUBHqDOuII0Kbp8vzlEAa/o6jqh8YLVc4gKT+soFuth
	7oWOQDn3IZKUQQ1sl0BXzOU3BNkAhHDchk6rX42IOUQ2Y8LlOZ9DBes41sELDXUDiDNt
	UDjA==
MIME-Version: 1.0
Received: by 10.216.232.32 with SMTP id m32mr1896892weq.186.1342724953242;
	Thu, 19 Jul 2012 12:09:13 -0700 (PDT)
Sender: kerolasa@gmail.com
Received: by 10.194.34.170 with HTTP; Thu, 19 Jul 2012 12:09:13 -0700 (PDT)
In-Reply-To: <87mx2ydudh.fsf@rho.meyering.net>
References: <CAG27Bk0dwWn9L8MJ8x5TBchNvZ5CY2y+ATeAmypDqZi1Y8esZw@mail.gmail.com>
	<871ulmc3bj.fsf@rho.meyering.net>
	<CAG27Bk0VuuGbe2nC9-gW+bEoGjA3v6Lw30V-enUSNAHT5cTbfw@mail.gmail.com>
	<87k3ze9xfd.fsf@rho.meyering.net>
	<CAG27Bk3B9qH8g5aaFv-b0ASATb7sFCMrOJ8gWkif278O1bD+ow@mail.gmail.com>
	<87r4sldpzk.fsf@rho.meyering.net>
	<CAG27Bk2x-G35Ln0Zpy7KO9Exi-HzTBDA+PAQ+kVswX-Ut1opFA@mail.gmail.com>
	<5005B584.7030304@unix-ag.uni-kl.de>
	<87mx2ydudh.fsf@rho.meyering.net>
Date: Thu, 19 Jul 2012 21:09:13 +0200
X-Google-Sender-Auth: RaIRs2YtKuSkHK2zNyeKTBe9HzE
Message-ID: <CAG27Bk0+_dV29Kgq3KwX3pNZ+_MAafi7x9N2gNQN8g1Z0X8kzw@mail.gmail.com>
Subject: Re: rename: move command from util-linux to coreutils
From: Sami Kerola <kerolasa@iki.fi>
To: Jim Meyering <jim@meyering.net>
Content-Type: text/plain; charset=ISO-8859-1
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.85.212.171
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: kerolasa@gmail.com
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 19 Jul 2012 19:09:18 -0000

On Tue, Jul 17, 2012 at 10:07 PM, Jim Meyering <jim@meyering.net> wrote:
> Erik Auerswald wrote:
>> On 07/17/2012 05:10 PM, Sami Kerola wrote:
>>> On Mon, Jul 9, 2012 at 3:27 PM, Jim Meyering<jim@meyering.net>  wrote:
>>> [...]
>>>> A few things should be changed regardless.
>>>> For consistency with other GNU tools:
>>>>
>>>>    s/--test/--dry-run/
>>>
>>> I changed the option to '-u, --dry-run' which is exact match with mktemp.
>>
>> I don't like the short option '-u'. On debian, the PERL rename
>> (/usr/bin/prename, see update-alternatives --list rename) uses the
>> short option '-n' for dry-run functionality. Not sure about other
>> rename programs.
>>
>> I'd prefer just the long option '--dry-run'.
>
> I agree.  Using no short option is probably best,
> especially when you realize that you can abbreviate
> it as "--d" (assuming there's no other --d... option).
>
> However, if you feel a short-named option is required,
> then "-n" is more standard.  For example, GNU make and numerous
> git commands provide -n as a synonym for --dry-run.

I removed the short option. As it has said many times in the list they
are easier to add than remove. If the short option is needed in future
it surely will be added.

-- 
   Sami Kerola
   http://www.iki.fi/kerolasa/


From MAILER-DAEMON Fri Jul 20 09:40:36 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SsDRc-0006ae-PC
	for mharc-coreutils@gnu.org; Fri, 20 Jul 2012 09:40:36 -0400
Received: from eggs.gnu.org ([208.118.235.92]:52401)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SsDRa-0006Yl-AJ
	for coreutils@gnu.org; Fri, 20 Jul 2012 09:40:35 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SsDRY-00087l-Jk
	for coreutils@gnu.org; Fri, 20 Jul 2012 09:40:34 -0400
Received: from mx.meyering.net ([88.168.87.75]:54871)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SsDRY-00085H-AL
	for coreutils@gnu.org; Fri, 20 Jul 2012 09:40:32 -0400
Received: from rho.meyering.net (rho.meyering.net [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 10836606A4
	for <coreutils@gnu.org>; Fri, 20 Jul 2012 15:40:31 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH 1/2] maint: rm: remove unused static-inlined functions
Date: Fri, 20 Jul 2012 15:40:31 +0200
Message-ID: <87vchia6uo.fsf@rho.meyering.net>
Lines: 100
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: 88.168.87.75
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 20 Jul 2012 13:40:35 -0000

FYI,

>From 05364ffe0d057ac0fbd1d3f2d556132e799ce4e0 Mon Sep 17 00:00:00 2001
From: Joachim Schmitz <jojo@schmitz-digital.de>
Date: Fri, 20 Jul 2012 14:32:53 +0200
Subject: [PATCH 1/2] maint: rm: remove unused static-inlined functions

* src/remove.c (cache_statted, is_dir_lstat): Remove unused
static-inlined functions.
* THANKS.in: Remove my name from this list, now that (with this
commit) it is included automatically.
Copyright-paperwork-exempt: Yes
---
 THANKS.in    |  1 -
 src/remove.c | 22 ----------------------
 2 files changed, 23 deletions(-)

diff --git a/THANKS.in b/THANKS.in
index 57639d9..dc0b9dd 100644
--- a/THANKS.in
+++ b/THANKS.in
@@ -289,7 +289,6 @@ Jesse Thilo                         jgt2@eecs.lehigh.edu
 Jie Xu                              xuj@iag.net
 Jim Blandy                          jimb@cyclic.com
 Jim Dennis                          jimd@starshine.org
-Joachim Schmitz                     jojo@schmitz-digital.de
 Joakim Rosqvist                     dvljrt@cs.umu.se
 Jochen Hein                         jochen@jochen.org
 Joe Orton                           joe@manyfish.co.uk
diff --git a/src/remove.c b/src/remove.c
index f44a982..42f2063 100644
--- a/src/remove.c
+++ b/src/remove.c
@@ -88,13 +88,6 @@ cache_stat_init (struct stat *st)
   return st;
 }

-/* Return true if *ST has been statted.  */
-static inline bool
-cache_statted (struct stat *st)
-{
-  return (st->st_size != -1);
-}
-
 /* Return true if *ST has been statted successfully.  */
 static inline bool
 cache_stat_ok (struct stat *st)
@@ -311,21 +304,6 @@ prompt (FTS const *fts, FTSENT const *ent, bool is_dir,
   return RM_OK;
 }

-/* Return true if FILENAME is a directory (and not a symlink to a directory).
-   Otherwise, including the case in which lstat fails, return false.
-   *ST is FILENAME's tstatus.
-   Do not modify errno.  */
-static inline bool
-is_dir_lstat (int fd_cwd, char const *filename, struct stat *st)
-{
-  int saved_errno = errno;
-  bool is_dir =
-    (cache_fstatat (fd_cwd, filename, st, AT_SYMLINK_NOFOLLOW) == 0
-     && S_ISDIR (st->st_mode));
-  errno = saved_errno;
-  return is_dir;
-}
-
 /* Return true if FILENAME is a non-directory.
    Otherwise, including the case in which lstat fails, return false.
    *ST is FILENAME's tstatus.
--
1.7.11.2.194.g7bdb748


>From f173180a96cf497682274436781febcf4c86f974 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Fri, 20 Jul 2012 15:10:12 +0200
Subject: [PATCH 2/2] maint: adjust exemption to track renamed test script

* cfg.mk (exclude_file_name_regexp--sc_file_system): Sync this
exemption regexp to match renamed tests/df/df-P.  This avoids
a "make syntax-check" failure.
---
 cfg.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cfg.mk b/cfg.mk
index 790238c..f780511 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -467,7 +467,7 @@ exclude_file_name_regexp--sc_prohibit_always-defined_macros = \
 exclude_file_name_regexp--sc_prohibit_empty_lines_at_EOF = ^tests/pr/
 exclude_file_name_regexp--sc_program_name = ^(gl/.*|lib/euidaccess-stat)\.c$$
 exclude_file_name_regexp--sc_file_system = \
-  NEWS|^(tests/init\.cfg|src/df\.c|tests/misc/df-P)$$
+  NEWS|^(tests/init\.cfg|src/df\.c|tests/df/df-P)$$
 exclude_file_name_regexp--sc_prohibit_always_true_header_tests = \
   ^m4/stat-prog\.m4$$
 exclude_file_name_regexp--sc_prohibit_fail_0 = \
--
1.7.11.2.194.g7bdb748


From MAILER-DAEMON Fri Jul 20 14:11:51 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SsHg7-00077x-TQ
	for mharc-coreutils@gnu.org; Fri, 20 Jul 2012 14:11:51 -0400
Received: from eggs.gnu.org ([208.118.235.92]:60183)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SsHdL-0006fm-7W
	for coreutils@gnu.org; Fri, 20 Jul 2012 14:11:50 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SsHaX-0001MI-NZ
	for coreutils@gnu.org; Fri, 20 Jul 2012 14:08:59 -0400
Received: from mx.meyering.net ([88.168.87.75]:55670)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SsHaX-0001M7-G8
	for coreutils@gnu.org; Fri, 20 Jul 2012 14:06:05 -0400
Received: from rho.meyering.net (rho.meyering.net [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 549C360091;
	Fri, 20 Jul 2012 20:06:04 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: ohav chochmah <philomath868@gmail.com>
Subject: Re: removing coreutils' final strncpy uses
In-Reply-To: <87394qohyo.fsf@rho.meyering.net> (Jim Meyering's message of
	"Tue, 17 Jul 2012 11:27:43 +0200")
References: <CABOpGfuXR4k8_uN4wcn=GPHnW8kMWJj-Xdf8Bt0NvQs77W8opw@mail.gmail.com>
	<87394qohyo.fsf@rho.meyering.net>
Date: Fri, 20 Jul 2012 20:06:04 +0200
Message-ID: <87k3xy8fzn.fsf@rho.meyering.net>
Lines: 62
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: 88.168.87.75
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 20 Jul 2012 18:11:50 -0000

Jim Meyering wrote:
> ohav chochmah wrote:
>> Why not reuse memccpy (in glibc)? as in 'memccpy(to, from, '\0', size)'.
>> Not only for sake of reusing, but memccpy is highly optimized for
>> ia64, and may be optimized for other arches in the future.
>
> Thanks for the suggestion, but that returns NULL
> when it finds no NUL byte in the first SIZE bytes of FROM.
> I could implement stzncpy in terms of that function instead
> of open-coding the loop:
>
> diff --git a/src/system.h b/src/system.h
> index 6907603..10b04b2 100644
> --- a/src/system.h
> +++ b/src/system.h
> @@ -633,11 +633,13 @@ The following directory is part of the cycle:\n  %s\n"), \
>  static inline char *
>  stzncpy (char *dest, char const *src, size_t len)
>  {
> -  char const *src_end = src + len;
> -  while (src < src_end && *src)
> -    *dest++ = *src++;
> -  *dest = 0;
> -  return dest;
> +  char *p = memccpy (dest, src, 0, len);
> +  if (p == NULL)
> +    {
> +      p = dest + len;
> +      *p = 0;
> +    }
> +  return p;
>  }
>
>  #ifndef ARRAY_CARDINALITY
>
> but (for portability) that would require a gnulib module for memccpy.
> Such a module would be welcome regardless, but here it seems like
> it's not worth the complication, since the few uses of stzncpy are not
> performance sensitive.

For the record, the above alternate patch is wrong,
since when memccpy returns non-NULL, that return
value points at the byte just after the NUL it copied
into DEST.

This is better:
(note I've added the "restrict" attributes, too,
which I'll do in system.h as well)

    static inline char *
    stzncpy (char *restrict dest, char const *restrict src, size_t len)
    {
      char *p = memccpy (dest, src, 0, len);
      if (p)
        --p;
      else
        {
          p = dest + len;
          *p = 0;
        }
      return p;
    }


From MAILER-DAEMON Fri Jul 20 17:46:13 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SsL1Z-0003vN-HG
	for mharc-coreutils@gnu.org; Fri, 20 Jul 2012 17:46:13 -0400
Received: from eggs.gnu.org ([208.118.235.92]:37038)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bob@proulx.com>) id 1SsL1W-0003uz-W9
	for coreutils@gnu.org; Fri, 20 Jul 2012 17:46:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bob@proulx.com>) id 1SsL1V-0004VG-UD
	for coreutils@gnu.org; Fri, 20 Jul 2012 17:46:10 -0400
Received: from joseki.proulx.com ([216.17.153.58]:43604)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bob@proulx.com>) id 1SsL1V-0004V8-MX
	for coreutils@gnu.org; Fri, 20 Jul 2012 17:46:09 -0400
Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119])
	by joseki.proulx.com (Postfix) with ESMTP id EEEB32122E;
	Fri, 20 Jul 2012 15:46:07 -0600 (MDT)
Received: by hysteria.proulx.com (Postfix, from userid 1000)
	id D02462DC62; Fri, 20 Jul 2012 15:46:07 -0600 (MDT)
Date: Fri, 20 Jul 2012 15:46:07 -0600
From: Bob Proulx <bob@proulx.com>
To: Quinton Dunning <quinton.dunning@gmail.com>
Subject: Re: Split command wait - Request
Message-ID: <20120720214607.GA8010@hysteria.proulx.com>
Mail-Followup-To: Quinton Dunning <quinton.dunning@gmail.com>,
	coreutils@gnu.org
References: <4F989945.7080007@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <4F989945.7080007@gmail.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 216.17.153.58
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 20 Jul 2012 21:46:12 -0000

Quinton Dunning wrote:
> Sometimes when I execute the split command I want to use removable
> media and take a file part over to another machine. To do this, the
> split command would have to have a switch that would pause and wait
> for a keystroke before writing the next file.

I remember having needed to do this type of thing in the past and when
I have needed this I have done it this way:

  dst=/dev/fd0
  for f in x*; do
    mv "$f" "$dst" 2>/dev/null || { rm -f "$dst/$f" ; break ;}
  done

It simply moves files until there is an error moving them.  Then it
stops.  Then media can be changed.  Then the command repeated.
Walking through media until all of the files have been moved.  That
works without too much fuss.

However it is a little inconvenient that 'mv' doesn't behave as nicely
as I think it should.  Without doing the above handling it keeps
going.  Lots of noise.  Lots of cruft left behind.  For example:

  mv x* $dst/
  mv: writing `/mnt/tmp/xaf': No space left on device
  mv: failed to extend `/mnt/tmp/xaf': No space left on device
  mv: writing `/mnt/tmp/xag': No space left on device
  mv: failed to extend `/mnt/tmp/xag': No space left on device
  mv: writing `/mnt/tmp/xah': No space left on device
  ...

And it leaves cruft behind that it created.

  -rw-rw-r-- 1 512000 Jul 20 15:25 xaa
  -rw-rw-r-- 1 512000 Jul 20 15:25 xab
  -rw-rw-r-- 1 512000 Jul 20 15:25 xac
  -rw-rw-r-- 1 512000 Jul 20 15:25 xad
  -rw-rw-r-- 1 512000 Jul 20 15:25 xae
  -rw------- 1 204800 Jul 20 15:25 xaf
  -rw------- 1      0 Jul 20 15:25 xag
  -rw------- 1      0 Jul 20 15:25 xah
  -rw------- 1      0 Jul 20 15:25 xai
  -rw------- 1      0 Jul 20 15:25 xaj
  -rw------- 1      0 Jul 20 15:25 xak
  -rw------- 1      0 Jul 20 15:25 xal
  -rw------- 1      0 Jul 20 15:25 xam
  ...

I think it would be a nice enhancement that if mv created a file and
couldn't write to it that it didn't leave that file behind.

Of course the traditional mv keeps going so not sure there is any way
to improve upon that behavior now.

I was able to manually create a test harness for this by creating a
minimum size lvm partition and then using it as the destination.

  # lvcreate -L4M -nsmall v1
  # mkfs -t ext2 /dev/v1/small
  # mount /dev/v1/small /mnt
  # mkdir /mnt/tmp
  # chmod a+rwxt /mnt/tmp

Then test it like this:

  $ mkdir /tmp/testinput
  $ cd /tmp/testinput
  $ dd if=/dev/zero of=testfile bs=1M count=10
  $ split --bytes=500K testfile

  $ for f in x*;do mv $f /mnt/tmp/ 2>/dev/null || { rm -f /mnt/tmp/$f; break;} done

Bob


From MAILER-DAEMON Mon Jul 23 12:58:08 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1StLxQ-00008t-9O
	for mharc-coreutils@gnu.org; Mon, 23 Jul 2012 12:58:08 -0400
Received: from eggs.gnu.org ([208.118.235.92]:58171)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <enda_k2@yahoo.com>) id 1StL2j-0006dG-1c
	for coreutils@gnu.org; Mon, 23 Jul 2012 11:59:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <enda_k2@yahoo.com>) id 1StL2b-0000v8-LH
	for coreutils@gnu.org; Mon, 23 Jul 2012 11:59:32 -0400
Received: from nm1.bullet.mail.bf1.yahoo.com ([98.139.212.160]:45878)
	by eggs.gnu.org with smtp (Exim 4.71)
	(envelope-from <enda_k2@yahoo.com>) id 1StL2b-0000us-Gw
	for coreutils@gnu.org; Mon, 23 Jul 2012 11:59:25 -0400
Received: from [98.139.212.144] by nm1.bullet.mail.bf1.yahoo.com with NNFMP;
	23 Jul 2012 15:59:24 -0000
Received: from [98.139.212.193] by tm1.bullet.mail.bf1.yahoo.com with NNFMP;
	23 Jul 2012 15:59:24 -0000
Received: from [127.0.0.1] by omp1002.mail.bf1.yahoo.com with NNFMP;
	23 Jul 2012 15:59:24 -0000
X-Yahoo-Newman-Property: ymail-3
X-Yahoo-Newman-Id: 247388.76896.bm@omp1002.mail.bf1.yahoo.com
Received: (qmail 84685 invoked by uid 60001); 23 Jul 2012 15:59:24 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024;
	t=1343059164; bh=wy8RKfSq1hKF5DJf/cnXBxgeMGfTLaLjbZYWqG7Ru8I=;
	h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding;
	b=FTsNIrEN5WnWdKomYrvMMsoobUEzEuVrqP/N82wkQ+O838LydQIXwca9+CMF90iPpX+Q3CTYGiL/jtcGSXf55vfbHaRQDfDu4w6aXtBGZBCJL0MlzMiIpqu3DrhdXiJ0t3z9GdCY8STAWrNBA5ms8vYlcMYwRbzZmlUWpilet0g=
DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com;
	h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding;
	b=R+JCUdQ+xk4gtIN0oXhPaLCYr9FT4smfGSUZPqwwTgriVtJveFFFWlMdNdAoLjkt8+4gVvt7DmAJhPZPXSG1jnh5ZNLhQTSPRxfW2ckRQMGrfwNpJmiuhgAfd4EANx/ndd5dBjqbm68w9GMKSZvwrVPQkbwJCoPhpBoOI/0G5mo=;
X-YMail-OSG: xyoD61EVM1maWVHKR_w6XoyMEO6ExRZzm98qrwlbhVy3e6J
	uHOI1wxDvRpBwju_.d8erdBTXveaXJ9p6Gg6Yxg_HcGmzqPQ08rAhIWxW48d
	Ig..ELFsp7joIpyFAQ9I3TaMvxSY4oLKI5M8U7ByyZ65cK_DbRutcfmgX1vp
	6wlhfqYj70edK96RojQMwglYvK3H3Jql_fzz45a4mFcXO7Lo17YxbglZZlYV
	RwLNKkIr6MfehQmHq4fZjIlajXMKvKmrqAeRbA2X86SXLHMh1Z7EfXx0Bbt1
	zM8ZibTJQpPG0ir1FDHpUC71Do7b7SuL7Whb0ov2DnUrjj1rYCxQo6Hk3hQn
	YZNz71NfvYsRXJpC1hI4OFlgzPBuiYj7RSXvmlPiUD65ipSvIQ4REIhYzsIJ
	uAwmCDqBGDaqccVQ3u1A-
Received: from [143.239.7.7] by web163104.mail.bf1.yahoo.com via HTTP;
	Mon, 23 Jul 2012 08:59:23 PDT
X-Mailer: YahooMailWebService/0.8.120.356233
Message-ID: <1343059163.83869.YahooMailNeo@web163104.mail.bf1.yahoo.com>
Date: Mon, 23 Jul 2012 08:59:23 -0700 (PDT)
From: Enda <enda_k2@yahoo.com>
Subject: find ls sort
To: "coreutils@gnu.org" <coreutils@gnu.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 98.139.212.160
X-Mailman-Approved-At: Mon, 23 Jul 2012 12:58:06 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
Reply-To: Enda <enda_k2@yahoo.com>
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 23 Jul 2012 15:59:36 -0000

Thanks P=E1draig, Eric, Andreas and Jim,=0A=0A=0AThis almost gives the outp=
ut that I want:=0A=0Afind * -mtime 0 -exec=A0ls=A0-rt {} +=0A=0AIs there a =
way to list files not on a separate line, but one after the=0Aother with a =
space in between them (and a newline at the end)?, like=0A'-m' except witho=
ut the commas and the newline being only at end.=0A=0A- Enda=0A=0A=0AP.S.=
=0A=0AThis gives the kind of output that I want except in the wrong order:=
=0A=0Afind -mtime 0 -printf "%f\n"


From MAILER-DAEMON Mon Jul 23 13:04:20 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1StM3Q-0003Am-0X
	for mharc-coreutils@gnu.org; Mon, 23 Jul 2012 13:04:20 -0400
Received: from eggs.gnu.org ([208.118.235.92]:37750)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1StM3F-00038m-VV
	for coreutils@gnu.org; Mon, 23 Jul 2012 13:04:19 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1StM3B-00066F-LI
	for coreutils@gnu.org; Mon, 23 Jul 2012 13:04:09 -0400
Received: from mx1.redhat.com ([209.132.183.28]:31713)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1StM3B-000661-Cz
	for coreutils@gnu.org; Mon, 23 Jul 2012 13:04:05 -0400
Received: from int-mx11.intmail.prod.int.phx2.redhat.com
	(int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6NH44QC017047
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 23 Jul 2012 13:04:04 -0400
Received: from [10.3.113.94] (ovpn-113-94.phx2.redhat.com [10.3.113.94])
	by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q6NH42tu008014; Mon, 23 Jul 2012 13:04:04 -0400
Message-ID: <500D8401.8020807@redhat.com>
Date: Mon, 23 Jul 2012 11:04:01 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:14.0) Gecko/20120717 Thunderbird/14.0
MIME-Version: 1.0
To: Enda <enda_k2@yahoo.com>
Subject: Re: find ls sort
References: <1343059163.83869.YahooMailNeo@web163104.mail.bf1.yahoo.com>
In-Reply-To: <1343059163.83869.YahooMailNeo@web163104.mail.bf1.yahoo.com>
X-Enigmail-Version: 1.4.3
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="------------enig59DA616D7EEECC721910BCBA"
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: "coreutils@gnu.org" <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 23 Jul 2012 17:04:19 -0000

This is an OpenPGP/MIME signed message (RFC 2440 and 3156)
--------------enig59DA616D7EEECC721910BCBA
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

On 07/23/2012 09:59 AM, Enda wrote:
> Thanks P=E1draig, Eric, Andreas and Jim,
>=20
>=20
> This almost gives the output that I want:
>=20
> find * -mtime 0 -exec ls -rt {} +
>=20
> Is there a way to list files not on a separate line, but one after the
> other with a space in between them (and a newline at the end)?, like
> '-m' except without the commas and the newline being only at end.

Sure, except that then you are giving yourself a security hole the
moment you find a file with a space in the name.

find * -mtime 0 -exec ls -rt {} + | tr '\n' ' '

> This gives the kind of output that I want except in the wrong order:
>=20
> find -mtime 0 -printf "%f\n"

Which has the same security hole.  Basically, any time the separator
between file names can also occur in a file name, you are setting
yourself up for failure, so you are better off thinking about the
problem up front and reconsidering whether a space-separated list of
file names is what you really want.

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


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

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJQDYQCAAoJEKeha0olJ0Nq4BkH/3whKuKnbvPEPazs2dE4I4I3
IQqcgAn/EsUOyJFMjZsRBF2ibYdaM2DEwnA8bM+h0PTxKcOMa7xms69hle8zrbAE
u9Xd756YiBX1Ie0Xk6XgEQrxMv2b6rC8rdVCgdESNrFb3cl2GApEa0rK9ZsLsJtw
TTFoAaCtH3l65NfY4I/VVv71Bs8DlsFpAh+W7DNIpodvJBjVgjGsPMuWfFqt9Esu
1fitZcqAe0D486O/9A9zvNcAqjM/fvmfRJMz/JRFmR/JvLvD0Hc5tJhhwtiB9YMv
StmFnb/QKvf6bOLQgfqUrWW0IIfdShTUyCIJrUzz2qHkh6UE/JHzXKeqpQwDoyM=
=DcRD
-----END PGP SIGNATURE-----

--------------enig59DA616D7EEECC721910BCBA--


From MAILER-DAEMON Mon Jul 23 13:31:53 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1StMU5-0006sW-04
	for mharc-coreutils@gnu.org; Mon, 23 Jul 2012 13:31:53 -0400
Received: from eggs.gnu.org ([208.118.235.92]:60248)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1StMTy-0006sE-Sp
	for coreutils@gnu.org; Mon, 23 Jul 2012 13:31:52 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1StMTu-0007XW-KS
	for coreutils@gnu.org; Mon, 23 Jul 2012 13:31:46 -0400
Received: from mx1.redhat.com ([209.132.183.28]:23165)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1StMTu-0007Wd-CO
	for coreutils@gnu.org; Mon, 23 Jul 2012 13:31:42 -0400
Received: from int-mx01.intmail.prod.int.phx2.redhat.com
	(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6NHVeTg022597
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 23 Jul 2012 13:31:40 -0400
Received: from [10.36.116.75] (ovpn-116-75.ams2.redhat.com [10.36.116.75])
	by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id q6NHVbMg020435
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Mon, 23 Jul 2012 13:31:39 -0400
Message-ID: <500D8A79.4060309@draigBrady.com>
Date: Mon, 23 Jul 2012 18:31:37 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Eric Blake <eblake@redhat.com>
Subject: Re: find ls sort
References: <1343059163.83869.YahooMailNeo@web163104.mail.bf1.yahoo.com>
	<500D8401.8020807@redhat.com>
In-Reply-To: <500D8401.8020807@redhat.com>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=ISO-8859-1
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id
	q6NHVeTg022597
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: Enda <enda_k2@yahoo.com>, "coreutils@gnu.org" <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 23 Jul 2012 17:31:52 -0000

On 07/23/2012 06:04 PM, Eric Blake wrote:
> On 07/23/2012 09:59 AM, Enda wrote:
>> Thanks P=E1draig, Eric, Andreas and Jim,
>>
>>
>> This almost gives the output that I want:
>>
>> find * -mtime 0 -exec ls -rt {} +
>>
>> Is there a way to list files not on a separate line, but one after the
>> other with a space in between them (and a newline at the end)?, like
>> '-m' except without the commas and the newline being only at end.
>=20
> Sure, except that then you are giving yourself a security hole the
> moment you find a file with a space in the name.
>=20
> find * -mtime 0 -exec ls -rt {} + | tr '\n' ' '
>=20
>> This gives the kind of output that I want except in the wrong order:
>>
>> find -mtime 0 -printf "%f\n"
>=20
> Which has the same security hole.  Basically, any time the separator
> between file names can also occur in a file name, you are setting
> yourself up for failure, so you are better off thinking about the
> problem up front and reconsidering whether a space-separated list of
> file names is what you really want.

Right.

Also with any sorting operation, you need to deal with all the input at o=
nce.
The above `-exec ls...` could happen multiple time if you have enough fil=
es.
Therefore to be scalable you need to use something of the form: find | so=
rt
For example see: http://www.pixelbeat.org/scripts/newest

cheers,
P=E1draig.


From MAILER-DAEMON Tue Jul 24 09:12:04 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SteuC-0008U2-5j
	for mharc-coreutils@gnu.org; Tue, 24 Jul 2012 09:12:04 -0400
Received: from eggs.gnu.org ([208.118.235.92]:45814)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ooprala@redhat.com>) id 1Std84-000480-8l
	for coreutils@gnu.org; Tue, 24 Jul 2012 07:18:21 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <ooprala@redhat.com>) id 1Std80-0000lB-98
	for coreutils@gnu.org; Tue, 24 Jul 2012 07:18:16 -0400
Received: from mx4-phx2.redhat.com ([209.132.183.25]:51185)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ooprala@redhat.com>) id 1Std80-0000ky-1P
	for coreutils@gnu.org; Tue, 24 Jul 2012 07:18:12 -0400
Received: from zmail19.collab.prod.int.phx2.redhat.com
	(zmail19.collab.prod.int.phx2.redhat.com [10.5.83.22])
	by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q6OBIBtG019764
	for <coreutils@gnu.org>; Tue, 24 Jul 2012 07:18:11 -0400
Date: Tue, 24 Jul 2012 07:18:11 -0400 (EDT)
From: Ondrej Oprala <ooprala@redhat.com>
To: coreutils@gnu.org
Message-ID: <780475846.306498.1343128691030.JavaMail.root@redhat.com>
In-Reply-To: <712620714.305811.1343128199150.JavaMail.root@redhat.com>
Subject: RFE: hash-type in sum utils
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Originating-IP: [10.34.4.237]
X-Mailer: Zimbra 7.2.0_GA_2669 (ZimbraWebClient - FF3.0 (Linux)/7.2.0_GA_2669)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 209.132.183.25
X-Mailman-Approved-At: Tue, 24 Jul 2012 09:12:03 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 24 Jul 2012 11:18:22 -0000

Hello,
  I'd like to consult this RFE http://lists.gnu.org/archive/html/bug-coreutils/2009-11/msg00341.html and
  find out if my proposed solutions would be satisfactory. There shouldn't be a problem with printing the
  hash-type prefix before printing the generated hash. My concerns are more with the hash utils' logic
  during hash check. Should the utils recognize the prefix/prefixless version of the input on their own
  or should they require the proposed '-l' switch during the checking as well? Personally, I'd lean more
  towards the idea of automatic prefix recognition, which shouldn't be too hard to implement and would probably
  feel more natural to everyone.
  Cheers,
   Ondrej Oprala


From MAILER-DAEMON Tue Jul 24 09:44:59 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1StfQ2-0001hp-Vw
	for mharc-coreutils@gnu.org; Tue, 24 Jul 2012 09:44:58 -0400
Received: from eggs.gnu.org ([208.118.235.92]:55019)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1StfPz-0001gZ-6R
	for coreutils@gnu.org; Tue, 24 Jul 2012 09:44:57 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1StfPn-0004CL-Hv
	for coreutils@gnu.org; Tue, 24 Jul 2012 09:44:55 -0400
Received: from mx1.redhat.com ([209.132.183.28]:2359)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1StfPn-0004C0-A0
	for coreutils@gnu.org; Tue, 24 Jul 2012 09:44:43 -0400
Received: from int-mx10.intmail.prod.int.phx2.redhat.com
	(int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6ODifQE022430
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <coreutils@gnu.org>; Tue, 24 Jul 2012 09:44:41 -0400
Received: from [10.36.116.52] (ovpn-116-52.ams2.redhat.com [10.36.116.52])
	by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q6ODid3c031911
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Tue, 24 Jul 2012 09:44:40 -0400
Message-ID: <500EA6C6.5060009@draigBrady.com>
Date: Tue, 24 Jul 2012 14:44:38 +0100
From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Ondrej Oprala <ooprala@redhat.com>
Subject: Re: RFE: hash-type in sum utils
References: <780475846.306498.1343128691030.JavaMail.root@redhat.com>
In-Reply-To: <780475846.306498.1343128691030.JavaMail.root@redhat.com>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=UTF-8
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id
	q6ODifQE022430
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 24 Jul 2012 13:44:57 -0000

On 07/24/2012 12:18 PM, Ondrej Oprala wrote:
> Hello,
>   I'd like to consult this RFE http://lists.gnu.org/archive/html/bug-co=
reutils/2009-11/msg00341.html and
>   find out if my proposed solutions would be satisfactory. There should=
n't be a problem with printing the
>   hash-type prefix before printing the generated hash. My concerns are =
more with the hash utils' logic
>   during hash check. Should the utils recognize the prefix/prefixless v=
ersion of the input on their own
>   or should they require the proposed '-l' switch during the checking a=
s well? Personally, I'd lean more
>   towards the idea of automatic prefix recognition, which shouldn't be =
too hard to implement and would probably
>   feel more natural to everyone.
>   Cheers,
>    Ondrej Oprala

A fairly sensible idea.

Generating the tags would need to be optional of course.
I vote for --tag.

Consuming the tags with --check should be automatic.

Tags could be useful too if we ever decided to consolidate
to a single checksum util.

cheers,
P=C3=A1draig.


From MAILER-DAEMON Tue Jul 24 19:11:08 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1StoFw-0005Dz-9d
	for mharc-coreutils@gnu.org; Tue, 24 Jul 2012 19:11:08 -0400
Received: from eggs.gnu.org ([208.118.235.92]:55000)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1StoFt-0005Bs-AX
	for coreutils@gnu.org; Tue, 24 Jul 2012 19:11:06 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1StoFr-0004kw-RF
	for coreutils@gnu.org; Tue, 24 Jul 2012 19:11:05 -0400
Received: from mx1.redhat.com ([209.132.183.28]:41052)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1StoFr-0004kG-Jl
	for coreutils@gnu.org; Tue, 24 Jul 2012 19:11:03 -0400
Received: from int-mx12.intmail.prod.int.phx2.redhat.com
	(int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6ONAwCO006007
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 24 Jul 2012 19:11:00 -0400
Received: from [10.36.116.21] (ovpn-116-21.ams2.redhat.com [10.36.116.21])
	by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q6ONAsAH009276
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Tue, 24 Jul 2012 19:10:56 -0400
Message-ID: <500F2B7E.6050806@draigBrady.com>
Date: Wed, 25 Jul 2012 00:10:54 +0100
From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Ondrej Oprala <ooprala@redhat.com>
Subject: Re: RFE: hash-type in sum utils
References: <780475846.306498.1343128691030.JavaMail.root@redhat.com>
	<500EA6C6.5060009@draigBrady.com>
In-Reply-To: <500EA6C6.5060009@draigBrady.com>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=UTF-8
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.25
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id
	q6ONAwCO006007
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: D.Yu.Bolkhovityanov@inp.nsk.su, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 24 Jul 2012 23:11:07 -0000

On 07/24/2012 02:44 PM, P=C3=A1draig Brady wrote:
> On 07/24/2012 12:18 PM, Ondrej Oprala wrote:
>> Hello,
>>   I'd like to consult this RFE http://lists.gnu.org/archive/html/bug-c=
oreutils/2009-11/msg00341.html and
>>   find out if my proposed solutions would be satisfactory. There shoul=
dn't be a problem with printing the
>>   hash-type prefix before printing the generated hash. My concerns are=
 more with the hash utils' logic
>>   during hash check. Should the utils recognize the prefix/prefixless =
version of the input on their own
>>   or should they require the proposed '-l' switch during the checking =
as well? Personally, I'd lean more
>>   towards the idea of automatic prefix recognition, which shouldn't be=
 too hard to implement and would probably
>>   feel more natural to everyone.
>>   Cheers,
>>    Ondrej Oprala
>=20
> A fairly sensible idea.
>=20
> Generating the tags would need to be optional of course.
> I vote for --tag.

Hmm, we already support a tagged format.
The BSD default format from the md5, sha1, sha256 utils is of the form:

MD5 (filename) =3D ....................

No point in coming up with another format.

> Consuming the tags with --check should be automatic.
>=20
> Tags could be useful too if we ever decided to consolidate
> to a single checksum util.

I notice that openbsd applies that technique to its cksum util,
and it outputs in the BSD format above:

http://www.openbsd.org/cgi-bin/man.cgi?query=3Dcksum
http://www.openbsd.org/cgi-bin/cvsweb/src/bin/md5/md5.c?rev=3DHEAD;conten=
t-type=3Dtext%2Fplain

cheers,
P=C3=A1draig.


From MAILER-DAEMON Wed Jul 25 09:24:01 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Su1ZJ-0006V2-Av
	for mharc-coreutils@gnu.org; Wed, 25 Jul 2012 09:24:01 -0400
Received: from eggs.gnu.org ([208.118.235.92]:40607)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ooprala@redhat.com>) id 1Su1ZB-0006Se-Bi
	for coreutils@gnu.org; Wed, 25 Jul 2012 09:23:59 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <ooprala@redhat.com>) id 1Su1Z1-0000lX-HC
	for coreutils@gnu.org; Wed, 25 Jul 2012 09:23:53 -0400
Received: from mx3-phx2.redhat.com ([209.132.183.24]:55877)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ooprala@redhat.com>) id 1Su1Z1-0000lI-9M
	for coreutils@gnu.org; Wed, 25 Jul 2012 09:23:43 -0400
Received: from zmail19.collab.prod.int.phx2.redhat.com
	(zmail19.collab.prod.int.phx2.redhat.com [10.5.83.22])
	by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q6PDNcKf009375;
	Wed, 25 Jul 2012 09:23:38 -0400
Date: Wed, 25 Jul 2012 09:23:38 -0400 (EDT)
From: Ondrej Oprala <ooprala@redhat.com>
To: P@draigBrady.com
Message-ID: <218975036.521592.1343222618905.JavaMail.root@redhat.com>
In-Reply-To: <1454344768.521213.1343222529956.JavaMail.root@redhat.com>
Subject: Fwd: RFE: hash-type in sum utils
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Originating-IP: [10.34.4.237]
X-Mailer: Zimbra 7.2.0_GA_2669 (ZimbraWebClient - FF3.0 (Linux)/7.2.0_GA_2669)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 209.132.183.24
Cc: D.Yu.Bolkhovityanov@inp.nsk.su, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 25 Jul 2012 13:23:59 -0000

How should the '--tag' switch treat binary files? Should it create somethin=
g like this:
MD5 (*filename) =3D ........   ?
Cheers,
Ondrej

----- Original Message -----
From: "P=C3=A1draig Brady" <P@draigBrady.com>
To: "Ondrej Oprala" <ooprala@redhat.com>
Cc: coreutils@gnu.org, "D Yu Bolkhovityanov" <D.Yu.Bolkhovityanov@inp.nsk.s=
u>
Sent: Wednesday, July 25, 2012 1:10:54 AM
Subject: Re: RFE: hash-type in sum utils

On 07/24/2012 02:44 PM, P=C3=A1draig Brady wrote:
> On 07/24/2012 12:18 PM, Ondrej Oprala wrote:
>> Hello,
>>   I'd like to consult this RFE http://lists.gnu.org/archive/html/bug-cor=
eutils/2009-11/msg00341.html and
>>   find out if my proposed solutions would be satisfactory. There shouldn=
't be a problem with printing the
>>   hash-type prefix before printing the generated hash. My concerns are m=
ore with the hash utils' logic
>>   during hash check. Should the utils recognize the prefix/prefixless ve=
rsion of the input on their own
>>   or should they require the proposed '-l' switch during the checking as=
 well? Personally, I'd lean more
>>   towards the idea of automatic prefix recognition, which shouldn't be t=
oo hard to implement and would probably
>>   feel more natural to everyone.
>>   Cheers,
>>    Ondrej Oprala
>=20
> A fairly sensible idea.
>=20
> Generating the tags would need to be optional of course.
> I vote for --tag.

Hmm, we already support a tagged format.
The BSD default format from the md5, sha1, sha256 utils is of the form:

MD5 (filename) =3D ....................

No point in coming up with another format.

> Consuming the tags with --check should be automatic.
>=20
> Tags could be useful too if we ever decided to consolidate
> to a single checksum util.

I notice that openbsd applies that technique to its cksum util,
and it outputs in the BSD format above:

http://www.openbsd.org/cgi-bin/man.cgi?query=3Dcksum
http://www.openbsd.org/cgi-bin/cvsweb/src/bin/md5/md5.c?rev=3DHEAD;content-=
type=3Dtext%2Fplain

cheers,
P=C3=A1draig.


From MAILER-DAEMON Wed Jul 25 12:07:47 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Su47n-0005ac-TZ
	for mharc-coreutils@gnu.org; Wed, 25 Jul 2012 12:07:47 -0400
Received: from eggs.gnu.org ([208.118.235.92]:50453)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <allen@huarp.harvard.edu>) id 1Su3xG-0007FI-1K
	for coreutils@gnu.org; Wed, 25 Jul 2012 11:56:54 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <allen@huarp.harvard.edu>) id 1Su3x9-0000Cr-LT
	for coreutils@gnu.org; Wed, 25 Jul 2012 11:56:53 -0400
Received: from endymion.arp.harvard.edu ([140.247.179.94]:57057)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <allen@huarp.harvard.edu>) id 1Su3x9-0000CS-HE
	for coreutils@gnu.org; Wed, 25 Jul 2012 11:56:47 -0400
Received: from [10.245.83.14] (unknown [10.245.83.14])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by endymion.arp.harvard.edu (Postfix) with ESMTP id A6B0E1D90082
	for <coreutils@gnu.org>; Wed, 25 Jul 2012 11:56:46 -0400 (EDT)
Message-ID: <5010175B.30808@huarp.harvard.edu>
Date: Wed, 25 Jul 2012 11:57:15 -0400
From: Norton Allen <allen@huarp.harvard.edu>
User-Agent: Mozilla/5.0 (Windows NT 5.1;
	rv:14.0) Gecko/20120713 Thunderbird/14.0
MIME-Version: 1.0
To: coreutils@gnu.org
Subject: su does not always propagate process exit status
X-Enigmail-Version: 1.4.3
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 140.247.179.94
X-Mailman-Approved-At: Wed, 25 Jul 2012 12:07:46 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 25 Jul 2012 15:56:54 -0000

This *seems* like a bug, but without some confirmation, I can't really
be sure.

su --version
su (GNU coreutils) 8.4

RHEL6

I run sudo -s to get root access, then:

  # su - nallen -c /bin/false && echo ERROR: false is true
  # su - root -c /bin/false && echo ERROR: false is true
  # su - mysql -c /bin/false && echo ERROR: false is true
  # su - splunk -c /bin/false && echo ERROR: false is true
  ERROR: false is true
  # su - postgres -c /bin/false && echo ERROR: false is true
  ERROR: false is true

I do not have a root login, so I cannot test whether this is related to
sudo or not.

I have looked and changed home directory permissions, checked shells,
eliminated .bash_profile and have not yet been able to come up with
anything that distinguishes the splunk and postgres accounts from the
others.

Can anyone else confirm or deny this behavior on a similar system?

Does anyone have suggestions as to what I should investigate?



From MAILER-DAEMON Wed Jul 25 17:25:09 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Su94v-0005rD-2H
	for mharc-coreutils@gnu.org; Wed, 25 Jul 2012 17:25:09 -0400
Received: from eggs.gnu.org ([208.118.235.92]:53324)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1Su94s-0005ng-DB
	for coreutils@gnu.org; Wed, 25 Jul 2012 17:25:07 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1Su94r-0005eF-EU
	for coreutils@gnu.org; Wed, 25 Jul 2012 17:25:06 -0400
Received: from mx1.redhat.com ([209.132.183.28]:57523)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1Su94r-0005cG-6b
	for coreutils@gnu.org; Wed, 25 Jul 2012 17:25:05 -0400
Received: from int-mx10.intmail.prod.int.phx2.redhat.com
	(int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6PLP3lB021804
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 25 Jul 2012 17:25:04 -0400
Received: from [10.36.116.31] (ovpn-116-31.ams2.redhat.com [10.36.116.31])
	by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q6PLP0OC004911
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Wed, 25 Jul 2012 17:25:01 -0400
Message-ID: <5010642B.4050007@draigBrady.com>
Date: Wed, 25 Jul 2012 22:24:59 +0100
From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Ondrej Oprala <ooprala@redhat.com>
Subject: Re: RFE: hash-type in sum utils
References: <218975036.521592.1343222618905.JavaMail.root@redhat.com>
In-Reply-To: <218975036.521592.1343222618905.JavaMail.root@redhat.com>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=UTF-8
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id
	q6PLP3lB021804
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: D.Yu.Bolkhovityanov@inp.nsk.su, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Wed, 25 Jul 2012 21:25:07 -0000

On 07/25/2012 02:23 PM, Ondrej Oprala wrote:
> How should the '--tag' switch treat binary files? Should it create some=
thing like this:
> MD5 (*filename) =3D ........   ?

Good question.
I wouldn't tag the filenamem because to be unambiguous you'd
have to have a space before the filename in text (default) mode,
and that would impact the current support for BSD format checksums.

I'd be inclined to tag just before the checksum like:

MD5 (filename) =3D binary_checksum (default for files on dos)
 MD5 (filename) =3D text_checksum  (default for files elsewhere)

I.E. in binary mode just use BSD format,
and add the extra space when generating text format.
This has the advantage of being mostly backwards compatible.
I.E. the existing GNU *sum utils accept a space before "MD5",
and so newer GNU `*sum --tag` output would be --check able on older
and other checksum utils.  The only backwards compat edge case
is with `*sum --tag --text` on dos, which would only be
compat with the newer versions of the GNU *sum tools.
But that's fine IMHO.

Another thing to consider if generating BSD format output,
is file name escaping.
Perhaps we want to follow BSDs rules here too,
which seems to use just use \ and ^ within the (filename brackets).
Doing that would allow use to be fully compat with their checksums and
also avoid the awkward backslash at start of line mode GNU currently uses=
,
which is not compatible with BSD format processing.

cheers,
P=C3=A1draig.


From MAILER-DAEMON Thu Jul 26 06:39:05 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SuLTF-00070z-Gs
	for mharc-coreutils@gnu.org; Thu, 26 Jul 2012 06:39:05 -0400
Received: from eggs.gnu.org ([208.118.235.92]:60386)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SuLSz-0006y7-BS
	for coreutils@gnu.org; Thu, 26 Jul 2012 06:39:04 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SuLSX-0001XC-D7
	for coreutils@gnu.org; Thu, 26 Jul 2012 06:38:49 -0400
Received: from mx.meyering.net ([88.168.87.75]:49138)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SuLSX-0001WU-3h
	for coreutils@gnu.org; Thu, 26 Jul 2012 06:38:21 -0400
Received: from rho.meyering.net (rho.meyering.net [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 2A41660103
	for <coreutils@gnu.org>; Thu, 26 Jul 2012 12:38:19 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH] tail: avoid misleading diagnostic upon fstat failure
Date: Thu, 26 Jul 2012 12:38:19 +0200
Message-ID: <87fw8edcys.fsf@rho.meyering.net>
Lines: 39
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: 88.168.87.75
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 26 Jul 2012 10:39:04 -0000

FYI.  This bug seems hard enough to trigger and low enough
impact that the fix does not deserve an entry in NEWS.
Provoking the failure might be tricky, since in addition to
causing fstat failure, you'd have to make the intervening
close (via close_fd) clobber errno, probably via EINTR or EIO.
Not worth trying to write a test, IMHO.


>From a6e8e3a3e116f2cdaa452eb66032d912092d0026 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Wed, 25 Jul 2012 18:35:36 +0200
Subject: [PATCH] tail: avoid misleading diagnostic upon fstat failure

* src/tail.c (check_fspec): Save fstat-induced errno *before*
calling close_fd, not after.  Otherwise, the close could well
clobber the global errno, making tail print an invalid diagnostic.
This could happen only with tail -f, and even then, only when
a valid file descriptor were to provoke fstat failure.
---
 src/tail.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tail.c b/src/tail.c
index 29ddabd..1935605 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -1276,9 +1276,9 @@ check_fspec (struct File_spec *fspec, int wd, int *prev_wd)

   if (fstat (fspec->fd, &stats) != 0)
     {
+      fspec->errnum = errno;
       close_fd (fspec->fd, name);
       fspec->fd = -1;
-      fspec->errnum = errno;
       return;
     }

--
1.7.12.rc0.22.gcdd159b


From MAILER-DAEMON Thu Jul 26 07:07:25 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SuLuf-0006JN-04
	for mharc-coreutils@gnu.org; Thu, 26 Jul 2012 07:07:25 -0400
Received: from eggs.gnu.org ([208.118.235.92]:41977)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SuLuY-0006JB-Ep
	for coreutils@gnu.org; Thu, 26 Jul 2012 07:07:24 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SuLuS-000168-3k
	for coreutils@gnu.org; Thu, 26 Jul 2012 07:07:18 -0400
Received: from mx1.redhat.com ([209.132.183.28]:12948)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SuLuR-00015p-Sg
	for coreutils@gnu.org; Thu, 26 Jul 2012 07:07:12 -0400
Received: from int-mx01.intmail.prod.int.phx2.redhat.com
	(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6QB79cP007561
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 26 Jul 2012 07:07:09 -0400
Received: from [10.36.116.66] (ovpn-116-66.ams2.redhat.com [10.36.116.66])
	by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id q6QB77fM024127
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 26 Jul 2012 07:07:08 -0400
Message-ID: <501124DB.9090202@draigBrady.com>
Date: Thu, 26 Jul 2012 12:07:07 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
Subject: Re: [PATCH] tail: avoid misleading diagnostic upon fstat failure
References: <87fw8edcys.fsf@rho.meyering.net>
In-Reply-To: <87fw8edcys.fsf@rho.meyering.net>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=ISO-8859-1
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id
	q6QB79cP007561
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 26 Jul 2012 11:07:24 -0000

On 07/26/2012 11:38 AM, Jim Meyering wrote:
> FYI.  This bug seems hard enough to trigger and low enough
> impact that the fix does not deserve an entry in NEWS.
> Provoking the failure might be tricky, since in addition to
> causing fstat failure, you'd have to make the intervening
> close (via close_fd) clobber errno, probably via EINTR or EIO.
> Not worth trying to write a test, IMHO.

Agreed on the test not being warranted.
Good spot.

cheers,
P=E1draig.


From MAILER-DAEMON Thu Jul 26 08:00:19 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SuMjr-00009X-1k
	for mharc-coreutils@gnu.org; Thu, 26 Jul 2012 08:00:19 -0400
Received: from eggs.gnu.org ([208.118.235.92]:40672)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ooprala@redhat.com>) id 1SuMjk-0008Hc-NC
	for coreutils@gnu.org; Thu, 26 Jul 2012 08:00:17 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <ooprala@redhat.com>) id 1SuMjd-00073H-8v
	for coreutils@gnu.org; Thu, 26 Jul 2012 08:00:08 -0400
Received: from mx3-phx2.redhat.com ([209.132.183.24]:57058)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ooprala@redhat.com>) id 1SuMjc-0006wH-Uy
	for coreutils@gnu.org; Thu, 26 Jul 2012 08:00:05 -0400
Received: from zmail19.collab.prod.int.phx2.redhat.com
	(zmail19.collab.prod.int.phx2.redhat.com [10.5.83.22])
	by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q6QBxw8V028839;
	Thu, 26 Jul 2012 07:59:58 -0400
Date: Thu, 26 Jul 2012 07:59:58 -0400 (EDT)
From: Ondrej Oprala <ooprala@redhat.com>
To: =?utf-8?Q?P=C3=A1draig?= Brady <P@draigBrady.com>
Message-ID: <2056212577.677053.1343303998686.JavaMail.root@redhat.com>
In-Reply-To: <5010642B.4050007@draigBrady.com>
Subject: Re: RFE: hash-type in sum utils
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_677051_430105415.1343303998685"
X-Originating-IP: [10.34.4.237]
X-Mailer: Zimbra 7.2.0_GA_2669 (ZimbraWebClient - FF3.0 (Linux)/7.2.0_GA_2669)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 209.132.183.24
Cc: D Yu Bolkhovityanov <D.Yu.Bolkhovityanov@inp.nsk.su>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 26 Jul 2012 12:00:17 -0000

------=_Part_677051_430105415.1343303998685
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Ok, here is my patch proposition. I hope it's satisfactory.
Cheers
 Ondrej


----- Original Message -----
From: "P=C3=A1draig Brady" <P@draigBrady.com>
To: "Ondrej Oprala" <ooprala@redhat.com>
Cc: coreutils@gnu.org, "D Yu Bolkhovityanov" <D.Yu.Bolkhovityanov@inp.nsk.s=
u>
Sent: Wednesday, July 25, 2012 11:24:59 PM
Subject: Re: RFE: hash-type in sum utils

On 07/25/2012 02:23 PM, Ondrej Oprala wrote:
> How should the '--tag' switch treat binary files? Should it create someth=
ing like this:
> MD5 (*filename) =3D ........   ?

Good question.
I wouldn't tag the filenamem because to be unambiguous you'd
have to have a space before the filename in text (default) mode,
and that would impact the current support for BSD format checksums.

I'd be inclined to tag just before the checksum like:

MD5 (filename) =3D binary_checksum (default for files on dos)
 MD5 (filename) =3D text_checksum  (default for files elsewhere)

I.E. in binary mode just use BSD format,
and add the extra space when generating text format.
This has the advantage of being mostly backwards compatible.
I.E. the existing GNU *sum utils accept a space before "MD5",
and so newer GNU `*sum --tag` output would be --check able on older
and other checksum utils.  The only backwards compat edge case
is with `*sum --tag --text` on dos, which would only be
compat with the newer versions of the GNU *sum tools.
But that's fine IMHO.

Another thing to consider if generating BSD format output,
is file name escaping.
Perhaps we want to follow BSDs rules here too,
which seems to use just use \ and ^ within the (filename brackets).
Doing that would allow use to be fully compat with their checksums and
also avoid the awkward backslash at start of line mode GNU currently uses,
which is not compatible with BSD format processing.

cheers,
P=C3=A1draig.

------=_Part_677051_430105415.1343303998685
Content-Type: text/x-patch; name=sum-utils_prefix_patch.patch
Content-Disposition: attachment; filename=sum-utils_prefix_patch.patch
Content-Transfer-Encoding: base64

ZGlmZiAtdXAgY29yZXV0aWxzLTguMTcvc3JjL21kNXN1bS5jLnByZWZpeCBjb3JldXRpbHMtOC4x
Ny9zcmMvbWQ1c3VtLmMKLS0tIGNvcmV1dGlscy04LjE3L3NyYy9tZDVzdW0uYy5wcmVmaXgJMjAx
Mi0wNy0yNCAxMToyNTowNy4xMzI1MjE3NDEgKzAyMDAKKysrIGNvcmV1dGlscy04LjE3L3NyYy9t
ZDVzdW0uYwkyMDEyLTA3LTI2IDEyOjU3OjA4LjE3Mzg2NDk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IGFyZ3YsICJiY3R3IiwgbG9uZ19vcHRpb25zLCBOVUxM
KSkgIT0gLTEpCisgIHdoaWxlICgob3B0ID0gZ2V0b3B0X2xvbmcgKGFyZ2MsIGFyZ3YsICJiY3R3
bCIsIGxvbmdfb3B0aW9ucywgTlVMTCkpICE9IC0xKQogICAgIHN3aXRjaCAob3B0KQogICAgICAg
ewogICAgICAgY2FzZSAnYic6CkBAIC02OTAsNiArNzQ2LDkgQEAgbWFpbiAoaW50IGFyZ2MsIGNo
YXIgKiphcmd2KQogICAgICAgY2FzZSBTVFJJQ1RfT1BUSU9OOgogICAgICAgICBzdHJpY3QgPSB0
cnVlOwogICAgICAgICBicmVhazsKKyAgICAgIGNhc2UgVEFHX09QVElPTjoKKyAgICAgICAgcHJl
Zml4X3RhZyA9IHRydWU7CisgICAgICAgIGJyZWFrOwogICAgICAgY2FzZV9HRVRPUFRfSEVMUF9D
SEFSOwogICAgICAgY2FzZV9HRVRPUFRfVkVSU0lPTl9DSEFSIChQUk9HUkFNX05BTUUsIEFVVEhP
UlMpOwogICAgICAgZGVmYXVsdDoKQEAgLTc1NCw0MSArODEzLDM4IEBAIG1haW4gKGludCBhcmdj
LCBjaGFyICoqYXJndikKICAgICAgICAgICAgIG9rID0gZmFsc2U7CiAgICAgICAgICAgZWxzZQog
ICAgICAgICAgICAgeworICAgICAgICAgICAgICBpZiAocHJlZml4X3RhZykKKyAgICAgICAgICAg
ICAgICB7CisgICAgICAgICAgICAgICAgICBpZighZmlsZV9pc19iaW5hcnkpCisgICAgICAgICAg
ICAgICAgICAgIHB1dGNoYXIoJyAnKTsKKyAgICAgICAgICAgICAgICAgIHByaW50ZigiJXMiLCBw
cmVmaXhlc1tQUkVGSVhfSU5ERVhdKTsKKyAgICAgICAgICAgICAgICAgIHB1dGNoYXIoJygnKTsK
KyAgICAgICAgICAgICAgICAgIGJzZF9wcmludF9maWxlbmFtZShmaWxlKTsKKyAgICAgICAgICAg
ICAgICAgIHByaW50ZigiKSA9ICIpOworICAgICAgICAgICAgICAgIH0KKwogICAgICAgICAgICAg
ICBzaXplX3QgaTsKIAogICAgICAgICAgICAgICAvKiBPdXRwdXQgYSBsZWFkaW5nIGJhY2tzbGFz
aCBpZiB0aGUgZmlsZSBuYW1lIGNvbnRhaW5zCiAgICAgICAgICAgICAgICAgIGEgbmV3bGluZSBv
ciBiYWNrc2xhc2guICAqLwotICAgICAgICAgICAgICBpZiAoc3RyY2hyIChmaWxlLCAnXG4nKSB8
fCBzdHJjaHIgKGZpbGUsICdcXCcpKQorICAgICAgICAgICAgICBpZiAoKHN0cmNociAoZmlsZSwg
J1xuJykgfHwgc3RyY2hyIChmaWxlLCAnXFwnKSkgJiYgIXByZWZpeF90YWcpCiAgICAgICAgICAg
ICAgICAgcHV0Y2hhciAoJ1xcJyk7CiAKICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IChk
aWdlc3RfaGV4X2J5dGVzIC8gMik7ICsraSkKICAgICAgICAgICAgICAgICBwcmludGYgKCIlMDJ4
IiwgYmluX2J1ZmZlcltpXSk7CiAKLSAgICAgICAgICAgICAgcHV0Y2hhciAoJyAnKTsKLSAgICAg
ICAgICAgICAgaWYgKGZpbGVfaXNfYmluYXJ5KQotICAgICAgICAgICAgICAgIHB1dGNoYXIgKCcq
Jyk7Ci0gICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICBwdXRjaGFyICgnICcpOwot
Ci0gICAgICAgICAgICAgIC8qIFRyYW5zbGF0ZSBlYWNoIE5FV0xJTkUgYnl0ZSB0byB0aGUgc3Ry
aW5nLCAiXFxuIiwKLSAgICAgICAgICAgICAgICAgYW5kIGVhY2ggYmFja3NsYXNoIHRvICJcXFxc
Ii4gICovCi0gICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBzdHJsZW4gKGZpbGUpOyArK2kp
CisgICAgICAgICAgICAgIGlmICghcHJlZml4X3RhZykKICAgICAgICAgICAgICAgICB7Ci0gICAg
ICAgICAgICAgICAgICBzd2l0Y2ggKGZpbGVbaV0pCi0gICAgICAgICAgICAgICAgICAgIHsKLSAg
ICAgICAgICAgICAgICAgICAgY2FzZSAnXG4nOgotICAgICAgICAgICAgICAgICAgICAgIGZwdXRz
ICgiXFxuIiwgc3Rkb3V0KTsKLSAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAg
ICAgICAgICAgICAgICBjYXNlICdcXCc6Ci0gICAgICAgICAgICAgICAgICAgICAgZnB1dHMgKCJc
XFxcIiwgc3Rkb3V0KTsKLSAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAg
ICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICAgIHB1dGNoYXIgKGZpbGVb
aV0pOwotICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9
CisgICAgICAgICAgICAgICAgICBwdXRjaGFyICgnICcpOworCisgICAgICAgICAgICAgICAgICBp
ZiAoZmlsZV9pc19iaW5hcnkpCisgICAgICAgICAgICAgICAgICAgIHB1dGNoYXIgKCcqJyk7Cisg
ICAgICAgICAgICAgICAgICBlbHNlCisgICAgICAgICAgICAgICAgICAgIHB1dGNoYXIgKCcgJyk7
CisKKyAgICAgICAgICAgICAgICAgIHByaW50X2ZpbGVuYW1lKGZpbGUpOwogICAgICAgICAgICAg
ICAgIH0KKwogICAgICAgICAgICAgICBwdXRjaGFyICgnXG4nKTsKICAgICAgICAgICAgIH0KICAg
ICAgICAgfQo=
------=_Part_677051_430105415.1343303998685--


From MAILER-DAEMON Thu Jul 26 08:47:30 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SuNTW-00082J-Kh
	for mharc-coreutils@gnu.org; Thu, 26 Jul 2012 08:47:30 -0400
Received: from eggs.gnu.org ([208.118.235.92]:43781)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SuNTP-00081V-6e
	for coreutils@gnu.org; Thu, 26 Jul 2012 08:47:29 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SuNTM-0005Ip-HF
	for coreutils@gnu.org; Thu, 26 Jul 2012 08:47:23 -0400
Received: from mx1.redhat.com ([209.132.183.28]:58700)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SuNTM-0005G5-8z
	for coreutils@gnu.org; Thu, 26 Jul 2012 08:47:20 -0400
Received: from int-mx01.intmail.prod.int.phx2.redhat.com
	(int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6QClIgX018789
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 26 Jul 2012 08:47:19 -0400
Received: from [10.36.116.66] (ovpn-116-66.ams2.redhat.com [10.36.116.66])
	by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id q6QClGBn027448
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Thu, 26 Jul 2012 08:47:17 -0400
Message-ID: <50113C53.7030703@draigBrady.com>
Date: Thu, 26 Jul 2012 13:47:15 +0100
From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Ondrej Oprala <ooprala@redhat.com>
Subject: Re: RFE: hash-type in sum utils
References: <2056212577.677053.1343303998686.JavaMail.root@redhat.com>
In-Reply-To: <2056212577.677053.1343303998686.JavaMail.root@redhat.com>
X-Enigmail-Version: 1.3.2
Content-Type: multipart/mixed; boundary="------------010603050200000209060700"
X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: D Yu Bolkhovityanov <D.Yu.Bolkhovityanov@inp.nsk.su>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 26 Jul 2012 12:47:29 -0000

This is a multi-part message in MIME format.
--------------010603050200000209060700
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id q6QClIgX018789

On 07/26/2012 12:59 PM, Ondrej Oprala wrote:
> Ok, here is my patch proposition. I hope it's satisfactory.

Thanks for doing that!
I've attached a mainly formatting cleanup patch.

BTW be careful with strlen() in a for loop test.
That may not be optimized by the compiler,
especially when the passed string is not const or restrict.

The main logic outstanding is to escape the filename
in a BSD compat fashion.
I can have a look at that if you want, but not today.

cheers,
P=C3=A1draig.

--------------010603050200000209060700
Content-Type: text/plain;
 name="sum-utils_prefix-adjust.diff"
Content-Disposition: attachment;
 filename="sum-utils_prefix-adjust.diff"
Content-Transfer-Encoding: base64

ZGlmZiAtLWdpdCBhL3NyYy9tZDVzdW0uYyBiL3NyYy9tZDVzdW0uYwppbmRleCBhZTQyOWFl
Li5iYjY2NTBmIDEwMDY0NAotLS0gYS9zcmMvbWQ1c3VtLmMKKysrIGIvc3JjL21kNXN1bS5j
CkBAIC0xNjksNyArMTY5LDYgQEAgc3RhdGljIGNvbnN0IGNoYXIgKmNvbnN0IHByZWZpeGVz
W10gPQogICAiU0hBNTEyICIsCiAgICJTSEEzODQgIgogfTsKLSAgICAgCi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IE5VTEwsIF9JT0xCRiwgMCk7
CiAKLSAgd2hpbGUgKChvcHQgPSBnZXRvcHRfbG9uZyAoYXJnYywgYXJndiwgImJjdHdsIiwg
bG9uZ19vcHRpb25zLCBOVUxMKSkgIT0gLTEpCisgIHdoaWxlICgob3B0ID0gZ2V0b3B0X2xv
bmcgKGFyZ2MsIGFyZ3YsICJiY3R3IiwgbG9uZ19vcHRpb25zLCBOVUxMKSkgIT0gLTEpCiAg
ICAgc3dpdGNoIChvcHQpCiAgICAgICB7CiAgICAgICBjYXNlICdiJzoKQEAgLTgxNSwxOSAr
ODEwLDE5IEBAIG1haW4gKGludCBhcmdjLCBjaGFyICoqYXJndikKICAgICAgICAgICAgIHsK
ICAgICAgICAgICAgICAgaWYgKHByZWZpeF90YWcpCiAgICAgICAgICAgICAgICAgewotICAg
ICAgICAgICAgICAgICAgaWYoIWZpbGVfaXNfYmluYXJ5KQotICAgICAgICAgICAgICAgICAg
ICBwdXRjaGFyKCcgJyk7Ci0gICAgICAgICAgICAgICAgICBwcmludGYoIiVzIiwgcHJlZml4
ZXNbUFJFRklYX0lOREVYXSk7Ci0gICAgICAgICAgICAgICAgICBwdXRjaGFyKCcoJyk7Ci0g
ICAgICAgICAgICAgICAgICBic2RfcHJpbnRfZmlsZW5hbWUoZmlsZSk7Ci0gICAgICAgICAg
ICAgICAgICBwcmludGYoIikgPSAiKTsKKyAgICAgICAgICAgICAgICAgIGlmICghZmlsZV9p
c19iaW5hcnkpCisgICAgICAgICAgICAgICAgICAgIHB1dGNoYXIgKCcgJyk7CisgICAgICAg
ICAgICAgICAgICBmcHV0cyAocHJlZml4ZXNbUFJFRklYX0lOREVYXSwgc3Rkb3V0KTsKKyAg
ICAgICAgICAgICAgICAgIHB1dGNoYXIgKCcoJyk7CisgICAgICAgICAgICAgICAgICBic2Rf
cHJpbnRfZmlsZW5hbWUgKGZpbGUpOworICAgICAgICAgICAgICAgICAgZnB1dHMgKCIpID0g
Iiwgc3Rkb3V0KTsKICAgICAgICAgICAgICAgICB9CiAKICAgICAgICAgICAgICAgc2l6ZV90
IGk7CiAKICAgICAgICAgICAgICAgLyogT3V0cHV0IGEgbGVhZGluZyBiYWNrc2xhc2ggaWYg
dGhlIGZpbGUgbmFtZSBjb250YWlucwogICAgICAgICAgICAgICAgICBhIG5ld2xpbmUgb3Ig
YmFja3NsYXNoLiAgKi8KLSAgICAgICAgICAgICAgaWYgKChzdHJjaHIgKGZpbGUsICdcbicp
IHx8IHN0cmNociAoZmlsZSwgJ1xcJykpICYmICFwcmVmaXhfdGFnKQorICAgICAgICAgICAg
ICBpZiAoIXByZWZpeF90YWcgJiYgKHN0cmNociAoZmlsZSwgJ1xuJykgfHwgc3RyY2hyIChm
aWxlLCAnXFwnKSkpCiAgICAgICAgICAgICAgICAgcHV0Y2hhciAoJ1xcJyk7CiAKICAgICAg
ICAgICAgICAgZm9yIChpID0gMDsgaSA8IChkaWdlc3RfaGV4X2J5dGVzIC8gMik7ICsraSkK
QEAgLTg0Miw3ICs4MzcsNyBAQCBtYWluIChpbnQgYXJnYywgY2hhciAqKmFyZ3YpCiAgICAg
ICAgICAgICAgICAgICBlbHNlCiAgICAgICAgICAgICAgICAgICAgIHB1dGNoYXIgKCcgJyk7
CiAKLSAgICAgICAgICAgICAgICAgIHByaW50X2ZpbGVuYW1lKGZpbGUpOworICAgICAgICAg
ICAgICAgICAgcHJpbnRfZmlsZW5hbWUgKGZpbGUpOwogICAgICAgICAgICAgICAgIH0KIAog
ICAgICAgICAgICAgICBwdXRjaGFyICgnXG4nKTsK
--------------010603050200000209060700--


From MAILER-DAEMON Thu Jul 26 10:06:56 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SuOiO-0003Fo-E0
	for mharc-coreutils@gnu.org; Thu, 26 Jul 2012 10:06:56 -0400
Received: from eggs.gnu.org ([208.118.235.92]:56317)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ooprala@redhat.com>) id 1SuOiG-0002xZ-Ov
	for coreutils@gnu.org; Thu, 26 Jul 2012 10:06:54 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <ooprala@redhat.com>) id 1SuOiA-0003OR-Lb
	for coreutils@gnu.org; Thu, 26 Jul 2012 10:06:48 -0400
Received: from mx4-phx2.redhat.com ([209.132.183.25]:54377)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ooprala@redhat.com>) id 1SuOiA-0003NZ-Dh
	for coreutils@gnu.org; Thu, 26 Jul 2012 10:06:42 -0400
Received: from zmail19.collab.prod.int.phx2.redhat.com
	(zmail19.collab.prod.int.phx2.redhat.com [10.5.83.22])
	by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q6QE6cQh000686;
	Thu, 26 Jul 2012 10:06:38 -0400
Date: Thu, 26 Jul 2012 10:06:38 -0400 (EDT)
From: Ondrej Oprala <ooprala@redhat.com>
To: =?utf-8?Q?P=C3=A1draig?= Brady <P@draigBrady.com>
Message-ID: <597807603.706219.1343311598463.JavaMail.root@redhat.com>
In-Reply-To: <50113C53.7030703@draigBrady.com>
Subject: Re: RFE: hash-type in sum utils
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Originating-IP: [10.34.4.237]
X-Mailer: Zimbra 7.2.0_GA_2669 (ZimbraWebClient - FF3.0 (Linux)/7.2.0_GA_2669)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 209.132.183.25
Cc: D Yu Bolkhovityanov <D.Yu.Bolkhovityanov@inp.nsk.su>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 26 Jul 2012 14:06:54 -0000

Sorry but I cant seem to create a filename that would cause md5sum --tag  t=
o
output escaping different from the BSD's md5. Could you be more specific on=
 the BSD escaping problem, please?
Also thanks for the formatting patch.
Cheers
 Ondrej

----- Original Message -----
From: "P=C3=A1draig Brady" <P@draigBrady.com>
To: "Ondrej Oprala" <ooprala@redhat.com>
Cc: coreutils@gnu.org, "D Yu Bolkhovityanov" <D.Yu.Bolkhovityanov@inp.nsk.s=
u>
Sent: Thursday, July 26, 2012 2:47:15 PM
Subject: Re: RFE: hash-type in sum utils

On 07/26/2012 12:59 PM, Ondrej Oprala wrote:
> Ok, here is my patch proposition. I hope it's satisfactory.

Thanks for doing that!
I've attached a mainly formatting cleanup patch.

BTW be careful with strlen() in a for loop test.
That may not be optimized by the compiler,
especially when the passed string is not const or restrict.

The main logic outstanding is to escape the filename
in a BSD compat fashion.
I can have a look at that if you want, but not today.

cheers,
P=C3=A1draig.


From MAILER-DAEMON Thu Jul 26 11:50:58 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SuQL4-0001HC-3Z
	for mharc-coreutils@gnu.org; Thu, 26 Jul 2012 11:50:58 -0400
Received: from eggs.gnu.org ([208.118.235.92]:40602)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SuQL1-000196-81
	for coreutils@gnu.org; Thu, 26 Jul 2012 11:50:56 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SuQKz-0003cO-Vf
	for coreutils@gnu.org; Thu, 26 Jul 2012 11:50:55 -0400
Received: from mx1.redhat.com ([209.132.183.28]:14008)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1SuQKz-0003c3-NR
	for coreutils@gnu.org; Thu, 26 Jul 2012 11:50:53 -0400
Received: from int-mx09.intmail.prod.int.phx2.redhat.com
	(int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6QFopBn004277
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Thu, 26 Jul 2012 11:50:52 -0400
Received: from [10.36.116.66] (ovpn-116-66.ams2.redhat.com [10.36.116.66])
	by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q6QFom7M001006
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Thu, 26 Jul 2012 11:50:50 -0400
Message-ID: <50116758.9050802@draigBrady.com>
Date: Thu, 26 Jul 2012 16:50:48 +0100
From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Ondrej Oprala <ooprala@redhat.com>
Subject: Re: RFE: hash-type in sum utils
References: <597807603.706219.1343311598463.JavaMail.root@redhat.com>
In-Reply-To: <597807603.706219.1343311598463.JavaMail.root@redhat.com>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=UTF-8
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id
	q6QFopBn004277
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: D Yu Bolkhovityanov <D.Yu.Bolkhovityanov@inp.nsk.su>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Thu, 26 Jul 2012 15:50:56 -0000

On 07/26/2012 03:06 PM, Ondrej Oprala wrote:
> Sorry but I cant seem to create a filename that would cause md5sum --ta=
g  to
> output escaping different from the BSD's md5. Could you be more specifi=
c on the BSD escaping problem, please?
> Also thanks for the formatting patch.

Oops, I assumed BSD's utils would at least escape '\n'
but looking at their code they just output it directly.

So therefore BSD and old GNU don't support checksum files
in BSD format when any file names contain a '\n'. Fair enough.

So then , I suppose we should use the existing GNU escape mechanism
in this case too. I.E. if there is a '\n' character in the name,
then add a '\' at the start of the line and replace any
'\' with "\\" and '\n' with "\" + "n".

BTW, I'm wondering why we enable escaping on output when
there are '\' characters in the name, but no '\n' chars?
Avoiding that would increase compatibility with the BSDs.

cheers,
P=C3=A1draig.


From MAILER-DAEMON Fri Jul 27 12:56:46 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SunqI-0001wA-24
	for mharc-coreutils@gnu.org; Fri, 27 Jul 2012 12:56:46 -0400
Received: from eggs.gnu.org ([208.118.235.92]:47635)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SunqF-0001vZ-7b
	for coreutils@gnu.org; Fri, 27 Jul 2012 12:56:44 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SunqE-00071p-0A
	for coreutils@gnu.org; Fri, 27 Jul 2012 12:56:42 -0400
Received: from mx.meyering.net ([88.168.87.75]:53811)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SunqD-00070d-PQ
	for coreutils@gnu.org; Fri, 27 Jul 2012 12:56:41 -0400
Received: from rho.meyering.net (rho.meyering.net [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 66D81600CC;
	Fri, 27 Jul 2012 18:56:39 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Goswin von Brederlow <goswin-v-b@web.de>
Subject: Re: Bug#682969: timeout 20 /usr/sbin/ntpd -g -q gives wrong return
	code
In-Reply-To: <20120727135313.29004.75757.reportbug@frosties.localnet> (Goswin
	von Brederlow's message of "Fri, 27 Jul 2012 15:53:13 +0200")
References: <20120727135313.29004.75757.reportbug@frosties.localnet>
Date: Fri, 27 Jul 2012 18:56:39 +0200
Message-ID: <87lii587nc.fsf@rho.meyering.net>
Lines: 35
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: 88.168.87.75
Cc: coreutils@gnu.org, 682969@bugs.debian.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 27 Jul 2012 16:56:44 -0000

Goswin von Brederlow wrote:
> Package: coreutils
> Version: 8.13-3.2
> Severity: normal
> File: /usr/bin/timeout
>
> I'm trying to set the time during boot. Unfortunately ntpd hangs forever
> if the timeserver is unavailable. So I added a timeout to it so the
> system still continues to boot without the correct time.
>
> But I would like to log the error. Timeout is supposed to return 124 if the
> time was exceeded. But if ntpd corrects the time by more than the timeout
> then the return value is 124 despite the fact the real time passed was less.
>
> Wouldn't it be possible to detect this case and return the exit code of
> ntpd instead of a false timeout error?

Thanks for the report.
Did you experience an actual problem?

When I try to trigger such misbehavior, timeout seems to work fine
on a system (Fedora 17) with a working timer_settime function:

    $ timeout 2 date --set=$(LC_ALL=C date -d 10\ sec +@%s); echo $?
    0

I.e., when timeout's child terminates, the clock says
10 seconds have elapsed, yet it exits 0, because the
duration was less than 2 seconds.

I'm using the timeout from coreutils-8.17, but nothing
has changed in this area since before 8.13.

I even rebuilt my timeout binary, simulating no timer_settime
function so that it would take the alarm-using path.  Same result.


From MAILER-DAEMON Fri Jul 27 14:18:44 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Sup7c-00037s-Sr
	for mharc-coreutils@gnu.org; Fri, 27 Jul 2012 14:18:44 -0400
Received: from eggs.gnu.org ([208.118.235.92]:52644)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1Sup7b-00037j-4A
	for coreutils@gnu.org; Fri, 27 Jul 2012 14:18:44 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1Sup7Z-00038z-SG
	for coreutils@gnu.org; Fri, 27 Jul 2012 14:18:42 -0400
Received: from mx1.redhat.com ([209.132.183.28]:37533)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1Sup7Z-00038d-JW
	for coreutils@gnu.org; Fri, 27 Jul 2012 14:18:41 -0400
Received: from int-mx10.intmail.prod.int.phx2.redhat.com
	(int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23])
	by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6RIIVRh000522
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 27 Jul 2012 14:18:32 -0400
Received: from [10.36.116.42] (ovpn-116-42.ams2.redhat.com [10.36.116.42])
	by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id q6RIISmw019925
	(version=TLSv1/SSLv3 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO);
	Fri, 27 Jul 2012 14:18:30 -0400
Message-ID: <5012DBB7.60502@draigBrady.com>
Date: Fri, 27 Jul 2012 19:19:35 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; Linux x86_64;
	rv:6.0) Gecko/20110816 Thunderbird/6.0
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
Subject: Re: Bug#682969: timeout 20 /usr/sbin/ntpd -g -q gives wrong return
	code
References: <20120727135313.29004.75757.reportbug@frosties.localnet>
	<87lii587nc.fsf@rho.meyering.net>
In-Reply-To: <87lii587nc.fsf@rho.meyering.net>
X-Enigmail-Version: 1.3.2
Content-Type: text/plain; charset=ISO-8859-1
X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mx1.redhat.com id
	q6RIIVRh000522
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 209.132.183.28
Cc: coreutils@gnu.org, 682969@bugs.debian.org,
	Goswin von Brederlow <goswin-v-b@web.de>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 27 Jul 2012 18:18:44 -0000

On 07/27/2012 05:56 PM, Jim Meyering wrote:
> Goswin von Brederlow wrote:
>> Package: coreutils
>> Version: 8.13-3.2
>> Severity: normal
>> File: /usr/bin/timeout
>>
>> I'm trying to set the time during boot. Unfortunately ntpd hangs forev=
er
>> if the timeserver is unavailable. So I added a timeout to it so the
>> system still continues to boot without the correct time.
>>
>> But I would like to log the error. Timeout is supposed to return 124 i=
f the
>> time was exceeded. But if ntpd corrects the time by more than the time=
out
>> then the return value is 124 despite the fact the real time passed was=
 less.
>>
>> Wouldn't it be possible to detect this case and return the exit code o=
f
>> ntpd instead of a false timeout error?
>=20
> Thanks for the report.
> Did you experience an actual problem?
>=20
> When I try to trigger such misbehavior, timeout seems to work fine
> on a system (Fedora 17) with a working timer_settime function:
>=20
>     $ timeout 2 date --set=3D$(LC_ALL=3DC date -d 10\ sec +@%s); echo $=
?
>     0
>=20
> I.e., when timeout's child terminates, the clock says
> 10 seconds have elapsed, yet it exits 0, because the
> duration was less than 2 seconds.
>=20
> I'm using the timeout from coreutils-8.17, but nothing
> has changed in this area since before 8.13.
>=20
> I even rebuilt my timeout binary, simulating no timer_settime
> function so that it would take the alarm-using path.  Same result.

Note timeout(1) currently uses timer_create(CLOCK_REALTIME).
That could jump and cause signals to fire.
Though I can't reproduce here, even when pushing the
updated system clock down to the hardware:

# timeout 3 sh -c 'date --set=3D$(LC_ALL=3DC date -d 10\ sec +@%s); hwclo=
ck -w; sleep 1'
# echo $?
0

I was wondering about using CLOCK_MONOTONIC instead,
though I'd need to test how that functions over a suspend/resume.
I suspect it only counts up while the system is running.
Maybe we should default to system running time, rather than
wall clock time, though then we'd have to look at/document
the inconsistency on systems without CLOCK_MONOTONIC.

Goswin what's the output from uname -a
as a matter of interest?

cheers,
P=E1draig.


From MAILER-DAEMON Fri Jul 27 14:44:27 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SupWV-0001dp-GQ
	for mharc-coreutils@gnu.org; Fri, 27 Jul 2012 14:44:27 -0400
Received: from eggs.gnu.org ([208.118.235.92]:47063)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SupWT-0001cd-DQ
	for coreutils@gnu.org; Fri, 27 Jul 2012 14:44:26 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SupWS-00049A-E6
	for coreutils@gnu.org; Fri, 27 Jul 2012 14:44:25 -0400
Received: from mx.meyering.net ([88.168.87.75]:54079)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SupWS-000495-7O
	for coreutils@gnu.org; Fri, 27 Jul 2012 14:44:24 -0400
Received: from rho.meyering.net (rho.meyering.net [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 1D2C060069;
	Fri, 27 Jul 2012 20:44:23 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Subject: Re: Bug#682969: timeout 20 /usr/sbin/ntpd -g -q gives wrong return
	code
In-Reply-To: <5012DBB7.60502@draigBrady.com> (=?iso-8859-1?Q?=22P=E1draig?=
	Brady"'s message of "Fri, 27 Jul 2012 19:19:35 +0100")
References: <20120727135313.29004.75757.reportbug@frosties.localnet>
	<87lii587nc.fsf@rho.meyering.net> <5012DBB7.60502@draigBrady.com>
Date: Fri, 27 Jul 2012 20:44:23 +0200
Message-ID: <87d33h82ns.fsf@rho.meyering.net>
Lines: 38
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 88.168.87.75
Cc: coreutils@gnu.org, 682969@bugs.debian.org,
	Goswin von Brederlow <goswin-v-b@web.de>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 27 Jul 2012 18:44:26 -0000

P=E1draig Brady wrote:
> On 07/27/2012 05:56 PM, Jim Meyering wrote:
...
>> When I try to trigger such misbehavior, timeout seems to work fine
>> on a system (Fedora 17) with a working timer_settime function:
>>
>>     $ timeout 2 date --set=3D$(LC_ALL=3DC date -d 10\ sec +@%s); echo $?
>>     0
>>
>> I.e., when timeout's child terminates, the clock says
>> 10 seconds have elapsed, yet it exits 0, because the
>> duration was less than 2 seconds.
>>
>> I'm using the timeout from coreutils-8.17, but nothing
>> has changed in this area since before 8.13.
>>
>> I even rebuilt my timeout binary, simulating no timer_settime
>> function so that it would take the alarm-using path.  Same result.
>
> Note timeout(1) currently uses timer_create(CLOCK_REALTIME).
> That could jump and cause signals to fire.
> Though I can't reproduce here, even when pushing the
> updated system clock down to the hardware:
>
> # timeout 3 sh -c 'date --set=3D$(LC_ALL=3DC date -d 10\ sec +@%s);
> hwclock -w; sleep 1'
> # echo $?
> 0
>
> I was wondering about using CLOCK_MONOTONIC instead,
> though I'd need to test how that functions over a suspend/resume.
> I suspect it only counts up while the system is running.
> Maybe we should default to system running time, rather than
> wall clock time, though then we'd have to look at/document
> the inconsistency on systems without CLOCK_MONOTONIC.

Yes, using CLOCK_MONOTONIC looked tempting to me, too, but finding
no problem with the use of CLOCK_REALTIME, I was leery of switching.


From MAILER-DAEMON Mon Jul 30 08:43:06 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SvpJS-0001np-3W
	for mharc-coreutils@gnu.org; Mon, 30 Jul 2012 08:43:06 -0400
Received: from eggs.gnu.org ([208.118.235.92]:33879)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ooprala@redhat.com>) id 1SvpJL-0001nB-9t
	for coreutils@gnu.org; Mon, 30 Jul 2012 08:43:04 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <ooprala@redhat.com>) id 1SvpJ9-0000ve-W6
	for coreutils@gnu.org; Mon, 30 Jul 2012 08:42:59 -0400
Received: from mx3-phx2.redhat.com ([209.132.183.24]:59837)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ooprala@redhat.com>) id 1SvpJ9-0000vT-IB
	for coreutils@gnu.org; Mon, 30 Jul 2012 08:42:47 -0400
Received: from zmail19.collab.prod.int.phx2.redhat.com
	(zmail19.collab.prod.int.phx2.redhat.com [10.5.83.22])
	by mx3-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q6UCghNe002551;
	Mon, 30 Jul 2012 08:42:43 -0400
Date: Mon, 30 Jul 2012 08:42:43 -0400 (EDT)
From: Ondrej Oprala <ooprala@redhat.com>
To: =?utf-8?Q?P=C3=A1draig?= Brady <P@draigBrady.com>
Message-ID: <269107347.1068567.1343652163170.JavaMail.root@redhat.com>
In-Reply-To: <50116758.9050802@draigBrady.com>
Subject: Re: RFE: hash-type in sum utils
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1068565_1097199977.1343652163169"
X-Originating-IP: [10.34.4.237]
X-Mailer: Zimbra 7.2.0_GA_2669 (ZimbraWebClient - FF3.0 (Linux)/7.2.0_GA_2669)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 209.132.183.24
Cc: D Yu Bolkhovityanov <D.Yu.Bolkhovityanov@inp.nsk.su>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 30 Jul 2012 12:43:04 -0000

------=_Part_1068565_1097199977.1343652163169
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Alright, I've redone it so now the hashes create and expect GNU escaping
 in both the BSD and GNU output format.
I left the --tag format indication of text files to be a space before the a=
lgo. name
so far, but I can change that if needed.
Cheers,
 Ondrej

----- Original Message -----
From: "P=C3=A1draig Brady" <P@draigBrady.com>
To: "Ondrej Oprala" <ooprala@redhat.com>
Cc: coreutils@gnu.org, "D Yu Bolkhovityanov" <D.Yu.Bolkhovityanov@inp.nsk.s=
u>
Sent: Thursday, July 26, 2012 5:50:48 PM
Subject: Re: RFE: hash-type in sum utils

On 07/26/2012 03:06 PM, Ondrej Oprala wrote:
> Sorry but I cant seem to create a filename that would cause md5sum --tag =
 to
> output escaping different from the BSD's md5. Could you be more specific =
on the BSD escaping problem, please?
> Also thanks for the formatting patch.

Oops, I assumed BSD's utils would at least escape '\n'
but looking at their code they just output it directly.

So therefore BSD and old GNU don't support checksum files
in BSD format when any file names contain a '\n'. Fair enough.

So then , I suppose we should use the existing GNU escape mechanism
in this case too. I.E. if there is a '\n' character in the name,
then add a '\' at the start of the line and replace any
'\' with "\\" and '\n' with "\" + "n".

BTW, I'm wondering why we enable escaping on output when
there are '\' characters in the name, but no '\n' chars?
Avoiding that would increase compatibility with the BSDs.

cheers,
P=C3=A1draig.

------=_Part_1068565_1097199977.1343652163169
Content-Type: text/x-patch; name=hash-tag.patch
Content-Disposition: attachment; filename=hash-tag.patch
Content-Transfer-Encoding: base64

ZGlmZiAtdXAgY29yZXV0aWxzLTguMTcvc3JjL21kNXN1bS5jLnByZWZpeCBjb3JldXRpbHMtOC4x
Ny9zcmMvbWQ1c3VtLmMKLS0tIGNvcmV1dGlscy04LjE3L3NyYy9tZDVzdW0uYy5wcmVm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dG8gYSBiYWNrc2xhc2guICAqLworCisgICpmaWxlX25hbWUgPSBzOworICBj
aGFyICpkc3QgPSBzOworICBpbnQgaSA9IDA7CisKKyAgd2hpbGUgKGkgPCBzX2xlbikKKyAgICB7
CisgICAgICBzd2l0Y2ggKHNbaV0pCisgICAgICAgIHsKKyAgICAgICAgY2FzZSAnXFwnOgorICAg
ICAgICAgIGlmIChpID09IHNfbGVuIC0gMSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAg
LyogQSB2YWxpZCBsaW5lIGRvZXMgbm90IGVuZCB3aXRoIGEgYmFja3NsYXNoLiAgKi8KKyAgICAg
ICAgICAgICAgcmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgICsraTsKKyAg
ICAgICAgICBzd2l0Y2ggKHNbaSsrXSkKKyAgICAgICAgICAgIHsKKyAgICAgICAgICAgIGNhc2Ug
J24nOgorICAgICAgICAgICAgICAqZHN0KysgPSAnXG4nOworICAgICAgICAgICAgICBicmVhazsK
KyAgICAgICAgICAgIGNhc2UgJ1xcJzoKKyAgICAgICAgICAgICAgKmRzdCsrID0gJ1xcJzsKKyAg
ICAgICAgICAgICAgYnJlYWs7CisgICAgICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICAgICAv
KiBPbmx5ICdcJyBvciAnbicgbWF5IGZvbGxvdyBhIGJhY2tzbGFzaC4gICovCisgICAgICAgICAg
ICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICBicmVhazsKKworICAg
ICAgICBjYXNlICdcMCc6CisgICAgICAgICAgLyogVGhlIGZpbGUgbmFtZSBtYXkgbm90IGNvbnRh
aW4gYSBOVUwuICAqLworICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICBicmVhazsK
KworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgICpkc3QrKyA9IHNbaSsrXTsKKyAgICAgICAg
ICBicmVhazsKKyAgICAgICAgfQorICAgIH0KKyAgKmR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hcGUgKHMsIGksIGZpbGVfbmFtZSkp
CisgICAgICByZXR1cm4gZmFsc2U7CisKICAgc1tpKytdID0gJ1wwJzsKIAogICB3aGlsZSAoSVNX
SElURSAoc1tpXSkpCkBAIC0yNzEsNyArMzQxLDE2IEBAIHNwbGl0XzMgKGNoYXIgKnMsIHNpemVf
dCBzX2xlbiwKICAgd2hpbGUgKElTV0hJVEUgKHNbaV0pKQogICAgICsraTsKIAorICBpZiAoc1tp
XSA9PSAnXFwnKQorICAgIHsKKyAgICAgICsraTsKKyAgICAgIGVzY2FwZWRfZmlsZW5hbWUgPSB0
cnVlOworICAgIH0KKwogICAvKiBDaGVjayBmb3IgQlNELXN0eWxlIGNoZWNrc3VtIGxpbmUuICov
CisgIGlmIChzW2ldID09ICcgJykKKyAgICArK2k7CisKICAgYWxnb19uYW1lX2xlbiA9IHN0cmxl
biAoRElHRVNUX1RZUEVfU1RSSU5HKTsKICAgaWYgKFNUUkVRX0xFTiAocyArIGksIERJR0VTVF9U
WVBFX1NUUklORywgYWxnb19uYW1lX2xlbikpCiAgICAgewpAQCAtMjgyLDkgKzM2MSwxMiBAQCBz
cGxpdF8zIChjaGFyICpzLCBzaXplX3Qgc19sZW4sCiAgICAgICAgICAgKmJpbmFyeSA9IDA7CiAg
ICAgICAgICAgcmV0dXJuIGJzZF9zcGxpdF8zIChzICsgICAgICBpICsgYWxnb19uYW1lX2xlbiAr
IDEsCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzX2xlbiAtIChpICsgYWxnb19uYW1l
X2xlbiArIDEpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGV4X2RpZ2VzdCwgZmls
ZV9uYW1lKTsKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhleF9kaWdlc3QsIGZpbGVf
bmFtZSwgZXNjYXBlZF9maWxlbmFtZSk7CiAgICAgICAgIH0KICAgICB9CisgIGVsc2UgaWYgKGVz
Y2FwZWRfZmlsZW5hbWUgJiYgKHNbaV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AnXFwnIHN0cmluZyB0byBhIGJhY2tzbGFzaC4gICov
Ci0KLSAgICAgIGNoYXIgKmRzdCA9ICZzW2ldOwotCi0gICAgICB3aGlsZSAoaSA8IHNfbGVuKQot
ICAgICAgICB7Ci0gICAgICAgICAgc3dpdGNoIChzW2ldKQotICAgICAgICAgICAgewotICAgICAg
ICAgICAgY2FzZSAnXFwnOgotICAgICAgICAgICAgICBpZiAoaSA9PSBzX2xlbiAtIDEpCi0gICAg
ICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgLyogQSB2YWxpZCBsaW5lIGRvZXMgbm90
IGVuZCB3aXRoIGEgYmFja3NsYXNoLiAgKi8KLSAgICAgICAgICAgICAgICAgIHJldHVybiBmYWxz
ZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICsraTsKLSAgICAgICAgICAgICAg
c3dpdGNoIChzW2krK10pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGNhc2Ug
J24nOgotICAgICAgICAgICAgICAgICAgKmRzdCsrID0gJ1xuJzsKLSAgICAgICAgICAgICAgICAg
IGJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgJ1xcJzoKLSAgICAgICAgICAgICAgICAgICpk
c3QrKyA9ICdcXCc7Ci0gICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICBk
ZWZhdWx0OgotICAgICAgICAgICAgICAgICAgLyogT25seSAnXCcgb3IgJ24nIG1heSBmb2xsb3cg
YSBiYWNrc2xhc2guICAqLwotICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAg
ICAgICAgICAgIH0KLSAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2UgJ1ww
JzoKLSAgICAgICAgICAgICAgLyogVGhlIGZpbGUgbmFtZSBtYXkgbm90IGNvbnRhaW4gYSBOVUwu
ICAqLwotICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICAgIGJyZWFrOwor
ICAgIHJldHVybiBmaWxlbmFtZV9lc2NhcGUgKCZzW2ldLCBzX2xlbiAtIGksIGZpbGVfbmFtZSk7
CiAKLSAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICpkc3QrKyA9IHNbaSsrXTsK
LSAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KLSAgICAgICpk
c3QgPSAnXDAnOwotICAgIH0KICAgcmV0dXJuIHRydWU7CiB9CiAKQEAgLTYzNiw2ICs2NzIsMzEg
QEAgZGlnZXN0X2NoZWNrIChjb25zdCBjaGFyICpjaGVja2ZpbGVfbmFtZQogICAgICAgICAgICYm
ICghc3RyaWN0IHx8IG5faW1wcm9wZXJseV9mb3JtYXR0ZWRfbGluZXMgPT0gMCkpOwogfQogCitz
dGF0aWMgdm9pZAorcHJpbnRfZmlsZW5hbWUgKGNoYXIgKmZpbGUpCit7CisgIHNpemVfdCBpOwor
ICAvKiBUcmFuc2xhdGUgZWFjaCBORVdMSU5FIGJ5dGUgdG8gdGhlIHN0cmluZywgIlxcbiIsCisg
ICAgIGFuZCBlYWNoIGJhY2tzbGFzaCB0byAiXFxcXCIuICAqLworICBmb3IgKGkgPSAwOyBpIDwg
c3RybGVuIChmaWxlKTsgKytpKQorICAgIHsKKyAgICAgIHN3aXRjaCAoZmlsZVtpXSkKKyAgICAg
ICAgeworICAgICAgICBjYXNlICdcbic6CisgICAgICAgICAgZnB1dHMgKCJcXG4iLCBzdGRvdXQp
OworICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGNhc2UgJ1xcJzoKKyAgICAgICAgICBmcHV0
cyAoIlxcXFwiLCBzdGRvdXQpOworICAgICAgICAgIGJyZWFrOworCisgICAgICAgIGRlZmF1bHQ6
CisgICAgICAgICAgcHV0Y2hhciAoZmlsZVtpXSk7CisgICAgICAgICAgYnJlYWs7CisgICAgICAg
IH0KKyAgICB9Cit9CisKIGludAogbWFpbiAoa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AgICAgICAgICAgICAgcHV0Y2hhciAoJyAnKTsKKyAgICAgICAgICAgICAgICAgIGZwdXRz
IChwcmVmaXhlc1tQUkVGSVhfSU5ERVhdLCBzdGRvdXQpOworICAgICAgICAgICAgICAgICAgcHV0
Y2hhciAoJygnKTsKKyAgICAgICAgICAgICAgICAgIHByaW50X2ZpbGVuYW1lIChmaWxlKTsKKyAg
ICAgICAgICAgICAgICAgIGZwdXRzICgiKSA9ICIsIHN0ZG91dCk7CisgICAgICAgICAgICAgICAg
fQorCiAgICAgICAgICAgICAgIHNpemVfdCBpOwogCiAgICAgICAgICAgICAgIC8qIE91dHB1dCBh
IGxlYWRpbmcgYmFja3NsYXNoIGlmIHRoZSBmaWxlIG5hbWUgY29udGFpbnMKICAgICAgICAgICAg
ICAgICAgYSBuZXdsaW5lIG9yIGJhY2tzbGFzaC4gICovCi0gICAgICAgICAgICAgIGlmIChzdHJj
aHIgKGZpbGUsICdcbicpIHx8IHN0cmNociAoZmlsZSwgJ1xcJykpCisgICAgICAgICAgICAgIGlm
ICghcHJlZml4X3RhZyAmJiAoc3RyY2hyIChmaWxlLCAnXG4nKSB8fCBzdHJjaHIgKGZpbGUsICdc
XCcpKSkKICAgICAgICAgICAgICAgICBwdXRjaGFyICgnXFwnKTsKIAogICAgICAgICAgICAgICBm
b3IgKGkgPSAwOyBpIDwgKGRpZ2VzdF9oZXhfYnl0ZXMgLyAyKTsgKytpKQogICAgICAgICAgICAg
ICAgIHByaW50ZiAoIiUwMngiLCBiaW5fYnVmZmVyW2ldKTsKIAotICAgICAgICAgICAgICBwdXRj
aGFyICgnICcpOwotICAgICAgICAgICAgICBpZiAoZmlsZV9pc19iaW5hcnkpCi0gICAgICAgICAg
ICAgICAgcHV0Y2hhciAoJyonKTsKLSAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAg
IHB1dGNoYXIgKCcgJyk7Ci0KLSAgICAgICAgICAgICAgLyogVHJhbnNsYXRlIGVhY2ggTkVXTElO
RSBieXRlIHRvIHRoZSBzdHJpbmcsICJcXG4iLAotICAgICAgICAgICAgICAgICBhbmQgZWFjaCBi
YWNrc2xhc2ggdG8gIlxcXFwiLiAgKi8KLSAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IHN0
cmxlbiAoZmlsZSk7ICsraSkKKyAgICAgICAgICAgICAgaWYgKCFwcmVmaXhfdGFnKQogICAgICAg
ICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgIHN3aXRjaCAoZmlsZVtpXSkKLSAgICAgICAg
ICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBjYXNlICdcbic6Ci0gICAgICAgICAg
ICAgICAgICAgICAgZnB1dHMgKCJcXG4iLCBzdGRvdXQpOwotICAgICAgICAgICAgICAgICAgICAg
IGJyZWFrOwotCi0gICAgICAgICAgICAgICAgICAgIGNhc2UgJ1xcJzoKLSAgICAgICAgICAgICAg
ICAgICAgICBmcHV0cyAoIlxcXFwiLCBzdGRvdXQpOwotICAgICAgICAgICAgICAgICAgICAgIGJy
ZWFrOwotCi0gICAgICAgICAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgICAg
ICAgcHV0Y2hhciAoZmlsZVtpXSk7Ci0gICAgICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAg
ICAgICAgICAgICAgICAgIH0KKyAgICAgICAgICAgICAgICAgIHB1dGNoYXIgKCcgJyk7CisKKyAg
ICAgICAgICAgICAgICAgIGlmIChmaWxlX2lzX2JpbmFyeSkKKyAgICAgICAgICAgICAgICAgICAg
cHV0Y2hhciAoJyonKTsKKyAgICAgICAgICAgICAgICAgIGVsc2UKKyAgICAgICAgICAgICAgICAg
ICAgcHV0Y2hhciAoJyAnKTsKKworICAgICAgICAgICAgICAgICAgcHJpbnRfZmlsZW5hbWUgKGZp
bGUpOwogICAgICAgICAgICAgICAgIH0KKwogICAgICAgICAgICAgICBwdXRjaGFyICgnXG4nKTsK
ICAgICAgICAgICAgIH0KICAgICAgICAgfQo=
------=_Part_1068565_1097199977.1343652163169--


From MAILER-DAEMON Mon Jul 30 09:43:55 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SvqGJ-00017o-8Y
	for mharc-coreutils@gnu.org; Mon, 30 Jul 2012 09:43:55 -0400
Received: from eggs.gnu.org ([208.118.235.92]:43852)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SvqGC-00011R-3f
	for coreutils@gnu.org; Mon, 30 Jul 2012 09:43:54 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SvqGA-0000hm-WD
	for coreutils@gnu.org; Mon, 30 Jul 2012 09:43:47 -0400
Received: from mx.meyering.net ([88.168.87.75]:35180)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SvqGA-0000hb-Lj
	for coreutils@gnu.org; Mon, 30 Jul 2012 09:43:46 -0400
Received: from rho.meyering.net (rho.meyering.net [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id 2C9BD6017B;
	Mon, 30 Jul 2012 15:43:45 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Ondrej Oprala <ooprala@redhat.com>
Subject: Re: RFE: hash-type in sum utils
In-Reply-To: <269107347.1068567.1343652163170.JavaMail.root@redhat.com>
	(Ondrej Oprala's message of "Mon, 30 Jul 2012 08:42:43 -0400 (EDT)")
References: <269107347.1068567.1343652163170.JavaMail.root@redhat.com>
Date: Mon, 30 Jul 2012 15:43:45 +0200
Message-ID: <878ve1tlda.fsf@rho.meyering.net>
Lines: 158
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: 88.168.87.75
Cc: D Yu Bolkhovityanov <D.Yu.Bolkhovityanov@inp.nsk.su>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Mon, 30 Jul 2012 13:43:54 -0000

Ondrej Oprala wrote:
> Alright, I've redone it so now the hashes create and expect GNU escaping
>  in both the BSD and GNU output format.
> I left the --tag format indication of text files to be a space before
> the algo. name
> so far, but I can change that if needed.
...
> +static const char *const prefixes[] =
> +{
> +  "MD5 ",
> +  "SHA1 ",
> +  "SHA256 ",
> +  "SHA224 ",
> +  "SHA512 ",
> +  "SHA384 "
> +};
> +
...
> +                  fputs (prefixes[PREFIX_INDEX], stdout);

It looks like you can remove that "prefixes" array and replace
the sole use with this, no?

                     fputs (DIGEST_TYPE_STRING, stdout);
                     putchar (' ');

> +static bool
> +filename_escape (char *s, int s_len, char **file_name)

s/int/size_t/

> +{
> +      /* Translate each '\n' string in the file name to a NEWLINE,
> +         and each '\\' string to a backslash.  */

Please put the function-describing comment before the function
definition.  It should mention the meaning of the S_LEN
and **FILE_NAME parameters and should explain the meaning of
the return value.

/* Translate each '\n' string in the file name, S, to a NEWLINE,
   and each '\\' string to a backslash. ...  */

Please change the name to e.g. filename_unescape, since it is not
escaping special characters, but performing the reverse operation.
It is unescaping them.

> +  *file_name = s;

I would set this only at the end, just before returning "true".

> +  char *dst = s;
> +  int i = 0;

"i" is always non-negative and indexes a string, so please use size_t
in place of that "int".

> +  while (i < s_len)
> +    {
> +      switch (s[i])
> +        {
> +        case '\\':
> +          if (i == s_len - 1)
> +            {
> +              /* A valid line does not end with a backslash.  */
> +              return false;
> +            }
> +          ++i;
> +          switch (s[i++])
> +            {
> +            case 'n':
> +              *dst++ = '\n';
> +              break;
> +            case '\\':
> +              *dst++ = '\\';
> +              break;
> +            default:
> +              /* Only '\' or 'n' may follow a backslash.  */
> +              return false;
> +            }
> +          break;
> +
> +        case '\0':
> +          /* The file name may not contain a NUL.  */
> +          return false;
> +          break;

The "break" after return may be classified as unreachable,
so please remove it.

> +        default:
> +          *dst++ = s[i++];
> +          break;
> +        }
> +    }
> +  *dst = '\0';
> +  return true;
> +}

> +static void
> +print_filename (char *file)

Please make that parameter const:

    print_filename (char const *file)


> +{
> +  size_t i;
> +  /* Translate each NEWLINE byte to the string, "\\n",
> +     and each backslash to "\\\\".  */

Please use the following instead.
Otherwise, the code traverses FILE twice.
first via strlen, and again via the loop.

     while (*file)
       {
         switch (*file++)

         [and s/file[i]/*file/ in the putchar]

> +  for (i = 0; i < strlen (file); ++i)
> +    {
> +      switch (file[i])
> +        {
> +        case '\n':
> +          fputs ("\\n", stdout);
> +          break;
> +
> +        case '\\':
> +          fputs ("\\\\", stdout);
> +          break;
> +
> +        default:
> +          putchar (file[i]);
> +          break;
> +        }
> +    }
> +}

Once you've done the above, consider adding tests to exercise the change
as well as a NEWS entry.

Finally, please run "make syntax-check".
Among other things, that will ensure that your change does
not add trailing blanks.

+                  if (file_is_binary)
+                    putchar ('*');
+                  else
+                    putchar (' ');

Please replace those four lines with this one:
    putchar (file_is_binary ? '*' : ' ');

you could slightly more concise, but I would not suggest this :-)
    putchar (" *"[!!file_is_binary]);


From MAILER-DAEMON Tue Jul 31 07:04:34 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SwAFe-00040w-0i
	for mharc-coreutils@gnu.org; Tue, 31 Jul 2012 07:04:34 -0400
Received: from eggs.gnu.org ([208.118.235.92]:57724)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ooprala@redhat.com>) id 1SwAFV-0003y6-PR
	for coreutils@gnu.org; Tue, 31 Jul 2012 07:04:32 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <ooprala@redhat.com>) id 1SwAFT-0006Rz-8a
	for coreutils@gnu.org; Tue, 31 Jul 2012 07:04:25 -0400
Received: from mx4-phx2.redhat.com ([209.132.183.25]:54982)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ooprala@redhat.com>) id 1SwAFS-0006Rk-RG
	for coreutils@gnu.org; Tue, 31 Jul 2012 07:04:23 -0400
Received: from zmail19.collab.prod.int.phx2.redhat.com
	(zmail19.collab.prod.int.phx2.redhat.com [10.5.83.22])
	by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q6VB4I2G006132;
	Tue, 31 Jul 2012 07:04:18 -0400
Date: Tue, 31 Jul 2012 07:04:18 -0400 (EDT)
From: Ondrej Oprala <ooprala@redhat.com>
To: Jim Meyering <jim@meyering.net>
Message-ID: <1982314686.1254890.1343732658710.JavaMail.root@redhat.com>
In-Reply-To: <878ve1tlda.fsf@rho.meyering.net>
Subject: Re: RFE: hash-type in sum utils
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1254888_1186124650.1343732658709"
X-Originating-IP: [10.34.4.237]
X-Mailer: Zimbra 7.2.0_GA_2669 (ZimbraWebClient - FF3.0 (Linux)/7.2.0_GA_2669)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 209.132.183.25
Cc: D Yu Bolkhovityanov <D.Yu.Bolkhovityanov@inp.nsk.su>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 31 Jul 2012 11:04:32 -0000

------=_Part_1254888_1186124650.1343732658709
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Ok, I've made all the changes(though I had to change print_filename content=
s around a bit, it wouldn't
print out the file name properly unless the name consisted of '\n' and '\' =
chars only), added a NEWS entry
and a simple test to md5sum-bsd. Syntax-check was also fine with my changes=
.
Cheers,
 Ondrej

----- Original Message -----
From: "Jim Meyering" <jim@meyering.net>
To: "Ondrej Oprala" <ooprala@redhat.com>
Cc: "P=C3=A1draig Brady" <P@draigBrady.com>, "D Yu Bolkhovityanov" <D.Yu.Bo=
lkhovityanov@inp.nsk.su>, coreutils@gnu.org
Sent: Monday, July 30, 2012 3:43:45 PM
Subject: Re: RFE: hash-type in sum utils

Ondrej Oprala wrote:
> Alright, I've redone it so now the hashes create and expect GNU escaping
>  in both the BSD and GNU output format.
> I left the --tag format indication of text files to be a space before
> the algo. name
> so far, but I can change that if needed.
...
> +static const char *const prefixes[] =3D
> +{
> +  "MD5 ",
> +  "SHA1 ",
> +  "SHA256 ",
> +  "SHA224 ",
> +  "SHA512 ",
> +  "SHA384 "
> +};
> +
...
> +                  fputs (prefixes[PREFIX_INDEX], stdout);

It looks like you can remove that "prefixes" array and replace
the sole use with this, no?

                     fputs (DIGEST_TYPE_STRING, stdout);
                     putchar (' ');

> +static bool
> +filename_escape (char *s, int s_len, char **file_name)

s/int/size_t/

> +{
> +      /* Translate each '\n' string in the file name to a NEWLINE,
> +         and each '\\' string to a backslash.  */

Please put the function-describing comment before the function
definition.  It should mention the meaning of the S_LEN
and **FILE_NAME parameters and should explain the meaning of
the return value.

/* Translate each '\n' string in the file name, S, to a NEWLINE,
   and each '\\' string to a backslash. ...  */

Please change the name to e.g. filename_unescape, since it is not
escaping special characters, but performing the reverse operation.
It is unescaping them.

> +  *file_name =3D s;

I would set this only at the end, just before returning "true".

> +  char *dst =3D s;
> +  int i =3D 0;

"i" is always non-negative and indexes a string, so please use size_t
in place of that "int".

> +  while (i < s_len)
> +    {
> +      switch (s[i])
> +        {
> +        case '\\':
> +          if (i =3D=3D s_len - 1)
> +            {
> +              /* A valid line does not end with a backslash.  */
> +              return false;
> +            }
> +          ++i;
> +          switch (s[i++])
> +            {
> +            case 'n':
> +              *dst++ =3D '\n';
> +              break;
> +            case '\\':
> +              *dst++ =3D '\\';
> +              break;
> +            default:
> +              /* Only '\' or 'n' may follow a backslash.  */
> +              return false;
> +            }
> +          break;
> +
> +        case '\0':
> +          /* The file name may not contain a NUL.  */
> +          return false;
> +          break;

The "break" after return may be classified as unreachable,
so please remove it.

> +        default:
> +          *dst++ =3D s[i++];
> +          break;
> +        }
> +    }
> +  *dst =3D '\0';
> +  return true;
> +}

> +static void
> +print_filename (char *file)

Please make that parameter const:

    print_filename (char const *file)


> +{
> +  size_t i;
> +  /* Translate each NEWLINE byte to the string, "\\n",
> +     and each backslash to "\\\\".  */

Please use the following instead.
Otherwise, the code traverses FILE twice.
first via strlen, and again via the loop.

     while (*file)
       {
         switch (*file++)

         [and s/file[i]/*file/ in the putchar]

> +  for (i =3D 0; i < strlen (file); ++i)
> +    {
> +      switch (file[i])
> +        {
> +        case '\n':
> +          fputs ("\\n", stdout);
> +          break;
> +
> +        case '\\':
> +          fputs ("\\\\", stdout);
> +          break;
> +
> +        default:
> +          putchar (file[i]);
> +          break;
> +        }
> +    }
> +}

Once you've done the above, consider adding tests to exercise the change
as well as a NEWS entry.

Finally, please run "make syntax-check".
Among other things, that will ensure that your change does
not add trailing blanks.

+                  if (file_is_binary)
+                    putchar ('*');
+                  else
+                    putchar (' ');

Please replace those four lines with this one:
    putchar (file_is_binary ? '*' : ' ');

you could slightly more concise, but I would not suggest this :-)
    putchar (" *"[!!file_is_binary]);

------=_Part_1254888_1186124650.1343732658709
Content-Type: text/x-patch; name=sum-tags.patch
Content-Disposition: attachment; filename=sum-tags.patch
Content-Transfer-Encoding: base64

ZGlmZiAtdXAgY29yZXV0aWxzLTgu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YykgPT0gJ1x0JykKIAorLyogVHJhbnNsYXRlIGVhY2gg
J1xuJyBzdHJpbmcgaW4gdGhlIGZpbGUgbmFtZSBiZWdpbm5pbmcKKyAgIGF0IHN0cmluZyBTIChv
ZiBsZW5ndGggU19MRU4pICB0byBhIE5FV0xJTkUsCisgICBhbmQgZWFjaCAnXFwnIHN0cmluZyB0
byBhIGJhY2tzbGFzaDsgRklMRV9OQU1FIGJlY29taW5nCisgICB0aGUgcG9pbnRlciB1c2VkIHRv
IHByaW50IHRoZSBhY3R1YWwgZmlsZSBuYW1lLiBSZXR1cm4KKyAgIHRydWUgdW5sZXNzIGZpbGUg
bmFtZSBpcyBpbnZhbGlkLiAgKi8KKworc3RhdGljIGJvb2wgCitmaWxlbmFtZV91bmVzY2FwZSAo
Y2hhciAqcywgc2l6ZV90IHNfbGVuLCBjaGFyICoqZmlsZV9uYW1lKQoreworCisgIGNoYXIgKmRz
dCA9IHM7CisgIHNpemVfdCBpID0gMDsKKworICB3aGlsZSAoaSA8IHNfbGVuKQorICAgIHsKKyAg
ICAgIHN3aXRjaCAoc1tpXSkKKyAgICAgICAgeworICAgICAgICBjYXNlICdcXCc6CisgICAgICAg
ICAgaWYgKGkgPT0gc19sZW4gLSAxKQorICAgICAgICAgICAgeworICAgICAgICAgICAgICAvKiBB
IHZhbGlkIGxpbmUgZG9lcyBub3QgZW5kIHdpdGggYSBiYWNrc2xhc2guICAqLworICAgICAgICAg
ICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgICAgKytpOworICAgICAg
ICAgIHN3aXRjaCAoc1tpKytdKQorICAgICAgICAgICAgeworICAgICAgICAgICAgY2FzZSAnbic6
CisgICAgICAgICAgICAgICpkc3QrKyA9ICdcbic7CisgICAgICAgICAgICAgIGJyZWFrOworICAg
ICAgICAgICAgY2FzZSAnXFwnOgorICAgICAgICAgICAgICAqZHN0KysgPSAnXFwnOworICAgICAg
ICAgICAgICBicmVhazsKKyAgICAgICAgICAgIGRlZmF1bHQ6CisgICAgICAgICAgICAgIC8qIE9u
bHkgJ1wnIG9yICduJyBtYXkgZm9sbG93IGEgYmFja3NsYXNoLiAgKi8KKyAgICAgICAgICAgICAg
cmV0dXJuIGZhbHNlOworICAgICAgICAgICAgfQorICAgICAgICAgIGJyZWFrOworCisgICAgICAg
IGNhc2UgJ1wwJzoKKyAgICAgICAgICAvKiBUaGUgZmlsZSBuYW1lIG1heSBub3QgY29udGFpbiBh
IE5VTC4gICovCisgICAgICAgICAgcmV0dXJuIGZhbHNlOworCisgICAgICAgIGRlZmF1bHQ6Cisg
ICAgICAgICAgKmRzdCsrID0gc1tpKytdOworICAgICAgICAgIGJyZWFrOworICAgICAgICB9Cisg
ICAgfQorICAqZHN0ID0gJ1wwJzsKKworICAqZmlsZV9uYW1lID0gczsKKworICByZXR1cm4gdHJ1
ZTsKK30KKwogLyogU3BsaXQgdGhlIGNoZWNrc3VtIHN0cmluZyBTIChvZiBsZW5ndGggU19MRU4p
IGZyb20gYSBCU0QgJ21kNScgb3IKICAgICdzaGExJyBjb21tYW5kIGludG8gdHdvIHBhcnRzOiBh
IGhleGFkZWNpbWFsIGRpZ2VzdCwgYW5kIHRoZSBmaWxlCiAgICBuYW1lLiAgUyBpcyBtb2RpZmll
ZC4gIFJldHVybiB0cnVlIGlmIHN1Y2Nlc3NmdWwuICAqLwogCiBzdGF0aWMgYm9vbAogYnNkX3Nw
bGl0XzMgKGNoYXIgKnMsIHNpemVfdCBzX2xlbiwgdW5zaWduZWQgY2hhciAqKmhleF9kaWdlc3Qs
Ci0gICAgICAgICAgICAgY2hhciAqKmZpbGVfbmFtZSkKKyAgICAgICAgICAgICBjaGFyICoqZmls
ZV9uYW1lLCBib29sIGVzY2FwZWRfZmlsZW5hbWUpCiB7CiAgIHNpemVfdCBpOwogCiAgIGlmIChz
X2xlbiA9PSAwKQogICAgIHJldHVybiBmYWxzZTsKLQotICAqZmlsZV9uYW1lID0gczsKLQogICAv
KiBGaW5kIGVuZCBv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mlyc3QgZmllbGQgaGFzIHRvIGJlIHRoZSBuLWNoYXJhY3RlciBoZXhhZGVjaW1hbAogICAgICBy
ZXByZXNlbnRhdGlvbiBvZiB0aGUgbWVzc2FnZSBkaWdlc3QuICBJZiBpdCBpcyBub3QgZm9sbG93
ZWQKQEAgLTMzMyw0OSArMzk5LDggQEAgc3BsaXRfMyAoY2hhciAqcywgc2l6ZV90IHNfbGVuLAog
ICAqZmlsZV9uYW1lID0gJnNbaV07CiAKICAgaWYgKGVzY2FwZWRfZmlsZW5hbWUpCi0gICAgewot
ICAgICAgLyogVHJhbnNsYXRlIGVhY2ggJ1xuJyBzdHJpbmcgaW4gdGhlIGZpbGUgbmFtZSB0byBh
IE5FV0xJTkUsCi0gICAgICAgICBhbmQgZWFjaCAnXFwnIHN0cmluZyB0byBhIGJhY2tzbGFzaC4g
ICovCi0KLSAgICAgIGNoYXIgKmRzdCA9ICZzW2ldOwotCi0gICAgICB3aGlsZSAoaSA8IHNfbGVu
KQotICAgICAgICB7Ci0gICAgICAgICAgc3dpdGNoIChzW2ldKQotICAgICAgICAgICAgewotICAg
ICAgICAgICAgY2FzZSAnXFwnOgotICAgICAgICAgICAgICBpZiAoaSA9PSBzX2xlbiAtIDEpCi0g
ICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgLyogQSB2YWxpZCBsaW5lIGRvZXMg
bm90IGVuZCB3aXRoIGEgYmFja3NsYXNoLiAgKi8KLSAgICAgICAgICAgICAgICAgIHJldHVybiBm
YWxzZTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICsraTsKLSAgICAgICAgICAg
ICAgc3dpdGNoIChzW2krK10pCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGNh
c2UgJ24nOgotICAgICAgICAgICAgICAgICAgKmRzdCsrID0gJ1xuJzsKLSAgICAgICAgICAgICAg
ICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGNhc2UgJ1xcJzoKLSAgICAgICAgICAgICAgICAg
ICpkc3QrKyA9ICdcXCc7Ci0gICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAg
ICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgLyogT25seSAnXCcgb3IgJ24nIG1heSBmb2xs
b3cgYSBiYWNrc2xhc2guICAqLwotICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAg
ICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgICAgIGNhc2Ug
J1wwJzoKLSAgICAgICAgICAgICAgLyogVGhlIGZpbGUgbmFtZSBtYXkgbm90IGNvbnRhaW4gYSBO
VUwuICAqLwotICAgICAgICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICAgIGJyZWFr
OworICAgIHJldHVybiBmaWxlbmFtZV91bmVzY2FwZSAoJnNbaV0sIHNfbGVuIC0gaSwgZmlsZV9u
YW1lKTsKIAotICAgICAgICAgICAgZGVmYXVsdDoKLSAgICAgICAgICAgICAgKmRzdCsrID0gc1tp
KytdOwotICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQotICAg
ICAgKmRzdCA9ICdcMCc7Ci0gICAgfQogICByZXR1cm4gdHJ1ZTsKIH0KIApAQCAtNjM2LDYgKzY2
MSwzMSBAQCBkaWdlc3RfY2hlY2sgKGNvbnN0IGNoYXIgKmNoZWNrZmlsZV9uYW1lCiAgICAgICAg
ICAgJiYgKCFzdHJpY3QgfHwgbl9pbXByb3Blcmx5X2Zvcm1hdHRlZF9saW5lcyA9PSAwKSk7CiB9
CiAKK3N0YXRpYyB2b2lkCitwcmludF9maWxlbmFtZSAoY2hhciBjb25zdCAqZmlsZSkKK3sKKyAg
LyogVHJhbnNsYXRlIGVhY2ggTkVXTElORSBieXRlIHRvIHRoZSBzdHJpbmcsICJcXG4iLAorICAg
ICBhbmQgZWFjaCBiYWNrc2xhc2ggdG8gIlxcXFwiLiAgKi8KKyAgd2hpbGUgKCpmaWxlKQorICAg
IHsKKyAgICAgIHN3aXRjaCAoKmZpbGUpCisgICAgICAgIHsKKyAgICAgICAgY2FzZSAnXG4nOgor
ICAgICAgICAgIGZwdXRzICgiXFxuIiwgc3Rkb3V0KTsKKyAgICAgICAgICBicmVhazsKKworICAg
ICAgICBjYXNlICdcXCc6CisgICAgICAgICAgZnB1dHMgKCJcXFxcIiwgc3Rkb3V0KTsKKyAgICAg
ICAgICBicmVhazsKKworICAgICAgICBkZWZhdWx0OgorICAgICAgICAgIHB1dGNoYXIgKCpmaWxl
KTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAgfQorICAgICAgZmlsZSsrOworICAgIH0KK30K
KwogaW50CiBtYWluIChpbnQgYXJnYywgY2hhciAqKmFyZ3YpCiB7CkBAIC02NDYsNiArNjk2LDcg
QEAgbWFpbiAoaW50IGFyZ2MsIGNoYXIgKiphcmd2KQogICBpbnQgb3B0OwogICBib29sIG9rID0g
dHJ1ZTsKICAgaW50IGJpbmFyeSA9IC0xOworICBib29sIHByZWZpeF90YWcgPSBmYWxzZTsKIAog
ICAvKiBTZXR0aW5nIHZhbHVlcyBvZiBnbG9iYWwgdmFyaWFibGVzLiAgKi8KICAgaW5pdGlhbGl6
ZV9tYWluICgmYXJnYywgJmFyZ3YpOwpAQCAtNjkwLDYgKzc0MSw5IEBAIG1haW4gKGludCBhcmdj
LCBjaGFyICoqYXJndikKICAgICAgIGNhc2UgU1RSSUNUX09QVElPTjoKICAgICAgICAgc3RyaWN0
ID0gdHJ1ZTsKICAgICAgICAgYnJlYWs7CisgICAgICBjYXNlIFRBR19PUFRJT046CisgICAgICAg
IHByZWZpeF90YWcgPSB0cnVlOworICAgICAgICBicmVhazsKICAgICAgIGNhc2VfR0VUT1BUX0hF
TFBfQ0hBUjsKICAgICAgIGNhc2VfR0VUT1BUX1ZFUlNJT05fQ0hBUiAoUFJPR1JBTV9OQU1FLCBB
VVRIT1JTKTsKICAgICAgIGRlZmF1bHQ6CkBAIC03NTQsNDEgKzgwOCwzNyBAQCBtYWluIChpbnQg
YXJnYywgY2hhciAqKmFyZ3YpCiAgICAgICAgICAgICBvayA9IGZhbHNlOwogICAgICAgICAgIGVs
c2UKICAgICAgICAgICAgIHsKKyAgICAgICAgICAgICAgaWYgKHByZWZpeF90YWcpCisgICAgICAg
ICAgICAgICAgeworICAgICAgICAgICAgICAgICAgaWYgKHN0cmNociAoZmlsZSwgJ1xuJykgfHwg
c3RyY2hyIChmaWxlLCAnXFwnKSkKKyAgICAgICAgICAgICAgICAgICAgcHV0Y2hhciAoJ1xcJyk7
CisgICAgICAgICAgICAgICAgICBpZiAoIWZpbGVfaXNfYmluYXJ5KQorICAgICAgICAgICAgICAg
ICAgICBwdXRjaGFyICgnICcpOworICAgICAgICAgICAgICAgICAgZnB1dHMgKERJR0VTVF9UWVBF
X1NUUklORywgc3Rkb3V0KTsKKyAgICAgICAgICAgICAgICAgIGZwdXRzKCIgKCIsIHN0ZG91dCk7
CisgICAgICAgICAgICAgICAgICBwcmludF9maWxlbmFtZSAoZmlsZSk7CisgICAgICAgICAgICAg
ICAgICBmcHV0cyAoIikgPSAiLCBzdGRvdXQpOworICAgICAgICAgICAgICAgIH0KKwogICAgICAg
ICAgICAgICBzaXplX3QgaTsKIAogICAgICAgICAgICAgICAvKiBPdXRwdXQgYSBsZWFkaW5nIGJh
Y2tzbGFzaCBpZiB0aGUgZmlsZSBuYW1lIGNvbnRhaW5zCiAgICAgICAgICAgICAgICAgIGEgbmV3
bGluZSBvciBiYWNrc2xhc2guICAqLwotICAgICAgICAgICAgICBpZiAoc3RyY2hyIChmaWxlLCAn
XG4nKSB8fCBzdHJjaHIgKGZpbGUsICdcXCcpKQorICAgICAgICAgICAgICBpZiAoIXByZWZpeF90
YWcgJiYgKHN0cmNociAoZmlsZSwgJ1xuJykgfHwgc3RyY2hyIChmaWxlLCAnXFwnKSkpCiAgICAg
ICAgICAgICAgICAgcHV0Y2hhciAoJ1xcJyk7CiAKICAgICAgICAgICAgICAgZm9yIChpID0gMDsg
aSA8IChkaWdlc3RfaGV4X2J5dGVzIC8gMik7ICsraSkKICAgICAgICAgICAgICAgICBwcmludGYg
KCIlMDJ4IiwgYmluX2J1ZmZlcltpXSk7CiAKLSAgICAgICAgICAgICAgcHV0Y2hhciAoJyAnKTsK
LSAgICAgICAgICAgICAgaWYgKGZpbGVfaXNfYmluYXJ5KQotICAgICAgICAgICAgICAgIHB1dGNo
YXIgKCcqJyk7Ci0gICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICBwdXRjaGFyICgn
ICcpOwotCi0gICAgICAgICAgICAgIC8qIFRyYW5zbGF0ZSBlYWNoIE5FV0xJTkUgYnl0ZSB0byB0
aGUgc3RyaW5nLCAiXFxuIiwKLSAgICAgICAgICAgICAgICAgYW5kIGVhY2ggYmFja3NsYXNoIHRv
ICJcXFxcIi4gICovCi0gICAgICAgICAgICAgIGZvciAoaSA9IDA7IGkgPCBzdHJsZW4gKGZpbGUp
OyArK2kpCisgICAgICAgICAgICAgIGlmICghcHJlZml4X3RhZykKICAgICAgICAgICAgICAgICB7
Ci0gICAgICAgICAgICAgICAgICBzd2l0Y2ggKGZpbGVbaV0pCi0gICAgICAgICAgICAgICAgICAg
IHsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSAnXG4nOgotICAgICAgICAgICAgICAgICAgICAg
IGZwdXRzICgiXFxuIiwgc3Rkb3V0KTsKLSAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLQot
ICAgICAgICAgICAgICAgICAgICBjYXNlICdcXCc6Ci0gICAgICAgICAgICAgICAgICAgICAgZnB1
dHMgKCJcXFxcIiwgc3Rkb3V0KTsKLSAgICAgICAgICAgICAgICAgICAgICBicmVhazsKLQotICAg
ICAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAgICAgICAgICAgICAgICAgICAgIHB1dGNoYXIg
KGZpbGVbaV0pOwotICAgICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAg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1jIGNoZWNrLm1kNXN1bSB8fCBmYWlsPTEKK21kNXN1bSAtLXN0cmljdCAtYyBjaGVj
ay5tZDUgfHwgZmFpbD0xCisKIEV4aXQgJGZhaWwK
------=_Part_1254888_1186124650.1343732658709--


From MAILER-DAEMON Tue Jul 31 07:15:39 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SwAQN-00064d-A5
	for mharc-coreutils@gnu.org; Tue, 31 Jul 2012 07:15:39 -0400
Received: from eggs.gnu.org ([208.118.235.92]:43691)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SwAQG-00063p-HK
	for coreutils@gnu.org; Tue, 31 Jul 2012 07:15:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SwAQA-0001WV-KP
	for coreutils@gnu.org; Tue, 31 Jul 2012 07:15:32 -0400
Received: from mx.meyering.net ([88.168.87.75]:38511)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1SwAQA-0001WP-E3
	for coreutils@gnu.org; Tue, 31 Jul 2012 07:15:26 -0400
Received: from rho.meyering.net (rho.meyering.net [127.0.0.1])
	by rho.meyering.net (Acme Bit-Twister) with ESMTP id AC21D6012A;
	Tue, 31 Jul 2012 13:15:25 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Ondrej Oprala <ooprala@redhat.com>
Subject: Re: RFE: hash-type in sum utils
In-Reply-To: <1982314686.1254890.1343732658710.JavaMail.root@redhat.com>
	(Ondrej Oprala's message of "Tue, 31 Jul 2012 07:04:18 -0400 (EDT)")
References: <1982314686.1254890.1343732658710.JavaMail.root@redhat.com>
Date: Tue, 31 Jul 2012 13:15:25 +0200
Message-ID: <878ve0yyeq.fsf@rho.meyering.net>
Lines: 12
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: 88.168.87.75
Cc: D Yu Bolkhovityanov <D.Yu.Bolkhovityanov@inp.nsk.su>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 31 Jul 2012 11:15:38 -0000

Ondrej Oprala wrote:
> Ok, I've made all the changes(though I had to change print_filename
> contents around a bit, it wouldn't
> print out the file name properly unless the name consisted of '\n' and
> \' chars only), added a NEWS entry
> and a simple test to md5sum-bsd. Syntax-check was also fine with my changes.

Thanks.  Sounds like it's almost there.  Glancing through
the new diffs, I see that your NEWS addition was not included.

Please create a git commit and send "git format-patch" output,
following the guidelines in HACKING.


From MAILER-DAEMON Tue Jul 31 08:13:11 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SwBK3-0006qH-9e
	for mharc-coreutils@gnu.org; Tue, 31 Jul 2012 08:13:11 -0400
Received: from eggs.gnu.org ([208.118.235.92]:41834)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ooprala@redhat.com>) id 1SwBJy-0006o6-7w
	for coreutils@gnu.org; Tue, 31 Jul 2012 08:13:10 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <ooprala@redhat.com>) id 1SwBJq-00046c-7h
	for coreutils@gnu.org; Tue, 31 Jul 2012 08:13:06 -0400
Received: from mx4-phx2.redhat.com ([209.132.183.25]:57171)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <ooprala@redhat.com>) id 1SwBJp-00046R-Qi
	for coreutils@gnu.org; Tue, 31 Jul 2012 08:12:58 -0400
Received: from zmail19.collab.prod.int.phx2.redhat.com
	(zmail19.collab.prod.int.phx2.redhat.com [10.5.83.22])
	by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q6VCCr2r018508;
	Tue, 31 Jul 2012 08:12:53 -0400
Date: Tue, 31 Jul 2012 08:12:53 -0400 (EDT)
From: Ondrej Oprala <ooprala@redhat.com>
To: Jim Meyering <jim@meyering.net>
Message-ID: <338213340.1265439.1343736773521.JavaMail.root@redhat.com>
In-Reply-To: <878ve0yyeq.fsf@rho.meyering.net>
Subject: Re: RFE: hash-type in sum utils
MIME-Version: 1.0
Content-Type: multipart/mixed; 
	boundary="----=_Part_1265437_1558677883.1343736773519"
X-Originating-IP: [10.34.4.237]
X-Mailer: Zimbra 7.2.0_GA_2669 (ZimbraWebClient - FF3.0 (Linux)/7.2.0_GA_2669)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 209.132.183.25
Cc: D Yu Bolkhovityanov <D.Yu.Bolkhovityanov@inp.nsk.su>, coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 31 Jul 2012 12:13:10 -0000

------=_Part_1265437_1558677883.1343736773519
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

Here's the patch.
Cheers.
 Ondrej

----- Original Message -----
From: "Jim Meyering" <jim@meyering.net>
To: "Ondrej Oprala" <ooprala@redhat.com>
Cc: "P=C3=A1draig Brady" <P@draigBrady.com>, "D Yu Bolkhovityanov" <D.Yu.Bo=
lkhovityanov@inp.nsk.su>, coreutils@gnu.org
Sent: Tuesday, July 31, 2012 1:15:25 PM
Subject: Re: RFE: hash-type in sum utils

Ondrej Oprala wrote:
> Ok, I've made all the changes(though I had to change print_filename
> contents around a bit, it wouldn't
> print out the file name properly unless the name consisted of '\n' and
> \' chars only), added a NEWS entry
> and a simple test to md5sum-bsd. Syntax-check was also fine with my chang=
es.

Thanks.  Sounds like it's almost there.  Glancing through
the new diffs, I see that your NEWS addition was not included.

Please create a git commit and send "git format-patch" output,
following the guidelines in HACKING.

------=_Part_1265437_1558677883.1343736773519
Content-Type: application/mbox; name=DIFF
Content-Disposition: attachment; filename=DIFF
Content-Transfer-Encoding: base64

RnJvbSBjMzNkNjllZjc2ZjY2NDExMDA2ZjM2YWJiMmYzYTMwOWRkZWM3Yzg2IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBPbmRyZWogT3ByYWxhIDxvb3ByYWxhQHJlZGhhdC5jb20+CkRh
dGU6IFR1ZSwgMzEgSnVsIDIwMTIgMTM6NTc6NDggKzAyMDAKU3ViamVjdDogW1BBVENIXSBUaGUg
cGF0Y2ggYWRkcyB0aGUgLS10YWcgb3B0aW9uIHRvICpzdW0gdXRpbHMgZm9yIEJTRC1saWtlCiBv
dXRwdXQKCi0tLQogTkVXUyAgICAgICAgICAgICAgICAgIHwgIDcwICstLS0tLS0tLS0tLS0tLS0t
CiBzcmMvbWQ1c3VtLmMgICAgICAgICAgfCAyMDYgKysrKysrKysrKysrKysrKysrKysrKysrKysr
KysrKy0tLS0tLS0tLS0tLS0tLS0tLS0KIHRlc3RzL21pc2MvbWQ1c3VtLWJzZCB8ICAxMSArKysK
IDMgZmlsZXMgY2hhbmdlZCwgMTQzIGluc2VydGlvbnMoKyksIDE0NCBkZWxldGlvbnMoLSkKCmRp
ZmYgLS1naXQgYS9ORVdTIGIvT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1
c2VkIHRvIHByaW50IHRoZSBhY3R1YWwgZmlsZSBuYW1lLiBSZXR1cm4KKyAgIHRydWUgdW5sZXNz
IGZpbGUgbmFtZSBpcyBpbnZhbGlkLiAgKi8KKworc3RhdGljIGJvb2wKK2ZpbGVuYW1lX3VuZXNj
YXBlIChjaGFyICpzLCBzaXplX3Qgc19sZW4sIGNoYXIgKipmaWxlX25hbWUpCit7CisKKyAgY2hh
ciAqZHN0ID0gczsKKyAgc2l6ZV90IGkgPSAwOworCisgIHdoaWxlIChpIDwgc19sZW4pCisgICAg
eworICAgICAgc3dpdGNoIChzW2ldKQorICAgICAgICB7CisgICAgICAgIGNhc2UgJ1xcJzoKKyAg
ICAgICAgICBpZiAoaSA9PSBzX2xlbiAtIDEpCisgICAgICAgICAgICB7CisgICAgICAgICAgICAg
IC8qIEEgdmFsaWQgbGluZSBkb2VzIG5vdCBlbmQgd2l0aCBhIGJhY2tzbGFzaC4gICovCisgICAg
ICAgICAgICAgIHJldHVybiBmYWxzZTsKKyAgICAgICAgICAgIH0KKyAgICAgICAgICArK2k7Cisg
ICAgICAgICAgc3dpdGNoIChzW2krK10pCisgICAgICAgICAgICB7CisgICAgICAgICAgICBjYXNl
ICduJzoKKyAgICAgICAgICAgICAgKmRzdCsrID0gJ1xuJzsKKyAgICAgICAgICAgICAgYnJlYWs7
CisgICAgICAgICAgICBjYXNlICdcXCc6CisgICAgICAgICAgICAgICpkc3QrKyA9ICdcXCc7Cisg
ICAgICAgICAgICAgIGJyZWFrOworICAgICAgICAgICAgZGVmYXVsdDoKKyAgICAgICAgICAgICAg
LyogT25seSAnXCcgb3IgJ24nIG1heSBmb2xsb3cgYSBiYWNrc2xhc2guICAqLworICAgICAgICAg
ICAgICByZXR1cm4gZmFsc2U7CisgICAgICAgICAgICB9CisgICAgICAgICAgYnJlYWs7CisKKyAg
ICAgICAgY2FzZSAnXDAnOgorICAgICAgICAgIC8qIFRoZSBmaWxlIG5hbWUgbWF5IG5vdCBjb250
YWluIG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gKnMsIHNpemVfdCBzX2xlbiwgdW5zaWduZWQgY2hhciAqKmhl
eF9kaWdlc3QsCiAgIGlmIChzW2ldICE9ICcpJykKICAgICByZXR1cm4gZmFsc2U7CiAKKyAgKmZp
bGVfbmFtZSA9IHM7CisKKyAgaWYgKGVzY2FwZWRfZmlsZW5hbWUpCisgICAgaWYgKCFmaWxlbmFt
ZV91bmVzY2FwZSAocywgaSwgZmlsZV9uYW1lKSkKKyAgICAgIHJldHVybiBmYWxzZTsKKwogICBz
W2krK10gPSAnXDAnOwogCiAgIHdoaWxlIChJU1dISVRFIChzW2ldKSkKQEAgLTI3MSw3ICszMzAs
MTYgQEAgc3BsaXRfMyAoY2hhciAqcywgc2l6ZV90IHNfbGVuLAogICB3aGlsZSAoSVNXSElURSAo
c1tpXSkpCiAgICAgKytpOwogCisgIGlmIChzW2ldID09ICdcXCcpCisgICAgeworICAgICAgKytp
OworICAgICAgZXNjYXBlZF9maWxlbmFtZSA9IHRydWU7CisgICAgfQorCiAgIC8qIENoZWNrIGZv
ciBCU0Qtc3R5bGUgY2hlY2tzdW0gbGluZS4gKi8KKyAgaWYgKHNbaV0gPT0gJyAnKQorICAgICsr
aTsKKwogICBhbGdvX25hbWVfbGVuID0gc3RybGVuIChESUdFU1RfVFlQRV9TVFJJTkcpOwogICBp
ZiAoU1RSRVFfTEVOIChzICsgaSwgRElHRVNUX1RZUEVfU1RSSU5HLCBhbGdvX25hbWVfbGVuKSkK
ICAgICB7CkBAIC0yODIsOSArMzUwLDEyIEBAIHNwbGl0XzMgKGNoYXIgKnMsIHNpemVfdCBzX2xl
biwKICAgICAgICAgICAqYmluYXJ5ID0gMDsKICAgICAgICAgICByZXR1cm4gYnNkX3NwbGl0XzMg
KHMgKyAgICAgIGkgKyBhbGdvX25hbWVfbGVuICsgMSwKICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgIHNfbGVuIC0gKGkgKyBhbGdvX25hbWVfbGVuICsgMSksCi0gICAgICAgICAgICAgICAg
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BzaXplX3Qgc19sZW4sCiAgICpmaWxlX25hbWUgPSAmc1tpXTsKIAogICBpZiAo
ZXNjYXBlZF9maWxlbmFtZSkKLSAgICB7Ci0gICAgICAvKiBUcmFuc2xhdGUgZWFjaCAnXG4nIHN0
cmluZyBpbiB0aGUgZmlsZSBuYW1lIHRvIGEgTkVXTElORSwKLSAgICAgICAgIGFuZCBlYWNoICdc
XCcgc3RyaW5nIHRvIGEgYmFja3NsYXNoLiAgKi8KLQotICAgICAgY2hhciAqZHN0ID0gJnNbaV07
Ci0KLSAgICAgIHdoaWxlIChpIDwgc19sZW4pCi0gICAgICAgIHsKLSAgICAgICAgICBzd2l0Y2gg
KHNbaV0pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICBjYXNlICdcXCc6Ci0gICAgICAgICAg
ICAgIGlmIChpID09IHNfbGVuIC0gMSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAg
ICAgICAvKiBBIHZhbGlkIGxpbmUgZG9lcyBub3QgZW5kIHdpdGggYSBiYWNrc2xhc2guICAqLwot
ICAgICAgICAgICAgICAgICAgcmV0dXJuIGZhbHNlOwotICAgICAgICAgICAgICAgIH0KLSAgICAg
ICAgICAgICAgKytpOwotICAgICAgICAgICAgICBzd2l0Y2ggKHNbaSsrXSkKLSAgICAgICAgICAg
ICAgICB7Ci0gICAgICAgICAgICAgICAgY2FzZSAnbic6Ci0gICAgICAgICAgICAgICAgICAqZHN0
KysgPSAnXG4nOwotICAgICAgICAgICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgICAgICAgY2Fz
ZSAnXFwnOgotICAgICAgICAgICAgICAgICAgKmRzdCsrID0gJ1xcJzsKLSAgICAgICAgICAgICAg
ICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAgICAgICAgICAv
KiBPbmx5ICdcJyBvciAnbicgbWF5IGZvbGxvdyBhIGJhY2tzbGFzaC4gICovCi0gICAgICAgICAg
ICAgICAgICByZXR1cm4gZmFsc2U7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICBi
cmVhazsKLQotICAgICAgICAgICAgY2FzZSAnXDAnOgotICAgICAgICAgICAgICAvKiBUaGUgZmls
ZSBuYW1lIG1heSBub3QgY29udGFpbiBhIE5VTC4gICovCi0gICAgICAgICAgICAgIHJldHVybiBm
YWxzZTsKLSAgICAgICAgICAgICAgYnJlYWs7CisgICAgcmV0dXJuIGZpbGVuYW1lX3VuZXNjYXBl
ICgmc1tpXSwgc19sZW4gLSBpLCBmaWxlX25hbWUpOwogCi0gICAgICAgICAgICBkZWZhdWx0Ogot
ICAgICAgICAgICAgICAqZHN0KysgPSBzW2krK107Ci0gICAgICAgICAgICAgIGJyZWFrOwotICAg
ICAgICAgICAgfQotICAgICAgICB9Ci0gICAgICAqZHN0ID0gJ1wwJzsKLSAgICB9CiAgIHJldHVy
biB0cnVlOwogfQogCkBAIC02MzYsNiArNjYxLDMxIEBAIGRpZ2VzdF9jaGVjayAoY29uc3QgY2hh
ciAqY2hlY2tmaWxlX25hbWUpCiAgICAgICAgICAgJiYgKCFzdHJpY3QgfHwgbl9pbXByb3Blcmx5
X2Zvcm1hdHRlZF9saW5lcyA9PSAwKSk7CiB9CiAKK3N0YXRpYyB2b2lkCitwcmludF9maWxlbmFt
ZSAoY2hhciBjb25zdCAqZmlsZSkKK3sKKyAgLyogVHJhbnNsYXRlIGVhY2ggTkVXTElORSBieXRl
IHRvIHRoZSBzdHJpbmcsICJcXG4iLAorICAgICBhbmQgZWFjaCBiYWNrc2xhc2ggdG8gIlxcXFwi
LiAgKi8KKyAgd2hpbGUgKCpmaWxlKQorICAgIHsKKyAgICAgIHN3aXRjaCAoKmZpbGUpCisgICAg
ICAgIHsKKyAgICAgICAgY2FzZSAnXG4nOgorICAgICAgICAgIGZwdXRzICgiXFxuIiwgc3Rkb3V0
KTsKKyAgICAgICAgICBicmVhazsKKworICAgICAgICBjYXNlICdcXCc6CisgICAgICAgICAgZnB1
dHMgKCJcXFxcIiwgc3Rkb3V0KTsKKyAgICAgICAgICBicmVhazsKKworICAgICAgICBkZWZhdWx0
OgorICAgICAgICAgIHB1dGNoYXIgKCpmaWxlKTsKKyAgICAgICAgICBicmVhazsKKyAgICAgICAg
fQorICAgICAgZmlsZSsrOworICAgIH0KK30KKwogaW50CiBtYWluIChpbnQgYXJnYywgY2hhciAq
KmFyZ3YpCiB7CkBAIC02NDYsNiArNjk2LDcgQEAgbWFpbiAoaW50IGFyZ2MsIGNoYXIgKiphcmd2
KQogICBpbnQgb3B0OwogICBib29sIG9rID0gdHJ1ZTsKICAgaW50IGJpbmFyeSA9IC0xOworICBi
b29sIHByZWZpeF90YWcgPSBmYWxzZTsKIAogICAvKiBTZXR0aW5nIHZhbHVlcyBvZiBnbG9iYWwg
dmFyaWFibGVzLiAgKi8KICAgaW5pdGlhbGl6ZV9tYWluICgmYXJnYywgJmFyZ3YpOwpAQCAtNjkw
LDYgKzc0MSw5IEBAIG1haW4gKGludCBhcmdjLCBjaGFyICoqYXJndikKICAgICAgIGNhc2UgU1RS
SUNUX09QVElPTjoKICAgICAgICAgc3RyaWN0ID0gdHJ1ZTsKICAgICAgICAgYnJlYWs7CisgICAg
ICBjYXNlIFRBR19PUFRJT046CisgICAgICAgIHByZWZpeF90YWcgPSB0cnVlOworICAgICAgICBi
cmVhazsKICAgICAgIGNhc2VfR0VUT1BUX0hFTFBfQ0hBUjsKICAgICAgIGNhc2VfR0VUT1BUX1ZF
UlNJT05fQ0hBUiAoUFJPR1JBTV9OQU1FLCBBVVRIT1JTKTsKICAgICAgIGRlZmF1bHQ6CkBAIC03
NTQsNDEgKzgwOCwzNyBAQCBtYWluIChpbnQgYXJnYywgY2hhciAqKmFyZ3YpCiAgICAgICAgICAg
ICBvayA9IGZhbHNlOwogICAgICAgICAgIGVsc2UKICAgICAgICAgICAgIHsKKyAgICAgICAgICAg
ICAgaWYgKHByZWZpeF90YWcpCisgICAgICAgICAgICAgICAgeworICAgICAgICAgICAgICAgICAg
aWYgKHN0cmNociAoZmlsZSwgJ1xuJykgfHwgc3RyY2hyIChmaWxlLCAnXFwnKSkKKyAgICAgICAg
ICAgICAgICAgICAgcHV0Y2hhciAoJ1xcJyk7CisgICAgICAgICAgICAgICAgICBpZiAoIWZpbGVf
aXNfYmluYXJ5KQorICAgICAgICAgICAgICAgICAgICBwdXRjaGFyICgnICcpOworICAgICAgICAg
ICAgICAgICAgZnB1dHMgKERJR0VTVF9UWVBFX1NUUklORywgc3Rkb3V0KTsKKyAgICAgICAgICAg
ICAgICAgIGZwdXRzKCIgKCIsIHN0ZG91dCk7CisgICAgICAgICAgICAgICAgICBwcmludF9maWxl
bmFtZSAoZmlsZSk7CisgICAgICAgICAgICAgICAgICBmcHV0cyAoIikgPSAiLCBzdGRvdXQpOwor
ICAgICAgICAgICAgICAgIH0KKwogICAgICAgICAgICAgICBzaXplX3QgaTsKIAogICAgICAgICAg
ICAgICAvKiBPdXRwdXQgYSBsZWFkaW5nIGJhY2tzbGFzaCBpZiB0aGUgZmlsZSBuYW1lIGNvbnRh
aW5zCiAgICAgICAgICAgICAgICAgIGEgbmV3bGluZSBvciBiYWNrc2xhc2guICAqLwotICAgICAg
ICAgICAgICBpZiAoc3RyY2hyIChmaWxlLCAnXG4nKSB8fCBzdHJjaHIgKGZpbGUsICdcXCcpKQor
ICAgICAgICAgICAgICBpZiAoIXByZWZpeF90YWcgJiYgKHN0cmNociAoZmlsZSwgJ1xuJykgfHwg
c3RyY2hyIChmaWxlLCAnXFwnKSkpCiAgICAgICAgICAgICAgICAgcHV0Y2hhciAoJ1xcJyk7CiAK
ICAgICAgICAgICAgICAgZm9yIChpID0gMDsgaSA8IChkaWdlc3RfaGV4X2J5dGVzIC8gMik7ICsr
aSkKICAgICAgICAgICAgICAgICBwcmludGYgKCIlMDJ4IiwgYmluX2J1ZmZlcltpXSk7CiAKLSAg
ICAgICAgICAgICAgcHV0Y2hhciAoJyAnKTsKLSAgICAgICAgICAgICAgaWYgKGZpbGVfaXNfYmlu
YXJ5KQotICAgICAgICAgICAgICAgIHB1dGNoYXIgKCcqJyk7Ci0gICAgICAgICAgICAgIGVsc2UK
LSAgICAgICAgICAgICAgICBwdXRjaGFyICgnICcpOwotCi0gICAgICAgICAgICAgIC8qIFRyYW5z
bGF0ZSBlYWNoIE5FV0xJTkUgYnl0ZSB0byB0aGUgc3RyaW5nLCAiXFxuIiwKLSAgICAgICAgICAg
ICAgICAgYW5kIGVhY2ggYmFja3NsYXNoIHRvICJcXFxcIi4gICovCi0gICAgICAgICAgICAgIGZv
ciAoaSA9IDA7IGkgPCBzdHJsZW4gKGZpbGUpOyArK2kpCisgICAgICAgICAgICAgIGlmICghcHJl
Zml4X3RhZykKICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICBzd2l0Y2ggKGZp
bGVbaV0pCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgY2FzZSAn
XG4nOgotICAgICAgICAgICAgICAgICAgICAgIGZwdXRzICgiXFxuIiwgc3Rkb3V0KTsKLSAgICAg
ICAgICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgICAgICBjYXNlICdcXCc6
Ci0gICAgICAgICAgICAgICAgICAgICAgZnB1dHMgKCJcXFxcIiwgc3Rkb3V0KTsKLSAgICAgICAg
ICAgICAgICAgICAgICBicmVhazsKLQotICAgICAgICAgICAgICAgICAgICBkZWZhdWx0OgotICAg
ICAgICAgICAgICAgICAgICAgIHB1dGNoYXIgKGZpbGVbaV0pOwotICAgICAgICAgICAgICAgICAg
ICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9CisgICAgICAgICAgICAgICAgICBwdXRj
aGFyICgnICcpOworCisgICAgICAgICAgICAgICAgICBwdXRjaGFyIChmaWxlX2lzX2JpbmFyeSA/
ICcqJyA6ICcgJyk7CisKKyAgICAgICAgICAgICAgICAgIHByaW50X2ZpbGVuYW1lIChmaWxlKTsK
ICAgICAgICAgICAgICAgICB9CisKICAgICAgICAgICAgICAgcHV0Y2hhciAoJ1xuJyk7CiAgICAg
ICAgICAgICB9CiAgICAgICAgIH0KZGlmZiAtLWdpdCBhL3Rlc3RzL21pc2MvbWQ1c3VtLWJzZCBi
L3Rlc3RzL21pc2MvbWQ1c3VtLWJzZAppbmRleCA4MjI2ZDdhLi42NDk3OTMzIDEwMDc1NQotLS0g
YS90ZXN0cy9taXNjL21kNXN1bS1ic2QKKysrIGIvdGVzdHMvbWlzYy9tZDVzdW0tYnNkCkBAIC0z
OCw0ICszOCwxNSBAQCBtZDVzdW0gLS1zdHJpY3QgLWMgY2hlY2subWQ1IHx8IGZhaWw9MQogIyBh
biBvcHRpb24gdG8gYXZvaWQgdGhlIGFtYmlndWl0eS4KIHRhaWwgLW4rMiBjaGVjay5tZDUgfCBt
ZDVzdW0gLS1zdHJpY3QgLWMgJiYgZmFpbD0xCiAKKyMtLXRhZyBvcHRpb24gdGVzdAorCitmb3Ig
aSBpbiAnYScgJyBiJyAnKmMnICdkZCcgJyAnOyBkbworICBlY2hvICIkaSIgPiAiJGkiCisgIG1k
NXN1bSAtLXRhZyAiJGkiID4+IGNoZWNrLm1kNXN1bQorZG9uZQorc2VkICdzLyAgLyAvJyBjaGVj
ay5tZDVzdW0gPiBjaGVjay5tZDUKKworbWQ1c3VtIC0tc3RyaWN0IC1jIGNoZWNrLm1kNXN1bSB8
fCBmYWlsPTEKK21kNXN1bSAtLXN0cmljdCAtYyBjaGVjay5tZDUgfHwgZmFpbD0xCisKIEV4aXQg
JGZhaWwKLS0gCjEuNy4xMS4yCgo=
------=_Part_1265437_1558677883.1343736773519--


From MAILER-DAEMON Tue Jul 31 09:17:16 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SwCK4-0008Fp-E3
	for mharc-coreutils@gnu.org; Tue, 31 Jul 2012 09:17:16 -0400
Received: from eggs.gnu.org ([208.118.235.92]:51980)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <pierrejean.f@laposte.net>) id 1Sw9Qp-00057y-RR
	for coreutils@gnu.org; Tue, 31 Jul 2012 06:12:09 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <pierrejean.f@laposte.net>) id 1Sw9Qo-00074N-E7
	for coreutils@gnu.org; Tue, 31 Jul 2012 06:12:03 -0400
Received: from smtpout4.laposte.net ([193.253.67.229]:19410
	helo=smtpout.laposte.net) by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <pierrejean.f@laposte.net>) id 1Sw9Qo-00070M-8K
	for coreutils@gnu.org; Tue, 31 Jul 2012 06:12:02 -0400
Received: from localhost.localdomain ([109.190.47.174])
	by mwinf8507-out with ME
	id gyBy1j00A3lVTvR03yByYK; Tue, 31 Jul 2012 12:11:59 +0200
Date: Tue, 31 Jul 2012 12:11:23 +0200
From: Pierre-Jean <pierrejean.f@laposte.net>
To: coreutils@gnu.org
Subject: Sort, version order and accents
Message-ID: <5017af4b.xhyC8PdeyFshV5/L%pierrejean.f@laposte.net>
User-Agent: Heirloom mailx 12.5 7/5/10
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 193.253.67.229
X-Mailman-Approved-At: Tue, 31 Jul 2012 09:17:15 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 31 Jul 2012 10:12:09 -0000


Hello alls,

I'm trying to sort a file containing accents and numbers,
but can't find a way to do this correctly:

- Without -V option, accents are correctly sorted, but not
  numbers.
- With -V option, numbers are correctly sorted, but not
  accents.

Here is an example:

echo "
A 10
A 9
E 10
E 9
e 10
e 9
é 10
é 9
F 10
f 9 " | sort -f

Return:

A 10
A 9
e 10
E 10
é 10
e 9
E 9
é 9
F 10
f 9 

--> Here accents are correctly sorted according to my
locale: they are considered as a non accentuated letter.
But numbers are not sorted in mathematical order.

Using `sort -f -V` return:

A 9
A 10
e 9
E 9
e 10
E 10
f 9 
F 10
é 9
é 10

--> Here, numbers are correctly sorted, but the behavior
concerning accents is different than before -- and doesn't
respect my locale.

Is it a normal behaviour?  If so, how can I use sort to
respect arithmetic numeral order, and my locale order
concerning accents?

For information:

sort (GNU coreutils) 8.17
Linux x32 3.4.5-1-ARCH (Arch linux)
LANG=fr_FR.UTF-8
LC_CTYPE="fr_FR.UTF-8"
LC_NUMERIC="fr_FR.UTF-8"
LC_TIME="fr_FR.UTF-8"
LC_COLLATE="fr_FR.UTF-8"
LC_MONETARY="fr_FR.UTF-8"
LC_MESSAGES="fr_FR.UTF-8"
LC_PAPER="fr_FR.UTF-8"
LC_NAME="fr_FR.UTF-8"
LC_ADDRESS="fr_FR.UTF-8"
LC_TELEPHONE="fr_FR.UTF-8"
LC_MEASUREMENT="fr_FR.UTF-8"
LC_IDENTIFICATION="fr_FR.UTF-8"
LC_ALL=fr_FR.UTF-8

Cheers,

Pierre-Jean.


From MAILER-DAEMON Tue Jul 31 09:17:16 2012
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1SwCK4-0008GI-IE
	for mharc-coreutils@gnu.org; Tue, 31 Jul 2012 09:17:16 -0400
Received: from eggs.gnu.org ([208.118.235.92]:57361)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <sygne@ombres.eu>) id 1Sw9do-0002sp-BT
	for coreutils@gnu.org; Tue, 31 Jul 2012 06:25:32 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <sygne@ombres.eu>) id 1Sw9dk-0002DX-72
	for coreutils@gnu.org; Tue, 31 Jul 2012 06:25:28 -0400
Received: from relay4-d.mail.gandi.net ([217.70.183.196]:43950)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <sygne@ombres.eu>) id 1Sw9dk-0002DH-0V
	for coreutils@gnu.org; Tue, 31 Jul 2012 06:25:24 -0400
X-Originating-IP: 217.70.178.133
Received: from mfilter3-d.gandi.net (mfilter3-d.gandi.net [217.70.178.133])
	by relay4-d.mail.gandi.net (Postfix) with ESMTP id A961C1720AF
	for <coreutils@gnu.org>; Tue, 31 Jul 2012 12:25:22 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at mfilter3-d.gandi.net
Received: from relay4-d.mail.gandi.net ([217.70.183.196])
	by mfilter3-d.gandi.net (mfilter3-d.gandi.net [10.0.15.180])
	(amavisd-new, port 10024)
	with ESMTP id ha687yOf6lmP for <coreutils@gnu.org>;
	Tue, 31 Jul 2012 12:25:21 +0200 (CEST)
X-Originating-IP: 109.190.47.174
Received: from localhost.localdomain (174-47-190-109.dsl.ovh.fr
	[109.190.47.174]) (Authenticated sender: sygne@ombres.eu)
	by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 3D9991720A1
	for <coreutils@gnu.org>; Tue, 31 Jul 2012 12:25:21 +0200 (CEST)
Date: Tue, 31 Jul 2012 12:24:45 +0200
From: Pierre-Jean <sygne@ombres.eu>
To: coreutils@gnu.org
Subject: sort -V and accents
Message-ID: <5017b26d.iELWZqTYPECu4TXF%sygne@ombres.eu>
User-Agent: Heirloom mailx 12.5 7/5/10
MIME-Version: 1.0
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: 217.70.183.196
X-Mailman-Approved-At: Tue, 31 Jul 2012 09:17:15 -0400
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 31 Jul 2012 10:25:32 -0000

Hello alls,

I'm trying to sort a file containing accents and numbers,
but can't find a way to do this correctly:

- Without -V option, accents are correctly sorted, but not
  numbers.
- With -V option, numbers are correctly sorted, but not
  accents.

Here is an example:

echo "
A 10
A 9
E 10
E 9
e 10
e 9
=C3=A9 10
=C3=A9 9
F 10
f 9 " | sort -f

Return:

A 10
A 9
e 10
E 10
=C3=A9 10
e 9
E 9
=C3=A9 9
F 10
f 9=20

--> Here accents are correctly sorted according to my
locale: they are considered as a non accentuated letter.
But numbers are not sorted in mathematical order.

`sort -f -V` return:

A 9
A 10
e 9
E 9
e 10
E 10
f 9=20
F 10
=C3=A9 9
=C3=A9 10

--> Here, numbers are correctly sorted, but the behavior
concerning accents is different than before -- and doesn't
respect my locale.

Is it a normal behaviour?  If so, how can I use sort to
respect arithmetic numeral order, *and* my locale order
concerning accents?

For information:

sort (GNU coreutils) 8.17
Linux x32 3.4.5-1-ARCH (Arch linux)
LANG=3Dfr_FR.UTF-8
LC_CTYPE=3D"fr_FR.UTF-8"
LC_NUMERIC=3D"fr_FR.UTF-8"
LC_TIME=3D"fr_FR.UTF-8"
LC_COLLATE=3D"fr_FR.UTF-8"
LC_MONETARY=3D"fr_FR.UTF-8"
LC_MESSAGES=3D"fr_FR.UTF-8"
LC_PAPER=3D"fr_FR.UTF-8"
LC_NAME=3D"fr_FR.UTF-8"
LC_ADDRESS=3D"fr_FR.UTF-8"
LC_TELEPHONE=3D"fr_FR.UTF-8"
LC_MEASUREMENT=3D"fr_FR.UTF-8"
LC_IDENTIFICATION=3D"fr_FR.UTF-8"
LC_ALL=3Dfr_FR.UTF-8

Cheers,

Pierre-Jean.


