From MAILER-DAEMON Wed Jun 01 07:58:55 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QRk4d-0004Sh-0C
	for mharc-coreutils@gnu.org; Wed, 01 Jun 2011 07:58:55 -0400
Received: from eggs.gnu.org ([140.186.70.92]:39466)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QRk4Z-0004SI-Mi
	for coreutils@gnu.org; Wed, 01 Jun 2011 07:58:52 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QRk4Y-0005GR-AL
	for coreutils@gnu.org; Wed, 01 Jun 2011 07:58:51 -0400
Received: from mx.meyering.net ([82.230.74.64]:33482)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QRk4X-0005GG-O8
	for coreutils@gnu.org; Wed, 01 Jun 2011 07:58:50 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id E52BF60088; Wed,  1 Jun 2011 13:58:47 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH] tail: fix an inconsequential bug spotted by coverity
Date: Wed, 01 Jun 2011 13:58:47 +0200
Message-ID: <87mxi1daq0.fsf@rho.meyering.net>
Lines: 41
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: 82.230.74.64
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, 01 Jun 2011 11:58:52 -0000

FYI, as far as I can see this really is inconsequential.  I reviewed
the code and also ran strace before and after, exercising the affected
code.  There was no difference in syscalls, and there was no difference
in output when I used this as input to the tail'd fifo "f": (seq 10;
sleep 1; echo foo) > f

I tested both with and without ---disable-inotify.

>From e7b4bf4b57efb699c87f03c1173d812ea34cb618 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Wed, 1 Jun 2011 13:48:12 +0200
Subject: [PATCH] tail: fix an inconsequential bug spotted by coverity

* src/tail.c (start_bytes): Increase *READ_POS (not READ_POS)
by the number of bytes read.  This is a real bug that happens
to have no consequence in practice.  First, this code is exercised
only when tailing-forever a non-regular file by bytes, and with a
start-relative offset, e.g., "mkfifo f; tail -f -c +3 f", but even
then, the invalid READ_POS value does not influence how tail works.
It is stored in the File_spec.size member, but that member is not
used at all in tail_forever_inotify, and in tail_forever, it is
used only when the File_spec refers to a regular file.
---
 src/tail.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/tail.c b/src/tail.c
index 714e278..f315776 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -818,7 +818,7 @@ start_bytes (const char *pretty_filename, int fd, uintmax_t n_bytes,
           error (0, errno, _("error reading %s"), quote (pretty_filename));
           return 1;
         }
-      read_pos += bytes_read;
+      *read_pos += bytes_read;
       if (bytes_read <= n_bytes)
         n_bytes -= bytes_read;
       else
--
1.7.5.3.716.g40fa6


From MAILER-DAEMON Wed Jun 01 10:09:55 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QRm7O-0001lk-Qt
	for mharc-coreutils@gnu.org; Wed, 01 Jun 2011 10:09:54 -0400
Received: from eggs.gnu.org ([140.186.70.92]:45155)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QRm73-0001hX-Tp
	for coreutils@gnu.org; Wed, 01 Jun 2011 10:09:52 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QRm6p-0006Ss-Cy
	for coreutils@gnu.org; Wed, 01 Jun 2011 10:09:33 -0400
Received: from mx1.redhat.com ([209.132.183.28]:57372)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QRm6n-0006SH-Iu
	for coreutils@gnu.org; Wed, 01 Jun 2011 10:09:18 -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 p51E9GFZ022618
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <coreutils@gnu.org>; Wed, 1 Jun 2011 10:09:16 -0400
Received: from [10.3.113.140] (ovpn-113-140.phx2.redhat.com [10.3.113.140])
	by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id p51E9FmK029984; Wed, 1 Jun 2011 10:09:16 -0400
Message-ID: <4DE6480B.5020504@redhat.com>
Date: Wed, 01 Jun 2011 08:09:15 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14
	Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10
MIME-Version: 1.0
To: Marek Polacek <mpolacek@redhat.com>
Subject: Re: [PATCH] yes.c: do not use exit after error
References: <4DDF51D7.2030101@redhat.com>
In-Reply-To: <4DDF51D7.2030101@redhat.com>
X-Enigmail-Version: 1.1.2
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="------------enig6EBF5EB8AFCAF30A87EE4DF5"
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
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, 01 Jun 2011 14:09:52 -0000

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

On 05/27/2011 01:25 AM, Marek Polacek wrote:
> I think it would be better to exit through the error() and not=20
> to call the exit() after the error().  This way we can get rid of
> one function call (and curly brackets).
>=20
> * src/yes.c (main): Exit through the error(), remove exit() call
> after error().
>=20
> --- coreutils/src/yes.c.mp	2011-05-27 09:09:56.320233888 +0200
> +++ coreutils/src/yes.c	2011-05-27 09:10:29.590237031 +0200
> @@ -84,9 +84,6 @@ main (int argc, char **argv)
>        for (i =3D optind; i < argc; i++)
>          if (fputs (argv[i], stdout) =3D=3D EOF
>              || putchar (i =3D=3D argc - 1 ? '\n' : ' ') =3D=3D EOF)
> -          {
> -            error (0, errno, _("standard output"));
> -            exit (EXIT_FAILURE);
> -          }
> +          error (EXIT_FAILURE, errno, _("standard output"));

Thanks; pushed.

--=20
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


--------------enig6EBF5EB8AFCAF30A87EE4DF5
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.11 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJN5kgLAAoJEKeha0olJ0Nqh1cH/jw9exxAXOLQkwrbqJmOUtYd
YQwooK9qDxpZOwB/aV5pB0qsjVHKPlcpL5A8QZWfFZ/zip+XMIWBm1S1KxTJ1U1s
PkCdiPCVF1GnT7mrLSy3tjPYKoViVgrKwtE7pn/sZgBjeqogvWOF1Nf4VtCunWLQ
z6NMAH5okVZi9JLq4DXgLYgAYiPFfYVa62wUd12kkQDwdOverESW7dEole1MNEvN
4TdBc9BJfnqXjak6/xoxBPLaZgGhDzcaCtXihzU16Aa844soGcwrIA/Ti+vlB58k
Y19U6lRkwCg9kfPDd/XCPRXCWzDGOZp2eBtGnGA6UyrDLi8ZkzpCV8mKfyex1cg=
=GVnF
-----END PGP SIGNATURE-----

--------------enig6EBF5EB8AFCAF30A87EE4DF5--


From MAILER-DAEMON Wed Jun 01 10:14:31 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QRmBq-0002eM-He
	for mharc-coreutils@gnu.org; Wed, 01 Jun 2011 10:14:30 -0400
Received: from eggs.gnu.org ([140.186.70.92]:44667)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QRmBj-0002d4-Bn
	for coreutils@gnu.org; Wed, 01 Jun 2011 10:14:29 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QRmBd-00079W-MV
	for coreutils@gnu.org; Wed, 01 Jun 2011 10:14:22 -0400
Received: from mx.meyering.net ([82.230.74.64]:50466)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QRmBd-000795-7X
	for coreutils@gnu.org; Wed, 01 Jun 2011 10:14:17 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 32B82601B6; Wed,  1 Jun 2011 16:14:16 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH] tests: stat-free-color: accommodate stat of /selinux on
	rawhide
Date: Wed, 01 Jun 2011 16:14:16 +0200
Message-ID: <87zkm1bpvr.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: 82.230.74.64
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, 01 Jun 2011 14:14:29 -0000

This test started to fail on rawhide, due to some new start-up
code that is run when selinux is enabled.  That code includes
a stat of /selinux:

  statfs("/sys/fs/selinux", 0x7fffbb8f1de0) = -1 ENOENT (No such file or directory)
  statfs("/selinux", {f_type=0xf97cff8c, f_bsize=4096, f_blocks=0, f_bfree=0, f_bavail=0, f_files=0, f_ffree=0, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0
  statfs("/selinux", {f_type=0xf97cff8c, f_bsize=4096, f_blocks=0, f_bfree=0, f_bavail=0, f_files=0, f_ffree=0, f_fsid={0, 0}, f_namelen=255, f_frsize=4096}) = 0
  stat("/selinux", {st_mode=S_IFDIR|0755, st_size=0, ...}) = 0

Here's the fix:

>From ccf2d9a482d19c949befde807184b0f5bbf72397 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Wed, 1 Jun 2011 16:08:21 +0200
Subject: [PATCH] tests: stat-free-color: accommodate stat of /selinux on
 rawhide

* tests/ls/stat-free-color: This test recently began to fail on
rawhide because dynamic library start-up code now stats "/selinux",
making the total number of calls 2 rather than the prior 1.
Create two more dangling symlinks, so that any erroneous stat-
or lstat-calling code will get at least those three.
---
 tests/ls/stat-free-color |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/tests/ls/stat-free-color b/tests/ls/stat-free-color
index 06e621e..b1c4744 100755
--- a/tests/ls/stat-free-color
+++ b/tests/ls/stat-free-color
@@ -21,7 +21,9 @@ print_ver_ ls
 require_strace_ stat
 require_dirent_d_type_

-ln -s nowhere dangle || framework_failure_
+for i in 1 2 3; do
+  ln -s nowhere dangle-$i || framework_failure_
+done

 # Disable enough features via LS_COLORS so that ls --color
 # can do its job without calling stat (other than the obligatory
@@ -49,6 +51,11 @@ eval $(dircolors -b color-without-stat)

 strace -o log -e stat,lstat,stat64,lstat64 ls --color=always . || fail=1
 n_lines=$(wc -l < log)
-test $n_lines = 1 || fail=1
+
+# Expect one or two stat calls.
+case $n_lines in
+  1|2) ;;
+  *) fail=1 ;;
+esac

 Exit $fail
--
1.7.5.3.716.g40fa6


From MAILER-DAEMON Fri Jun 03 05:35:15 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QSQmg-0007dt-E4
	for mharc-coreutils@gnu.org; Fri, 03 Jun 2011 05:35:14 -0400
Received: from eggs.gnu.org ([140.186.70.92]:52409)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1QSQmc-0007cE-Hw
	for coreutils@gnu.org; Fri, 03 Jun 2011 05:35:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1QSQmb-0004cj-0g
	for coreutils@gnu.org; Fri, 03 Jun 2011 05:35:10 -0400
Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]:3126)
	by eggs.gnu.org with smtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1QSQma-0004bl-Md
	for coreutils@gnu.org; Fri, 03 Jun 2011 05:35:08 -0400
Received: (qmail 96776 invoked from network); 3 Jun 2011 09:35:06 -0000
Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218)
	by mail1.slb.deg.dub.stisp.net with SMTP; 3 Jun 2011 09:35:06 -0000
Message-ID: <4DE8AA22.6030807@draigBrady.com>
Date: Fri, 03 Jun 2011 10:32:18 +0100
From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US;
	rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3
MIME-Version: 1.0
To: Coreutils <coreutils@gnu.org>
Subject: [PATCH] maint: remove unneeded includes
X-Enigmail-Version: 1.0.1
Content-Type: multipart/mixed; boundary="------------000003030103060906040901"
X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9
X-Received-From: 84.203.253.98
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, 03 Jun 2011 09:35:12 -0000

This is a multi-part message in MIME format.
--------------000003030103060906040901
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Remove unneeded includes as reported by:
http://code.google.com/p/include-what-you-use/

cheers,
PÃ¡draig.

--------------000003030103060906040901
Content-Type: text/x-patch;
 name="unused-includes.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="unused-includes.diff"

>From 7a60ac94d63f514319e89a22da82fed77f4d9db3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C3=A1draig=20Brady?= <P@draigBrady.com>
Date: Fri, 3 Jun 2011 10:27:16 +0100
Subject: [PATCH] maint: remove unneeded includes

Remove unneeded includes as reported by:
http://code.google.com/p/include-what-you-use/

* src/cp-hash.c: Remove unused include.
* src/dd.c: Likewise.
* src/du.c: Likewise.
* src/head.c: Likewise.
* src/kill.c: Likewise.
* src/ls.c: Likewise.
* src/stdbuf.c: Likewise.
* src/timeout.c: Likewise.
* src/truncate.c: Likewise.
---
 src/cp-hash.c  |    1 -
 src/dd.c       |    1 -
 src/du.c       |    1 -
 src/head.c     |    1 -
 src/kill.c     |    1 -
 src/ls.c       |    2 --
 src/stdbuf.c   |    1 -
 src/timeout.c  |    1 -
 src/truncate.c |    1 -
 9 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/src/cp-hash.c b/src/cp-hash.c
index 31bee71..575d01a 100644
--- a/src/cp-hash.c
+++ b/src/cp-hash.c
@@ -22,7 +22,6 @@
 #include <sys/types.h>
 #include "system.h"
 
-#include "same.h"
 #include "hash.h"
 #include "cp-hash.h"
 
diff --git a/src/dd.c b/src/dd.c
index 072410e..45aa9b9 100644
--- a/src/dd.c
+++ b/src/dd.c
@@ -27,7 +27,6 @@
 #include "system.h"
 #include "close-stream.h"
 #include "error.h"
-#include "fadvise.h"
 #include "fd-reopen.h"
 #include "gethrxtime.h"
 #include "human.h"
diff --git a/src/du.c b/src/du.c
index 67841a3..71275a2 100644
--- a/src/du.c
+++ b/src/du.c
@@ -37,7 +37,6 @@
 #include "human.h"
 #include "quote.h"
 #include "quotearg.h"
-#include "same.h"
 #include "stat-time.h"
 #include "stdio--.h"
 #include "xfts.h"
diff --git a/src/head.c b/src/head.c
index 84f9582..1c6e6bc 100644
--- a/src/head.c
+++ b/src/head.c
@@ -32,7 +32,6 @@
 #include "system.h"
 
 #include "error.h"
-#include "full-write.h"
 #include "full-read.h"
 #include "quote.h"
 #include "safe-read.h"
diff --git a/src/kill.c b/src/kill.c
index abf8cd1..b94e68c 100644
--- a/src/kill.c
+++ b/src/kill.c
@@ -21,7 +21,6 @@
 #include <getopt.h>
 #include <sys/types.h>
 #include <signal.h>
-#include <sys/wait.h>
 
 #include "system.h"
 #include "error.h"
diff --git a/src/ls.c b/src/ls.c
index af18da0..80fdb80 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -53,7 +53,6 @@
 #include <stdio.h>
 #include <assert.h>
 #include <setjmp.h>
-#include <grp.h>
 #include <pwd.h>
 #include <getopt.h>
 #include <signal.h>
@@ -95,7 +94,6 @@
 #include "obstack.h"
 #include "quote.h"
 #include "quotearg.h"
-#include "same.h"
 #include "stat-time.h"
 #include "strftime.h"
 #include "xstrtol.h"
diff --git a/src/stdbuf.c b/src/stdbuf.c
index 2f66dd5..f51dc6a 100644
--- a/src/stdbuf.c
+++ b/src/stdbuf.c
@@ -25,7 +25,6 @@
 #include "system.h"
 #include "error.h"
 #include "filenamecat.h"
-#include "posixver.h"
 #include "quote.h"
 #include "xreadlink.h"
 #include "xstrtol.h"
diff --git a/src/timeout.c b/src/timeout.c
index 649e176..a686225 100644
--- a/src/timeout.c
+++ b/src/timeout.c
@@ -55,7 +55,6 @@
 #include "xstrtol.h"
 #include "sig2str.h"
 #include "operand2sig.h"
-#include "cloexec.h"
 #include "error.h"
 #include "quote.h"
 
diff --git a/src/truncate.c b/src/truncate.c
index 30097ac..b6c7762 100644
--- a/src/truncate.c
+++ b/src/truncate.c
@@ -27,7 +27,6 @@
 
 #include "system.h"
 #include "error.h"
-#include "posixver.h"
 #include "quote.h"
 #include "xstrtol.h"
 
-- 
1.7.5.2


--------------000003030103060906040901--


From MAILER-DAEMON Fri Jun 03 10:52:25 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QSVjc-0005p1-HW
	for mharc-coreutils@gnu.org; Fri, 03 Jun 2011 10:52:24 -0400
Received: from eggs.gnu.org ([140.186.70.92]:50015)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QSVjX-0005oC-Ly
	for coreutils@gnu.org; Fri, 03 Jun 2011 10:52:21 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QSVjV-0002G0-Qe
	for coreutils@gnu.org; Fri, 03 Jun 2011 10:52:19 -0400
Received: from mx.meyering.net ([82.230.74.64]:35607)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QSVjV-0002FI-DJ
	for coreutils@gnu.org; Fri, 03 Jun 2011 10:52:17 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 0601A60191; Fri,  3 Jun 2011 16:52:12 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Subject: Re: [PATCH] maint: remove unneeded includes
In-Reply-To: <4DE8AA22.6030807@draigBrady.com> (=?iso-8859-1?Q?=22P=E1drai?=
	=?iso-8859-1?Q?g?= Brady"'s message of
	"Fri, 03 Jun 2011 10:32:18 +0100")
References: <4DE8AA22.6030807@draigBrady.com>
Date: Fri, 03 Jun 2011 16:52:12 +0200
Message-ID: <87tyc755nn.fsf@rho.meyering.net>
Lines: 45
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: 82.230.74.64
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: Fri, 03 Jun 2011 14:52:21 -0000

P=E1draig Brady wrote:
> Remove unneeded includes as reported by:
> http://code.google.com/p/include-what-you-use/
...
> Subject: [PATCH] maint: remove unneeded includes
>
> Remove unneeded includes as reported by:
> http://code.google.com/p/include-what-you-use/
>
> * src/cp-hash.c: Remove unused include.
> * src/dd.c: Likewise.
> * src/du.c: Likewise.
> * src/head.c: Likewise.
> * src/kill.c: Likewise.
> * src/ls.c: Likewise.
> * src/stdbuf.c: Likewise.
> * src/timeout.c: Likewise.
> * src/truncate.c: Likewise.
> ---
>  src/cp-hash.c  |    1 -
>  src/dd.c       |    1 -
>  src/du.c       |    1 -
>  src/head.c     |    1 -
>  src/kill.c     |    1 -
>  src/ls.c       |    2 --
>  src/stdbuf.c   |    1 -
>  src/timeout.c  |    1 -
>  src/truncate.c |    1 -
>  9 files changed, 0 insertions(+), 10 deletions(-)
>
> diff --git a/src/cp-hash.c b/src/cp-hash.c
> index 31bee71..575d01a 100644
> --- a/src/cp-hash.c
> +++ b/src/cp-hash.c
> @@ -22,7 +22,6 @@
>  #include <sys/types.h>
>  #include "system.h"
>
> -#include "same.h"
>  #include "hash.h"
>  #include "cp-hash.h"

Nice.  Thanks!
I haven't tried it yet.  How long does it take to run?
Sounds like a good candidate to be run as a syntax-check rule.


From MAILER-DAEMON Fri Jun 03 11:09:48 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QSW0S-0000KV-2M
	for mharc-coreutils@gnu.org; Fri, 03 Jun 2011 11:09:48 -0400
Received: from eggs.gnu.org ([140.186.70.92]:33557)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1QSW0O-0000Il-11
	for coreutils@gnu.org; Fri, 03 Jun 2011 11:09:45 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1QSW0M-0005UT-GA
	for coreutils@gnu.org; Fri, 03 Jun 2011 11:09:43 -0400
Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]:3086)
	by eggs.gnu.org with smtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1QSW0L-0005U8-Tl
	for coreutils@gnu.org; Fri, 03 Jun 2011 11:09:42 -0400
Received: (qmail 64086 invoked from network); 3 Jun 2011 15:09:39 -0000
Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218)
	by mail1.slb.deg.dub.stisp.net with SMTP; 3 Jun 2011 15:09:39 -0000
Message-ID: <4DE8F88A.3040708@draigBrady.com>
Date: Fri, 03 Jun 2011 16:06:50 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US;
	rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
Subject: Re: [PATCH] maint: remove unneeded includes
References: <4DE8AA22.6030807@draigBrady.com> <87tyc755nn.fsf@rho.meyering.net>
In-Reply-To: <87tyc755nn.fsf@rho.meyering.net>
X-Enigmail-Version: 1.0.1
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9
X-Received-From: 84.203.253.98
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: Fri, 03 Jun 2011 15:09:46 -0000

On 03/06/11 15:52, Jim Meyering wrote:
> Nice.  Thanks!
> I haven't tried it yet.  How long does it take to run?
> Sounds like a good candidate to be run as a syntax-check rule.

It's awkward (relies on a llvm/clang source tree for example)
and currently requires human interpretation.
It basically takes as long as clang-analyzer does.
Not a candidate for automation at present.

cheers,
Pádraig.


From MAILER-DAEMON Fri Jun 03 11:18:08 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QSW8V-0002VE-OT
	for mharc-coreutils@gnu.org; Fri, 03 Jun 2011 11:18:07 -0400
Received: from eggs.gnu.org ([140.186.70.92]:37568)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QSW8T-0002UT-6a
	for coreutils@gnu.org; Fri, 03 Jun 2011 11:18:06 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QSW8Q-00072p-Vx
	for coreutils@gnu.org; Fri, 03 Jun 2011 11:18:04 -0400
Received: from mx1.redhat.com ([209.132.183.28]:32658)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QSW8Q-00072f-9m
	for coreutils@gnu.org; Fri, 03 Jun 2011 11:18:02 -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 p53FHx8x011279
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Fri, 3 Jun 2011 11:17:59 -0400
Received: from [10.3.113.140] (ovpn-113-140.phx2.redhat.com [10.3.113.140])
	by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id p53FHwuQ004847; Fri, 3 Jun 2011 11:17:59 -0400
Message-ID: <4DE8FB26.5090702@redhat.com>
Date: Fri, 03 Jun 2011 09:17:58 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14
	Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10
MIME-Version: 1.0
To: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
Subject: Re: [PATCH] maint: remove unneeded includes
References: <4DE8AA22.6030807@draigBrady.com> <87tyc755nn.fsf@rho.meyering.net>
	<4DE8F88A.3040708@draigBrady.com>
In-Reply-To: <4DE8F88A.3040708@draigBrady.com>
X-Enigmail-Version: 1.1.2
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="------------enigE1E753ED29A6843B66F0C41B"
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
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: Fri, 03 Jun 2011 15:18:07 -0000

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

On 06/03/2011 09:06 AM, P=E1draig Brady wrote:
> On 03/06/11 15:52, Jim Meyering wrote:
>> Nice.  Thanks!
>> I haven't tried it yet.  How long does it take to run?
>> Sounds like a good candidate to be run as a syntax-check rule.
>=20
> It's awkward (relies on a llvm/clang source tree for example)
> and currently requires human interpretation.
> It basically takes as long as clang-analyzer does.
> Not a candidate for automation at present.

In other words, our existing sc_prohibit_XXX_without_use rules are
faster at doing the job, once we take the time to write the rules for
each header.

Are any of the headers you cleaned up in your pass worth porting into
gnulib's maint.mk as new sc_prohibit_XXX_without_use rules?

--=20
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


--------------enigE1E753ED29A6843B66F0C41B
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.11 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJN6PsmAAoJEKeha0olJ0Nqk1wIAJyn0kGcfFpSSLmOjtOf2W9p
hbG5QXDtuRrNQzXjSpI3dI0VJM6ef4ztQfjKPylxGSN8nBufllmpYFufEk/2xnWD
mtshgb8Hda+hKf/AcFZ5p5ktT4GE7KWCyilbhIC18zUOfIz0/7HjlmAGa1rWyZPP
wBYp6q9S5MN7d92yxsjMBNO9i3sxu8A7IT7Gr5Wy4Hh6ypPKUh6RcsfPH/MLLHj9
P4u5F8qQAch4RDXVaFmgyDVZRN7sR0Gk1AYUrrIzLEMQkapJ29ANQxBTqQMmHVgb
BqAhxsWfpAUoRgTKtyGZ7ezC7Rv5C+2kP9vkFNPpLKIb/3NLfWFtaYZa/nNA+eA=
=LgF2
-----END PGP SIGNATURE-----

--------------enigE1E753ED29A6843B66F0C41B--


From MAILER-DAEMON Fri Jun 03 11:25:45 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QSWFs-0004KR-Hu
	for mharc-coreutils@gnu.org; Fri, 03 Jun 2011 11:25:44 -0400
Received: from eggs.gnu.org ([140.186.70.92]:51691)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1QSWFp-0004Jk-AJ
	for coreutils@gnu.org; Fri, 03 Jun 2011 11:25:42 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1QSWFm-0008Tr-1c
	for coreutils@gnu.org; Fri, 03 Jun 2011 11:25:40 -0400
Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]:9428)
	by eggs.gnu.org with smtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1QSWFl-0008T7-9X
	for coreutils@gnu.org; Fri, 03 Jun 2011 11:25:37 -0400
Received: (qmail 67058 invoked from network); 3 Jun 2011 15:25:34 -0000
Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218)
	by mail1.slb.deg.dub.stisp.net with SMTP; 3 Jun 2011 15:25:34 -0000
Message-ID: <4DE8FC45.6050402@draigBrady.com>
Date: Fri, 03 Jun 2011 16:22:45 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US;
	rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3
MIME-Version: 1.0
To: Eric Blake <eblake@redhat.com>
Subject: Re: [PATCH] maint: remove unneeded includes
References: <4DE8AA22.6030807@draigBrady.com> <87tyc755nn.fsf@rho.meyering.net>
	<4DE8F88A.3040708@draigBrady.com> <4DE8FB26.5090702@redhat.com>
In-Reply-To: <4DE8FB26.5090702@redhat.com>
X-Enigmail-Version: 1.0.1
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9
X-Received-From: 84.203.253.98
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: Fri, 03 Jun 2011 15:25:43 -0000

On 03/06/11 16:17, Eric Blake wrote:
> On 06/03/2011 09:06 AM, Pádraig Brady wrote:
>> On 03/06/11 15:52, Jim Meyering wrote:
>>> Nice.  Thanks!
>>> I haven't tried it yet.  How long does it take to run?
>>> Sounds like a good candidate to be run as a syntax-check rule.
>>
>> It's awkward (relies on a llvm/clang source tree for example)
>> and currently requires human interpretation.
>> It basically takes as long as clang-analyzer does.
>> Not a candidate for automation at present.
> 
> In other words, our existing sc_prohibit_XXX_without_use rules are
> faster at doing the job, once we take the time to write the rules for
> each header.
> 
> Are any of the headers you cleaned up in your pass worth porting into
> gnulib's maint.mk as new sc_prohibit_XXX_without_use rules?

Yes good point.
I was essentially doing this grepping to confirm
the redundancy anyway.
I'll look at update those rules later in the weekend.

cheers,
Pádraig.


From MAILER-DAEMON Fri Jun 03 11:26:45 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QSWGr-0004YE-1A
	for mharc-coreutils@gnu.org; Fri, 03 Jun 2011 11:26:45 -0400
Received: from eggs.gnu.org ([140.186.70.92]:52080)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QSWGo-0004Xb-2e
	for coreutils@gnu.org; Fri, 03 Jun 2011 11:26:43 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QSWGl-0000Wu-S5
	for coreutils@gnu.org; Fri, 03 Jun 2011 11:26:41 -0400
Received: from mx.meyering.net ([82.230.74.64]:51842)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QSWGl-0000Wc-BN
	for coreutils@gnu.org; Fri, 03 Jun 2011 11:26:39 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 6446E60184; Fri,  3 Jun 2011 17:26:38 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Eric Blake <eblake@redhat.com>
Subject: Re: [PATCH] maint: remove unneeded includes
In-Reply-To: <4DE8FB26.5090702@redhat.com> (Eric Blake's message of "Fri, 03
	Jun 2011 09:17:58 -0600")
References: <4DE8AA22.6030807@draigBrady.com>
	<87tyc755nn.fsf@rho.meyering.net> <4DE8F88A.3040708@draigBrady.com>
	<4DE8FB26.5090702@redhat.com>
Date: Fri, 03 Jun 2011 17:26:38 +0200
Message-ID: <87d3iv5429.fsf@rho.meyering.net>
Lines: 43
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: 82.230.74.64
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: Fri, 03 Jun 2011 15:26:44 -0000

Eric Blake wrote:

> On 06/03/2011 09:06 AM, P=E1draig Brady wrote:
>> On 03/06/11 15:52, Jim Meyering wrote:
>>> Nice.  Thanks!
>>> I haven't tried it yet.  How long does it take to run?
>>> Sounds like a good candidate to be run as a syntax-check rule.
>>
>> It's awkward (relies on a llvm/clang source tree for example)
>> and currently requires human interpretation.
>> It basically takes as long as clang-analyzer does.
>> Not a candidate for automation at present.
>
> In other words, our existing sc_prohibit_XXX_without_use rules are
> faster at doing the job, once we take the time to write the rules for
> each header.
>
> Are any of the headers you cleaned up in your pass worth porting into
> gnulib's maint.mk as new sc_prohibit_XXX_without_use rules?

These three were easy:

diff --git a/top/maint.mk b/top/maint.mk
index 9f20900..c55571c 100644
--- a/top/maint.mk
+++ b/top/maint.mk
@@ -495,6 +495,16 @@ sc_prohibit_hash_without_use:
 	re=3D'$(_hash_fn)|$(_hash_struct)'\
 	  $(_sc_header_without_use)

+sc_prohibit_cloexec_without_use:
+	@h=3D'"cloexec.h"' re=3D'\<(set_cloexec_flag|dup_cloexec) *\(' \
+	  $(_sc_header_without_use)
+
+sc_prohibit_posixver_without_use:
+	@h=3D'"posixver.h"' re=3D'\<posix2_version *\(' $(_sc_header_without_use)
+
+sc_prohibit_same_without_use:
+	@h=3D'"same.h"' re=3D'\<same_name *\(' $(_sc_header_without_use)
+
 sc_prohibit_hash_pjw_without_use:
 	@h=3D'"hash-pjw.h"' \
 	re=3D'\<hash_pjw *\(' \


From MAILER-DAEMON Sat Jun 04 05:16:12 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QSmxn-0000rx-OE
	for mharc-coreutils@gnu.org; Sat, 04 Jun 2011 05:16:11 -0400
Received: from eggs.gnu.org ([140.186.70.92]:44628)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QSmxk-0000rW-FK
	for coreutils@gnu.org; Sat, 04 Jun 2011 05:16:09 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QSmxi-000310-Ic
	for coreutils@gnu.org; Sat, 04 Jun 2011 05:16:08 -0400
Received: from mx.meyering.net ([82.230.74.64]:42396)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QSmxi-00030m-15
	for coreutils@gnu.org; Sat, 04 Jun 2011 05:16:06 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 0989A60313; Sat,  4 Jun 2011 11:16:04 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH 1/2] maint: remove now-spurious curly braces
Date: Sat, 04 Jun 2011 11:16:04 +0200
Message-ID: <87hb862bzf.fsf@rho.meyering.net>
Lines: 82
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: 82.230.74.64
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: Sat, 04 Jun 2011 09:16:10 -0000

These address a couple of overdue FIXME comments:

>From b7332b889e083370293b143687df3e01bbca7539 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Fri, 3 Jun 2011 13:29:15 +0200
Subject: [PATCH 1/2] maint: remove now-spurious curly braces

* src/chown-core.c (restricted_chown): Remove FIXME comment and
superfluous curly braces.
---
 src/chown-core.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/src/chown-core.c b/src/chown-core.c
index 55f8a2d..26a272e 100644
--- a/src/chown-core.c
+++ b/src/chown-core.c
@@ -256,12 +256,10 @@ restricted_chown (int cwd_fd, char const *file,
         }
     }

-  { /* FIXME: remove these curly braces when we assume C99.  */
-    int saved_errno = errno;
-    close (fd);
-    errno = saved_errno;
-    return status;
-  }
+  int saved_errno = errno;
+  close (fd);
+  errno = saved_errno;
+  return status;
 }

 /* Change the owner and/or group of the file specified by FTS and ENT
--
1.7.6.rc0.254.gf37de


>From c2b25223c13ad7bb55bebbdf456a9040c030d10c Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Fri, 3 Jun 2011 13:28:15 +0200
Subject: [PATCH 2/2] build: require at least 2-year old autoconf-2.64 (was
 2.62)

* configure.ac: Require autoconf-2.64, which is nearly two years old.
* src/system.h (emit_ancillary_info): Use PACKAGE_URL, now that we
require autoconf-2.64.
---
 configure.ac |    2 +-
 src/system.h |    4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 3dbce5d..2e45f84 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,7 +18,7 @@

 dnl Written by Jim Meyering.

-AC_PREREQ([2.62])
+AC_PREREQ([2.64])

 # Make inter-release version strings look like, e.g., v6.9-219-g58ddd, which
 # indicates that it is built from the 219th delta (in _some_ repository)
diff --git a/src/system.h b/src/system.h
index 2e8e177..47aad02 100644
--- a/src/system.h
+++ b/src/system.h
@@ -593,9 +593,7 @@ emit_ancillary_info (void)
 {
   printf (_("\nReport %s bugs to %s\n"), last_component (program_name),
           PACKAGE_BUGREPORT);
-  /* FIXME 2010: use AC_PACKAGE_URL once we require autoconf-2.64 */
-  printf (_("%s home page: <http://www.gnu.org/software/%s/>\n"),
-          PACKAGE_NAME, PACKAGE);
+  printf (_("%s home page: <%s>\n"), PACKAGE_NAME, PACKAGE_URL);
   fputs (_("General help using GNU software: <http://www.gnu.org/gethelp/>\n"),
          stdout);
   /* Don't output this redundant message for English locales.
--
1.7.6.rc0.254.gf37de


From MAILER-DAEMON Sat Jun 11 07:56:06 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QVMnN-0007dk-T5
	for mharc-coreutils@gnu.org; Sat, 11 Jun 2011 07:56:06 -0400
Received: from eggs.gnu.org ([140.186.70.92]:47093)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QVMnM-0007dc-6p
	for coreutils@gnu.org; Sat, 11 Jun 2011 07:56:05 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QVMnL-0003y2-Ay
	for coreutils@gnu.org; Sat, 11 Jun 2011 07:56:04 -0400
Received: from mx.meyering.net ([82.230.74.64]:53790)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QVMnL-0003xx-3g
	for coreutils@gnu.org; Sat, 11 Jun 2011 07:56:03 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 45B316011F; Sat, 11 Jun 2011 13:56:02 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH] tests: inotify-rotate: avoid false positive under heavy load
Date: Sat, 11 Jun 2011 13:56:02 +0200
Message-ID: <874o3wlgz1.fsf@rho.meyering.net>
Lines: 49
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: 82.230.74.64
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: Sat, 11 Jun 2011 11:56:05 -0000

FYI, I've been consistently hitting a failure of this test
when running massively (perhaps overly) parallel "make check".
This fixed it:

>From 7c77c93dc5482d98b225242ea0300021ce6d4eae Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Sat, 11 Jun 2011 13:53:58 +0200
Subject: [PATCH] tests: inotify-rotate: avoid false positive under heavy load

* tests/tail-2/inotify-rotate: Increase timeout from 10s to 40s
to avoid load-induced false positive.
---
 tests/tail-2/inotify-rotate |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/tail-2/inotify-rotate b/tests/tail-2/inotify-rotate
index f9aa80f..900e214 100755
--- a/tests/tail-2/inotify-rotate
+++ b/tests/tail-2/inotify-rotate
@@ -44,7 +44,10 @@ grep_timeout()
 for i in $(seq 50); do
     echo $i
     rm -rf k x out
-    :>k && :>x && timeout 10 tail -F k > out 2>&1 &
+    # Normally less than a second is required here, but with heavy load
+    # and a lot of disk activity, even 20 seconds is insufficient, which
+    # leads to this timeout killing tail before the "ok" is written below.
+    :>k && :>x && timeout 40 tail -F k > out 2>&1 &
     pid=$!
     sleep .1
     echo b > k;
@@ -53,13 +56,13 @@ for i in $(seq 50); do
     while :; do grep b out > /dev/null && break; done
     mv x k
     # wait for tail to detect the rename
-    grep_timeout tail: out || fail_ failed to detect rename
+    grep_timeout tail: out || { cat out; fail_ failed to detect rename; }
     echo ok >> k
     found=0
     # wait up to 10 seconds for "ok" to appear in out
     grep_timeout ok out && found=1
     kill $pid
-    test $found = 0 && { fail=1; cat out; break; }
+    test $found = 0 && { cat out; fail_ failed to detect echoed '"ok"'; }
 done

 Exit $fail
--
1.7.6.rc0.293.g40857


From MAILER-DAEMON Sat Jun 11 14:25:51 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QVSsZ-0005tF-1J
	for mharc-coreutils@gnu.org; Sat, 11 Jun 2011 14:25:51 -0400
Received: from eggs.gnu.org ([140.186.70.92]:34461)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <james@orbital.spiral-arm.org>) id 1QVLy5-000464-Qf
	for coreutils@gnu.org; Sat, 11 Jun 2011 07:03:07 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <james@orbital.spiral-arm.org>) id 1QVLy3-0006OJ-UK
	for coreutils@gnu.org; Sat, 11 Jun 2011 07:03:05 -0400
Received: from excession.spiral-arm.org ([80.68.89.77]:52428)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <james@orbital.spiral-arm.org>)
	id 1QVLy3-0006OC-Ie; Sat, 11 Jun 2011 07:03:03 -0400
Received: from orbital.spiral-arm.org (unknown [188.141.48.130])
	by excession.spiral-arm.org (Postfix) with ESMTP id 8F78B807E;
	Sat, 11 Jun 2011 12:03:00 +0100 (BST)
Received: by orbital.spiral-arm.org (Postfix, from userid 1027)
	id 8EE4ADE490; Sat, 11 Jun 2011 12:03:00 +0100 (IST)
From: James Youngman <jay@gnu.org>
To: coreutils@gnu.org
Subject: [PATCH] maint: use stat-size module from gnulib
Date: Sat, 11 Jun 2011 12:02:47 +0100
Message-Id: <1307790167-21584-1-git-send-email-jay@gnu.org>
X-Mailer: git-send-email 1.7.2.5
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1)
X-Received-From: 80.68.89.77
X-Mailman-Approved-At: Sat, 11 Jun 2011 14:25:49 -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: Sat, 11 Jun 2011 11:03:07 -0000

* src/system.h: Definitions of ST_* macros have moved into the
gnulib module stat-size (specifically, the header file
stat-size.h), so remove them from here.
* src/truncate.c: Include stat-size.h.
* src/stat.c: Likewise.
* src/shred.c: Likewise.
* src/ls.c: Likewise.
* src/du.c: Likewise.
* src/ioblksize.h: New file.  Move definition of io_blksize out of
system.h so that system.h does not have to include stat-size.h.
* src/cat.c: Include ioblksize.h.
* src/split.c: Likewise.
* src/copy.c: Include both stat-size.h and ioblksize.h.
---
 bootstrap.conf  |    1 +
 src/cat.c       |    1 +
 src/copy.c      |    2 +
 src/du.c        |    1 +
 src/ioblksize.h |   68 ++++++++++++++++++++++++++++++++
 src/ls.c        |    1 +
 src/shred.c     |    1 +
 src/split.c     |    1 +
 src/stat.c      |    1 +
 src/system.h    |  116 -------------------------------------------------------
 src/truncate.c  |    1 +
 11 files changed, 78 insertions(+), 116 deletions(-)
 create mode 100644 src/ioblksize.h

diff --git a/bootstrap.conf b/bootstrap.conf
index 4168ee2..23f7abb 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -196,6 +196,7 @@ gnulib_modules="
   sigaction
   ssize_t
   stat-macros
+  stat-size
   stat-time
   stdbool
   stdlib-safer
diff --git a/src/cat.c b/src/cat.c
index 6df3eb0..b9c4453 100644
--- a/src/cat.c
+++ b/src/cat.c
@@ -32,6 +32,7 @@
 #endif
 #include <sys/ioctl.h>
 
+#include "ioblksize.h"
 #include "system.h"
 #include "error.h"
 #include "fadvise.h"
diff --git a/src/copy.c b/src/copy.c
index 801a474..1025fe1 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -47,9 +47,11 @@
 #include "hash.h"
 #include "hash-triple.h"
 #include "ignore-value.h"
+#include "ioblksize.h"
 #include "quote.h"
 #include "same.h"
 #include "savedir.h"
+#include "stat-size.h"
 #include "stat-time.h"
 #include "utimecmp.h"
 #include "utimens.h"
diff --git a/src/du.c b/src/du.c
index 71275a2..fba7f7d 100644
--- a/src/du.c
+++ b/src/du.c
@@ -37,6 +37,7 @@
 #include "human.h"
 #include "quote.h"
 #include "quotearg.h"
+#include "stat-size.h"
 #include "stat-time.h"
 #include "stdio--.h"
 #include "xfts.h"
diff --git a/src/ioblksize.h b/src/ioblksize.h
new file mode 100644
index 0000000..6b72570
--- /dev/null
+++ b/src/ioblksize.h
@@ -0,0 +1,68 @@
+/* I/O block size definitions for coreutils
+   Copyright (C) 1989, 1991-2011 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Include this file _after_ system headers if possible.  */
+
+#include <sys/stat.h>
+
+#include "stat-size.h"
+
+
+/* As of Mar 2009, 32KiB is determined to be the minimium
+   blksize to best minimize system call overhead.
+   This can be tested with this script with the results
+   shown for a 1.7GHz pentium-m with 2GB of 400MHz DDR2 RAM:
+
+   for i in $(seq 0 10); do
+     size=$((8*1024**3)) #ensure this is big enough
+     bs=$((1024*2**$i))
+     printf "%7s=" $bs
+     dd bs=$bs if=/dev/zero of=/dev/null count=$(($size/$bs)) 2>&1 |
+     sed -n 's/.* \([0-9.]* [GM]B\/s\)/\1/p'
+   done
+
+      1024=734 MB/s
+      2048=1.3 GB/s
+      4096=2.4 GB/s
+      8192=3.5 GB/s
+     16384=3.9 GB/s
+     32768=5.2 GB/s
+     65536=5.3 GB/s
+    131072=5.5 GB/s
+    262144=5.7 GB/s
+    524288=5.7 GB/s
+   1048576=5.8 GB/s
+
+   Note that this is to minimize system call overhead.
+   Other values may be appropriate to minimize file system
+   or disk overhead.  For example on my current GNU/Linux system
+   the readahead setting is 128KiB which was read using:
+
+   file="."
+   device=$(df -P --local "$file" | tail -n1 | cut -d' ' -f1)
+   echo $(( $(blockdev --getra $device) * 512 ))
+
+   However there isn't a portable way to get the above.
+   In the future we could use the above method if available
+   and default to io_blksize() if not.
+ */
+enum { IO_BUFSIZE = 32*1024 };
+static inline size_t
+io_blksize (struct stat sb)
+{
+  return MAX (IO_BUFSIZE, ST_BLKSIZE (sb));
+}
+
diff --git a/src/ls.c b/src/ls.c
index 80fdb80..a167254 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -94,6 +94,7 @@
 #include "obstack.h"
 #include "quote.h"
 #include "quotearg.h"
+#include "stat-size.h"
 #include "stat-time.h"
 #include "strftime.h"
 #include "xstrtol.h"
diff --git a/src/shred.c b/src/shred.c
index ecb27b8..a2365b0 100644
--- a/src/shred.c
+++ b/src/shred.c
@@ -100,6 +100,7 @@
 #include "quotearg.h"		/* For quotearg_colon */
 #include "randint.h"
 #include "randread.h"
+#include "stat-size.h"
 
 /* Default number of times to overwrite.  */
 enum { DEFAULT_PASSES = 3 };
diff --git a/src/split.c b/src/split.c
index 95a2ccc..2962b68 100644
--- a/src/split.c
+++ b/src/split.c
@@ -35,6 +35,7 @@
 #include "fcntl--.h"
 #include "full-read.h"
 #include "full-write.h"
+#include "ioblksize.h"
 #include "quote.h"
 #include "safe-read.h"
 #include "sig2str.h"
diff --git a/src/stat.c b/src/stat.c
index 4e6e1c3..c479726 100644
--- a/src/stat.c
+++ b/src/stat.c
@@ -67,6 +67,7 @@
 #include "mountlist.h"
 #include "quote.h"
 #include "quotearg.h"
+#include "stat-size.h"
 #include "stat-time.h"
 #include "strftime.h"
 #include "find-mount-point.h"
diff --git a/src/system.h b/src/system.h
index 47aad02..95ef2c3 100644
--- a/src/system.h
+++ b/src/system.h
@@ -133,77 +133,6 @@ enum
 /* include here for SIZE_MAX.  */
 #include <inttypes.h>
 
-/* Get or fake the disk device blocksize.
-   Usually defined by sys/param.h (if at all).  */
-#if !defined DEV_BSIZE && defined BSIZE
-# define DEV_BSIZE BSIZE
-#endif
-#if !defined DEV_BSIZE && defined BBSIZE /* SGI */
-# define DEV_BSIZE BBSIZE
-#endif
-#ifndef DEV_BSIZE
-# define DEV_BSIZE 4096
-#endif
-
-/* Extract or fake data from a `struct stat'.
-   ST_BLKSIZE: Preferred I/O blocksize for the file, in bytes.
-   ST_NBLOCKS: Number of blocks in the file, including indirect blocks.
-   ST_NBLOCKSIZE: Size of blocks used when calculating ST_NBLOCKS.  */
-#ifndef HAVE_STRUCT_STAT_ST_BLOCKS
-# define ST_BLKSIZE(statbuf) DEV_BSIZE
-# if defined _POSIX_SOURCE || !defined BSIZE /* fileblocks.c uses BSIZE.  */
-#  define ST_NBLOCKS(statbuf) \
-  ((statbuf).st_size / ST_NBLOCKSIZE + ((statbuf).st_size % ST_NBLOCKSIZE != 0))
-# else /* !_POSIX_SOURCE && BSIZE */
-#  define ST_NBLOCKS(statbuf) \
-  (S_ISREG ((statbuf).st_mode) \
-   || S_ISDIR ((statbuf).st_mode) \
-   ? st_blocks ((statbuf).st_size) : 0)
-# endif /* !_POSIX_SOURCE && BSIZE */
-#else /* HAVE_STRUCT_STAT_ST_BLOCKS */
-/* Some systems, like Sequents, return st_blksize of 0 on pipes.
-   Also, when running `rsh hpux11-system cat any-file', cat would
-   determine that the output stream had an st_blksize of 2147421096.
-   Conversely st_blksize can be 2 GiB (or maybe even larger) with XFS
-   on 64-bit hosts.  Somewhat arbitrarily, limit the `optimal' block
-   size to SIZE_MAX / 8 + 1.  (Dividing SIZE_MAX by only 4 wouldn't
-   suffice, since "cat" sometimes multiplies the result by 4.)  If
-   anyone knows of a system for which this limit is too small, please
-   report it as a bug in this code.  */
-# define ST_BLKSIZE(statbuf) ((0 < (statbuf).st_blksize \
-                               && (statbuf).st_blksize <= SIZE_MAX / 8 + 1) \
-                              ? (statbuf).st_blksize : DEV_BSIZE)
-# if defined hpux || defined __hpux__ || defined __hpux
-/* HP-UX counts st_blocks in 1024-byte units.
-   This loses when mixing HP-UX and BSD file systems with NFS.  */
-#  define ST_NBLOCKSIZE 1024
-# else /* !hpux */
-#  if defined _AIX && defined _I386
-/* AIX PS/2 counts st_blocks in 4K units.  */
-#   define ST_NBLOCKSIZE (4 * 1024)
-#  else /* not AIX PS/2 */
-#   if defined _CRAY
-#    define ST_NBLOCKS(statbuf) \
-  (S_ISREG ((statbuf).st_mode) \
-   || S_ISDIR ((statbuf).st_mode) \
-   ? (statbuf).st_blocks * ST_BLKSIZE (statbuf) / ST_NBLOCKSIZE : 0)
-#   endif /* _CRAY */
-#  endif /* not AIX PS/2 */
-# endif /* !hpux */
-#endif /* HAVE_STRUCT_STAT_ST_BLOCKS */
-
-#ifndef ST_NBLOCKS
-# define ST_NBLOCKS(statbuf) ((statbuf).st_blocks)
-#endif
-
-#ifndef ST_NBLOCKSIZE
-# ifdef S_BLKSIZE
-#  define ST_NBLOCKSIZE S_BLKSIZE
-# else
-#  define ST_NBLOCKSIZE 512
-# endif
-#endif
-
 /* Redirection and wildcarding when done by the utility itself.
    Generally a noop, but used in particular for native VMS. */
 #ifndef initialize_main
@@ -629,51 +558,6 @@ bad_cast (char const *s)
   return (char *) s;
 }
 
-/* As of Mar 2009, 32KiB is determined to be the minimium
-   blksize to best minimize system call overhead.
-   This can be tested with this script with the results
-   shown for a 1.7GHz pentium-m with 2GB of 400MHz DDR2 RAM:
-
-   for i in $(seq 0 10); do
-     size=$((8*1024**3)) #ensure this is big enough
-     bs=$((1024*2**$i))
-     printf "%7s=" $bs
-     dd bs=$bs if=/dev/zero of=/dev/null count=$(($size/$bs)) 2>&1 |
-     sed -n 's/.* \([0-9.]* [GM]B\/s\)/\1/p'
-   done
-
-      1024=734 MB/s
-      2048=1.3 GB/s
-      4096=2.4 GB/s
-      8192=3.5 GB/s
-     16384=3.9 GB/s
-     32768=5.2 GB/s
-     65536=5.3 GB/s
-    131072=5.5 GB/s
-    262144=5.7 GB/s
-    524288=5.7 GB/s
-   1048576=5.8 GB/s
-
-   Note that this is to minimize system call overhead.
-   Other values may be appropriate to minimize file system
-   or disk overhead.  For example on my current GNU/Linux system
-   the readahead setting is 128KiB which was read using:
-
-   file="."
-   device=$(df -P --local "$file" | tail -n1 | cut -d' ' -f1)
-   echo $(( $(blockdev --getra $device) * 512 ))
-
-   However there isn't a portable way to get the above.
-   In the future we could use the above method if available
-   and default to io_blksize() if not.
- */
-enum { IO_BUFSIZE = 32*1024 };
-static inline size_t
-io_blksize (struct stat sb)
-{
-  return MAX (IO_BUFSIZE, ST_BLKSIZE (sb));
-}
-
 void usage (int status) ATTRIBUTE_NORETURN;
 
 #define emit_cycle_warning(file_name)	\
diff --git a/src/truncate.c b/src/truncate.c
index b6c7762..eaa1b74 100644
--- a/src/truncate.c
+++ b/src/truncate.c
@@ -28,6 +28,7 @@
 #include "system.h"
 #include "error.h"
 #include "quote.h"
+#include "stat-size.h"
 #include "xstrtol.h"
 
 /* The official name of this program (e.g., no `g' prefix).  */
-- 
1.7.2.5



From MAILER-DAEMON Sat Jun 11 14:25:52 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QVSsZ-0005tT-If
	for mharc-coreutils@gnu.org; Sat, 11 Jun 2011 14:25:51 -0400
Received: from eggs.gnu.org ([140.186.70.92]:60112)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <james@orbital.spiral-arm.org>) id 1QVM2R-0004Zo-P7
	for coreutils@gnu.org; Sat, 11 Jun 2011 07:07:36 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <james@orbital.spiral-arm.org>) id 1QVM2Q-0006yv-FB
	for coreutils@gnu.org; Sat, 11 Jun 2011 07:07:35 -0400
Received: from excession.spiral-arm.org ([80.68.89.77]:37033)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <james@orbital.spiral-arm.org>)
	id 1QVM2Q-0006yo-9p; Sat, 11 Jun 2011 07:07:34 -0400
Received: from orbital.spiral-arm.org (unknown [188.141.48.130])
	by excession.spiral-arm.org (Postfix) with ESMTP id BB3AA807E;
	Sat, 11 Jun 2011 12:07:32 +0100 (BST)
Received: by orbital.spiral-arm.org (Postfix, from userid 1027)
	id 96B35DE490; Sat, 11 Jun 2011 12:07:33 +0100 (IST)
From: James Youngman <jay@gnu.org>
To: coreutils@gnu.org
Subject: [PATCH] maint: distribute ioblksize.h.
Date: Sat, 11 Jun 2011 12:07:31 +0100
Message-Id: <1307790451-21690-1-git-send-email-jay@gnu.org>
X-Mailer: git-send-email 1.7.2.5
In-Reply-To: <307790167-21584-1-git-send-email-jay@gnu.org>
References: <307790167-21584-1-git-send-email-jay@gnu.org>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1)
X-Received-From: 80.68.89.77
X-Mailman-Approved-At: Sat, 11 Jun 2011 14:25:49 -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: Sat, 11 Jun 2011 11:07:37 -0000

* src/Makefile.am (noinst_HEADERS): Add ioblksize.h.
---
 src/Makefile.am |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 908cd33..516e1e5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -149,6 +149,7 @@ noinst_HEADERS =	\
   find-mount-point.h	\
   fs.h			\
   group-list.h		\
+  ioblksize.h		\
   ls.h			\
   operand2sig.h		\
   prog-fprintf.h	\
-- 
1.7.2.5



From MAILER-DAEMON Sat Jun 11 14:25:52 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QVSsZ-0005tf-WD
	for mharc-coreutils@gnu.org; Sat, 11 Jun 2011 14:25:52 -0400
Received: from eggs.gnu.org ([140.186.70.92]:54847)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <james@orbital.spiral-arm.org>) id 1QVQ7G-0003B1-Vd
	for coreutils@gnu.org; Sat, 11 Jun 2011 11:28:52 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <james@orbital.spiral-arm.org>) id 1QVQ7E-0000mr-49
	for coreutils@gnu.org; Sat, 11 Jun 2011 11:28:50 -0400
Received: from excession.spiral-arm.org ([80.68.89.77]:34612)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <james@orbital.spiral-arm.org>)
	id 1QVQ7D-0000mR-Ha; Sat, 11 Jun 2011 11:28:47 -0400
Received: from orbital.spiral-arm.org (unknown [188.141.48.130])
	by excession.spiral-arm.org (Postfix) with ESMTP id 77D7B807E;
	Sat, 11 Jun 2011 16:28:44 +0100 (BST)
Received: by orbital.spiral-arm.org (Postfix, from userid 1027)
	id 9957BDE490; Sat, 11 Jun 2011 16:28:44 +0100 (IST)
From: James Youngman <jay@gnu.org>
To: coreutils@gnu.org
Subject: [PATCH] maint: use stat-size module from gnulib
Date: Sat, 11 Jun 2011 16:28:34 +0100
Message-Id: <1307806114-9144-1-git-send-email-jay@gnu.org>
X-Mailer: git-send-email 1.7.2.5
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1)
X-Received-From: 80.68.89.77
X-Mailman-Approved-At: Sat, 11 Jun 2011 14:25:49 -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: Sat, 11 Jun 2011 15:28:53 -0000

* gnulib: Update to latest.
* src/system.h: Definitions of ST_* macros have moved into the
gnulib module stat-size (specifically, the header file
stat-size.h), so remove them from here.
* src/truncate.c: Include stat-size.h.
* src/stat.c: Likewise.
* src/shred.c: Likewise.
* src/ls.c: Likewise.
* src/du.c: Likewise.
* src/ioblksize.h: New file.  Move definition of io_blksize out of
system.h so that system.h does not have to include stat-size.h.
* src/cat.c: Include ioblksize.h.
* src/split.c: Likewise.
* src/copy.c: Include both stat-size.h and ioblksize.h.
* src/Makefile.am (noinst_HEADERS): Add ioblksize.h.
---
 bootstrap.conf  |    1 +
 gnulib          |    2 +-
 src/Makefile.am |    1 +
 src/cat.c       |    1 +
 src/copy.c      |    2 +
 src/du.c        |    1 +
 src/ioblksize.h |   66 +++++++++++++++++++++++++++++++
 src/ls.c        |    1 +
 src/shred.c     |    1 +
 src/split.c     |    1 +
 src/stat.c      |    1 +
 src/system.h    |  116 -------------------------------------------------------
 src/truncate.c  |    1 +
 13 files changed, 78 insertions(+), 117 deletions(-)
 create mode 100644 src/ioblksize.h

diff --git a/bootstrap.conf b/bootstrap.conf
index 4168ee2..23f7abb 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -196,6 +196,7 @@ gnulib_modules="
   sigaction
   ssize_t
   stat-macros
+  stat-size
   stat-time
   stdbool
   stdlib-safer
diff --git a/gnulib b/gnulib
index 9d196fa..9fc77bc 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 9d196fad055a448c5732a8e950cc044b353d2615
+Subproject commit 9fc77bc59374e21e1174742df416af186a368e14
diff --git a/src/Makefile.am b/src/Makefile.am
index 908cd33..516e1e5 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -149,6 +149,7 @@ noinst_HEADERS =	\
   find-mount-point.h	\
   fs.h			\
   group-list.h		\
+  ioblksize.h		\
   ls.h			\
   operand2sig.h		\
   prog-fprintf.h	\
diff --git a/src/cat.c b/src/cat.c
index 6df3eb0..c44296c 100644
--- a/src/cat.c
+++ b/src/cat.c
@@ -33,6 +33,7 @@
 #include <sys/ioctl.h>
 
 #include "system.h"
+#include "ioblksize.h"
 #include "error.h"
 #include "fadvise.h"
 #include "full-write.h"
diff --git a/src/copy.c b/src/copy.c
index 801a474..1025fe1 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -47,9 +47,11 @@
 #include "hash.h"
 #include "hash-triple.h"
 #include "ignore-value.h"
+#include "ioblksize.h"
 #include "quote.h"
 #include "same.h"
 #include "savedir.h"
+#include "stat-size.h"
 #include "stat-time.h"
 #include "utimecmp.h"
 #include "utimens.h"
diff --git a/src/du.c b/src/du.c
index 71275a2..fba7f7d 100644
--- a/src/du.c
+++ b/src/du.c
@@ -37,6 +37,7 @@
 #include "human.h"
 #include "quote.h"
 #include "quotearg.h"
+#include "stat-size.h"
 #include "stat-time.h"
 #include "stdio--.h"
 #include "xfts.h"
diff --git a/src/ioblksize.h b/src/ioblksize.h
new file mode 100644
index 0000000..eaeced3
--- /dev/null
+++ b/src/ioblksize.h
@@ -0,0 +1,66 @@
+/* I/O block size definitions for coreutils
+   Copyright (C) 1989, 1991-2011 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* Include this file _after_ system headers if possible.  */
+
+/* sys/stat.h will already have been included by system.h. */
+#include "stat-size.h"
+
+
+/* As of Mar 2009, 32KiB is determined to be the minimium
+   blksize to best minimize system call overhead.
+   This can be tested with this script with the results
+   shown for a 1.7GHz pentium-m with 2GB of 400MHz DDR2 RAM:
+
+   for i in $(seq 0 10); do
+     size=$((8*1024**3)) #ensure this is big enough
+     bs=$((1024*2**$i))
+     printf "%7s=" $bs
+     dd bs=$bs if=/dev/zero of=/dev/null count=$(($size/$bs)) 2>&1 |
+     sed -n 's/.* \([0-9.]* [GM]B\/s\)/\1/p'
+   done
+
+      1024=734 MB/s
+      2048=1.3 GB/s
+      4096=2.4 GB/s
+      8192=3.5 GB/s
+     16384=3.9 GB/s
+     32768=5.2 GB/s
+     65536=5.3 GB/s
+    131072=5.5 GB/s
+    262144=5.7 GB/s
+    524288=5.7 GB/s
+   1048576=5.8 GB/s
+
+   Note that this is to minimize system call overhead.
+   Other values may be appropriate to minimize file system
+   or disk overhead.  For example on my current GNU/Linux system
+   the readahead setting is 128KiB which was read using:
+
+   file="."
+   device=$(df -P --local "$file" | tail -n1 | cut -d' ' -f1)
+   echo $(( $(blockdev --getra $device) * 512 ))
+
+   However there isn't a portable way to get the above.
+   In the future we could use the above method if available
+   and default to io_blksize() if not.
+ */
+enum { IO_BUFSIZE = 32*1024 };
+static inline size_t
+io_blksize (struct stat sb)
+{
+  return MAX (IO_BUFSIZE, ST_BLKSIZE (sb));
+}
diff --git a/src/ls.c b/src/ls.c
index 80fdb80..a167254 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -94,6 +94,7 @@
 #include "obstack.h"
 #include "quote.h"
 #include "quotearg.h"
+#include "stat-size.h"
 #include "stat-time.h"
 #include "strftime.h"
 #include "xstrtol.h"
diff --git a/src/shred.c b/src/shred.c
index ecb27b8..a2365b0 100644
--- a/src/shred.c
+++ b/src/shred.c
@@ -100,6 +100,7 @@
 #include "quotearg.h"		/* For quotearg_colon */
 #include "randint.h"
 #include "randread.h"
+#include "stat-size.h"
 
 /* Default number of times to overwrite.  */
 enum { DEFAULT_PASSES = 3 };
diff --git a/src/split.c b/src/split.c
index 95a2ccc..2962b68 100644
--- a/src/split.c
+++ b/src/split.c
@@ -35,6 +35,7 @@
 #include "fcntl--.h"
 #include "full-read.h"
 #include "full-write.h"
+#include "ioblksize.h"
 #include "quote.h"
 #include "safe-read.h"
 #include "sig2str.h"
diff --git a/src/stat.c b/src/stat.c
index 4e6e1c3..c479726 100644
--- a/src/stat.c
+++ b/src/stat.c
@@ -67,6 +67,7 @@
 #include "mountlist.h"
 #include "quote.h"
 #include "quotearg.h"
+#include "stat-size.h"
 #include "stat-time.h"
 #include "strftime.h"
 #include "find-mount-point.h"
diff --git a/src/system.h b/src/system.h
index 47aad02..95ef2c3 100644
--- a/src/system.h
+++ b/src/system.h
@@ -133,77 +133,6 @@ enum
 /* include here for SIZE_MAX.  */
 #include <inttypes.h>
 
-/* Get or fake the disk device blocksize.
-   Usually defined by sys/param.h (if at all).  */
-#if !defined DEV_BSIZE && defined BSIZE
-# define DEV_BSIZE BSIZE
-#endif
-#if !defined DEV_BSIZE && defined BBSIZE /* SGI */
-# define DEV_BSIZE BBSIZE
-#endif
-#ifndef DEV_BSIZE
-# define DEV_BSIZE 4096
-#endif
-
-/* Extract or fake data from a `struct stat'.
-   ST_BLKSIZE: Preferred I/O blocksize for the file, in bytes.
-   ST_NBLOCKS: Number of blocks in the file, including indirect blocks.
-   ST_NBLOCKSIZE: Size of blocks used when calculating ST_NBLOCKS.  */
-#ifndef HAVE_STRUCT_STAT_ST_BLOCKS
-# define ST_BLKSIZE(statbuf) DEV_BSIZE
-# if defined _POSIX_SOURCE || !defined BSIZE /* fileblocks.c uses BSIZE.  */
-#  define ST_NBLOCKS(statbuf) \
-  ((statbuf).st_size / ST_NBLOCKSIZE + ((statbuf).st_size % ST_NBLOCKSIZE != 0))
-# else /* !_POSIX_SOURCE && BSIZE */
-#  define ST_NBLOCKS(statbuf) \
-  (S_ISREG ((statbuf).st_mode) \
-   || S_ISDIR ((statbuf).st_mode) \
-   ? st_blocks ((statbuf).st_size) : 0)
-# endif /* !_POSIX_SOURCE && BSIZE */
-#else /* HAVE_STRUCT_STAT_ST_BLOCKS */
-/* Some systems, like Sequents, return st_blksize of 0 on pipes.
-   Also, when running `rsh hpux11-system cat any-file', cat would
-   determine that the output stream had an st_blksize of 2147421096.
-   Conversely st_blksize can be 2 GiB (or maybe even larger) with XFS
-   on 64-bit hosts.  Somewhat arbitrarily, limit the `optimal' block
-   size to SIZE_MAX / 8 + 1.  (Dividing SIZE_MAX by only 4 wouldn't
-   suffice, since "cat" sometimes multiplies the result by 4.)  If
-   anyone knows of a system for which this limit is too small, please
-   report it as a bug in this code.  */
-# define ST_BLKSIZE(statbuf) ((0 < (statbuf).st_blksize \
-                               && (statbuf).st_blksize <= SIZE_MAX / 8 + 1) \
-                              ? (statbuf).st_blksize : DEV_BSIZE)
-# if defined hpux || defined __hpux__ || defined __hpux
-/* HP-UX counts st_blocks in 1024-byte units.
-   This loses when mixing HP-UX and BSD file systems with NFS.  */
-#  define ST_NBLOCKSIZE 1024
-# else /* !hpux */
-#  if defined _AIX && defined _I386
-/* AIX PS/2 counts st_blocks in 4K units.  */
-#   define ST_NBLOCKSIZE (4 * 1024)
-#  else /* not AIX PS/2 */
-#   if defined _CRAY
-#    define ST_NBLOCKS(statbuf) \
-  (S_ISREG ((statbuf).st_mode) \
-   || S_ISDIR ((statbuf).st_mode) \
-   ? (statbuf).st_blocks * ST_BLKSIZE (statbuf) / ST_NBLOCKSIZE : 0)
-#   endif /* _CRAY */
-#  endif /* not AIX PS/2 */
-# endif /* !hpux */
-#endif /* HAVE_STRUCT_STAT_ST_BLOCKS */
-
-#ifndef ST_NBLOCKS
-# define ST_NBLOCKS(statbuf) ((statbuf).st_blocks)
-#endif
-
-#ifndef ST_NBLOCKSIZE
-# ifdef S_BLKSIZE
-#  define ST_NBLOCKSIZE S_BLKSIZE
-# else
-#  define ST_NBLOCKSIZE 512
-# endif
-#endif
-
 /* Redirection and wildcarding when done by the utility itself.
    Generally a noop, but used in particular for native VMS. */
 #ifndef initialize_main
@@ -629,51 +558,6 @@ bad_cast (char const *s)
   return (char *) s;
 }
 
-/* As of Mar 2009, 32KiB is determined to be the minimium
-   blksize to best minimize system call overhead.
-   This can be tested with this script with the results
-   shown for a 1.7GHz pentium-m with 2GB of 400MHz DDR2 RAM:
-
-   for i in $(seq 0 10); do
-     size=$((8*1024**3)) #ensure this is big enough
-     bs=$((1024*2**$i))
-     printf "%7s=" $bs
-     dd bs=$bs if=/dev/zero of=/dev/null count=$(($size/$bs)) 2>&1 |
-     sed -n 's/.* \([0-9.]* [GM]B\/s\)/\1/p'
-   done
-
-      1024=734 MB/s
-      2048=1.3 GB/s
-      4096=2.4 GB/s
-      8192=3.5 GB/s
-     16384=3.9 GB/s
-     32768=5.2 GB/s
-     65536=5.3 GB/s
-    131072=5.5 GB/s
-    262144=5.7 GB/s
-    524288=5.7 GB/s
-   1048576=5.8 GB/s
-
-   Note that this is to minimize system call overhead.
-   Other values may be appropriate to minimize file system
-   or disk overhead.  For example on my current GNU/Linux system
-   the readahead setting is 128KiB which was read using:
-
-   file="."
-   device=$(df -P --local "$file" | tail -n1 | cut -d' ' -f1)
-   echo $(( $(blockdev --getra $device) * 512 ))
-
-   However there isn't a portable way to get the above.
-   In the future we could use the above method if available
-   and default to io_blksize() if not.
- */
-enum { IO_BUFSIZE = 32*1024 };
-static inline size_t
-io_blksize (struct stat sb)
-{
-  return MAX (IO_BUFSIZE, ST_BLKSIZE (sb));
-}
-
 void usage (int status) ATTRIBUTE_NORETURN;
 
 #define emit_cycle_warning(file_name)	\
diff --git a/src/truncate.c b/src/truncate.c
index b6c7762..eaa1b74 100644
--- a/src/truncate.c
+++ b/src/truncate.c
@@ -28,6 +28,7 @@
 #include "system.h"
 #include "error.h"
 #include "quote.h"
+#include "stat-size.h"
 #include "xstrtol.h"
 
 /* The official name of this program (e.g., no `g' prefix).  */
-- 
1.7.2.5



From MAILER-DAEMON Mon Jun 13 06:23:16 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QW4Id-0001Dj-HM
	for mharc-coreutils@gnu.org; Mon, 13 Jun 2011 06:23:15 -0400
Received: from eggs.gnu.org ([140.186.70.92]:37248)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QW4Ia-0001DL-6M
	for coreutils@gnu.org; Mon, 13 Jun 2011 06:23:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QW4IY-0000KB-FS
	for coreutils@gnu.org; Mon, 13 Jun 2011 06:23:11 -0400
Received: from mx.meyering.net ([82.230.74.64]:42246)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>)
	id 1QW4IX-0000K6-Vv; Mon, 13 Jun 2011 06:23:10 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id EE8A46019A; Mon, 13 Jun 2011 12:23:08 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: James Youngman <jay@gnu.org>
Subject: Re: [PATCH] maint: use stat-size module from gnulib
In-Reply-To: <1307806114-9144-1-git-send-email-jay@gnu.org> (James Youngman's
	message of "Sat, 11 Jun 2011 16:28:34 +0100")
References: <1307806114-9144-1-git-send-email-jay@gnu.org>
Date: Mon, 13 Jun 2011 12:23:08 +0200
Message-ID: <8762oaghdf.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: 82.230.74.64
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, 13 Jun 2011 10:23:13 -0000

James Youngman wrote:
> * gnulib: Update to latest.
> * src/system.h: Definitions of ST_* macros have moved into the
> gnulib module stat-size (specifically, the header file
> stat-size.h), so remove them from here.
> * src/truncate.c: Include stat-size.h.
> * src/stat.c: Likewise.
> * src/shred.c: Likewise.
> * src/ls.c: Likewise.
> * src/du.c: Likewise.
> * src/ioblksize.h: New file.  Move definition of io_blksize out of
> system.h so that system.h does not have to include stat-size.h.
> * src/cat.c: Include ioblksize.h.
> * src/split.c: Likewise.
> * src/copy.c: Include both stat-size.h and ioblksize.h.
> * src/Makefile.am (noinst_HEADERS): Add ioblksize.h.
> ---
>  bootstrap.conf  |    1 +
>  gnulib          |    2 +-
>  src/Makefile.am |    1 +
>  src/cat.c       |    1 +
>  src/copy.c      |    2 +
>  src/du.c        |    1 +
>  src/ioblksize.h |   66 +++++++++++++++++++++++++++++++
>  src/ls.c        |    1 +
>  src/shred.c     |    1 +
>  src/split.c     |    1 +
>  src/stat.c      |    1 +
>  src/system.h    |  116 -------------------------------------------------------
>  src/truncate.c  |    1 +
>  13 files changed, 78 insertions(+), 117 deletions(-)
>  create mode 100644 src/ioblksize.h

Hi James,

Thank you for the patch.  It looks perfect.
I've updated gnulib to the very latest as of a few minutes ago,
and will push as soon as "make distcheck" completes.


From MAILER-DAEMON Mon Jun 13 09:54:29 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QW7b3-0007cx-Ij
	for mharc-coreutils@gnu.org; Mon, 13 Jun 2011 09:54:29 -0400
Received: from eggs.gnu.org ([140.186.70.92]:47244)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <oldium.pro@googlemail.com>) id 1QW2bs-0002qQ-Et
	for coreutils@gnu.org; Mon, 13 Jun 2011 04:35:01 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <oldium.pro@googlemail.com>) id 1QW2bq-0006xQ-VK
	for coreutils@gnu.org; Mon, 13 Jun 2011 04:35:00 -0400
Received: from mail-vx0-f169.google.com ([209.85.220.169]:46999)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <oldium.pro@googlemail.com>) id 1QW2bq-0006xK-Ma
	for coreutils@gnu.org; Mon, 13 Jun 2011 04:34:58 -0400
Received: by vxk20 with SMTP id 20so4540210vxk.0
	for <coreutils@gnu.org>; Mon, 13 Jun 2011 01:34:57 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=googlemail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:date:x-google-sender-auth
	:message-id:subject:from:to:content-type;
	bh=r8qAiSoT0jqlrRSgqVEc7q4n97yj8eaFfwf/5hJ35x8=;
	b=cbIafzxYaEiVymPaFciQ7A5IIvDB5FwxVWgynOiWRHZo/UNd97yWlk3TGqqxqdrXNz
	pNNM4PcPH1v7brPMnPSOG4gY7tRMiVZwYyvNCFizM5kx1hubbTiTRx0lV0xE0OCLfVOh
	uLX2A/j38VEnxYz4uDkoGuWGGzbqcZLdwMpzs=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma;
	h=mime-version:sender:date:x-google-sender-auth:message-id:subject
	:from:to:content-type;
	b=JgcbM5LpUR8+glf0IoJ60iDL+vIPCg702YDqO4KcROy9TuIDbIBnzrnOsdfK1izM5g
	h1AtKg2j9Vh/sBEK8Xhf9VblDX5wWc+g9w9QdGJUtubAbGblBAAY0oV0HcVOXWnoTQKn
	pyruqkkUmwRPnfkgFdeACxoU0W7EsLPpdX27Y=
MIME-Version: 1.0
Received: by 10.220.200.10 with SMTP id eu10mr1901982vcb.97.1307954097744;
	Mon, 13 Jun 2011 01:34:57 -0700 (PDT)
Sender: oldium.pro@googlemail.com
Received: by 10.220.84.65 with HTTP; Mon, 13 Jun 2011 01:34:57 -0700 (PDT)
Date: Mon, 13 Jun 2011 10:34:57 +0200
X-Google-Sender-Auth: iV2Rppx1hJ6RleTRIZvVyEtwAP8
Message-ID: <BANLkTi=Prc9WQhJgX486R6RXxPi1fm+Rmw@mail.gmail.com>
Subject: mkdir inside symlink creates wrong directory with relative parent
From: =?UTF-8?B?T2xkxZlpY2ggSmVkbGnEjWth?= <oldium.pro@seznam.cz>
To: coreutils@gnu.org
Content-Type: multipart/alternative; boundary=90e6ba53ac3460ebfe04a593cb74
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.220.169
X-Mailman-Approved-At: Mon, 13 Jun 2011 09:54:27 -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: Mon, 13 Jun 2011 08:35:02 -0000

--90e6ba53ac3460ebfe04a593cb74
Content-Type: text/plain; charset=UTF-8

Hi all,

I was trying to search for any description helping me understand in what I
see, but actually I didn't find any, so I'm here. I discovered it by using
automake-1.11, because it uses relative paths a lot. So my simplified
testcase is as follows:

Have a directory structure x/y and x/z/a. Have a symbolic link from x/y/z
that points to x/z.

  mkdir -p x/y
  mkdir -p x/z/a
  ln -s ../z x/y/z

Now go into x/y/z/a and try to create directory like that:

  cd x/y/z/a
  mkdir ../dir_xyz
  mkdir ../../dir_xy
  mkdir ../../../dir_x

I would expet that there would be a directory like this:

  x/dir_x
  x/y/dir_xy
  x/y/z/dir_xyz (x/z/dir_xyz)

But the result is completely different:

  dir_x
  x/dir_xy
  x/y/z/dir_xyz (x/z/dir_xyz)

So when you want to create a directory in the parent structure from within
the symbolic link, you will fail in doing so, because the symbolic link
would be resolved during walking through parents, so you can get to
completely different tree while creating your directory. It looks like a
bug, because it is nowhere documented to behave like that (and the behaviour
is strange by itself).

Verified on Debian 4.0/RedHat 5.4 with coreutils 5.97 and on Gentoo with
coreutils 8.12.

Regards,
Oldrich.

--90e6ba53ac3460ebfe04a593cb74
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi all,<br><br>I was trying to search for any description helping me unders=
tand in what I see, but actually I didn&#39;t find any, so I&#39;m here. I =
discovered it by using automake-1.11, because it uses relative paths a lot.=
 So my simplified testcase is as follows:<br>
<br>Have a directory structure x/y and x/z/a. Have a symbolic link from x/y=
/z that points to x/z.<br><br>=C2=A0 mkdir -p x/y<br>=C2=A0 mkdir -p x/z/a<=
br>=C2=A0 ln -s ../z x/y/z<br><br>Now go into x/y/z/a and try to create dir=
ectory like that:<br>
<br>=C2=A0 cd x/y/z/a<br>=C2=A0 mkdir ../dir_xyz<br>=C2=A0 mkdir ../../dir_=
xy<br>=C2=A0 mkdir ../../../dir_x<br><br>I would expet that there would be =
a directory like this:<br><br>=C2=A0 x/dir_x<br>=C2=A0 x/y/dir_xy<br>=C2=A0=
 x/y/z/dir_xyz (x/z/dir_xyz)<br>
<br>But the result is completely different:<br><br>=C2=A0 dir_x<br>=C2=A0 x=
/dir_xy<br>=C2=A0 x/y/z/dir_xyz (x/z/dir_xyz)<br><br>So when you want to cr=
eate a directory in the parent structure from within the symbolic link, you=
 will fail in doing so, because the symbolic link would be resolved during =
walking through parents, so you can get to completely different tree while =
creating your directory. It looks like a bug, because it is nowhere documen=
ted to behave like that (and the behaviour is strange by itself).<br>
<br>Verified on Debian 4.0/RedHat 5.4 with coreutils 5.97 and on Gentoo wit=
h coreutils 8.12.<br><br>Regards,<br>Oldrich.<br>

--90e6ba53ac3460ebfe04a593cb74--


From MAILER-DAEMON Mon Jun 13 10:52:01 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QW8Uj-0006et-72
	for mharc-coreutils@gnu.org; Mon, 13 Jun 2011 10:52:01 -0400
Received: from eggs.gnu.org ([140.186.70.92]:38930)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <llloic@gmail.com>) id 1QW8Ug-0006eg-LO
	for coreutils@gnu.org; Mon, 13 Jun 2011 10:51:59 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <llloic@gmail.com>) id 1QW8Ue-0007i0-FK
	for coreutils@gnu.org; Mon, 13 Jun 2011 10:51:58 -0400
Received: from mail-pw0-f41.google.com ([209.85.160.41]:47883)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <llloic@gmail.com>) id 1QW8Ue-0007hs-4b
	for coreutils@gnu.org; Mon, 13 Jun 2011 10:51:56 -0400
Received: by pwi12 with SMTP id 12so2581880pwi.0
	for <coreutils@gnu.org>; Mon, 13 Jun 2011 07:51:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=VLCRiR4nXG2oqkophpg3Uf2GuMevh62RhAeQSXe+MYE=;
	b=QtmUvxbiNeVribLpSNXUGHXxRnbSk9cgSFFTtxWfme7pcDe0tLBTgDwmmi24OwBLcK
	6i0AzFZQ6Ld9SFzTes0JdkTmSDcvdKNrQuhkS4p4eL76CZdz2RQf0QXd3mdSmIpiKHe4
	U4dVpTDZxAmzdEM/pr72plQYQaWvCMAbLAcTQ=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	b=crWMSJKeRQsvlzbK/skRuY2RGJH9nW4kRLRj85EjvmNOo26GPudYcchnWepnR3a6Q6
	xk9dqO4tzWv6JnifClB9OQzTdCAM7rurpjIk+oWI0cm0v8l4YAWZDhshpXvz1pMkvyfh
	w0kixlPzWg4UPECGRYIeSL0BBkthQknz1ivuM=
MIME-Version: 1.0
Received: by 10.142.218.19 with SMTP id q19mr827925wfg.109.1307976714456; Mon,
	13 Jun 2011 07:51:54 -0700 (PDT)
Sender: llloic@gmail.com
Received: by 10.143.41.5 with HTTP; Mon, 13 Jun 2011 07:51:54 -0700 (PDT)
In-Reply-To: <BANLkTi=Prc9WQhJgX486R6RXxPi1fm+Rmw@mail.gmail.com>
References: <BANLkTi=Prc9WQhJgX486R6RXxPi1fm+Rmw@mail.gmail.com>
Date: Mon, 13 Jun 2011 16:51:54 +0200
X-Google-Sender-Auth: s19tyXrmqRJnbAmpsT2pabJ3msc
Message-ID: <BANLkTikN+e=0NhsxOtO4bjyckJDsSEihk-_tZykCKqmZDEiXKQ@mail.gmail.com>
Subject: Re: mkdir inside symlink creates wrong directory with relative parent
From: =?ISO-8859-1?Q?Lo=EFc_Le_Loarer?= <loic.le-loarer@polytechnique.org>
To: =?ISO-8859-2?Q?Old=F8ich_Jedli=E8ka?= <oldium.pro@seznam.cz>
Content-Type: multipart/alternative; boundary=000e0cd3285a708f1304a5990f92
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.160.41
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, 13 Jun 2011 14:52:00 -0000

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

Hi,

This behavior is normal. The key here is the .. link in each directory, it
always points to the parent directory.
For example, in your situation, the ".." in z is x, and it cannot be
something else.
Even if you access to z using the path x/y/z which use the symbolic link,
and then use ".." link, you go to x, not y.

You may have the impression that this is not true if you follow the same
path using your shell, because the shell remember the fact that you use the
symbolic link and don't really use the ".." link. When you do "cd .." in th=
e
shell, it just removes the last element between / in the current path.

I agree that it is a bit strange, but once you understand the fact that eac=
h
directory contains a ".." link which points to one unique location and that
when the path is interpreted by the kernel, it always follows those links,
you understand how it works.

Best regards
Lo=C3=AFc

2011/6/13 Old=C5=99ich Jedli=C4=8Dka <oldium.pro@seznam.cz>

> Hi all,
>
> I was trying to search for any description helping me understand in what =
I
> see, but actually I didn't find any, so I'm here. I discovered it by usin=
g
> automake-1.11, because it uses relative paths a lot. So my simplified
> testcase is as follows:
>
> Have a directory structure x/y and x/z/a. Have a symbolic link from x/y/z
> that points to x/z.
>
>   mkdir -p x/y
>   mkdir -p x/z/a
>   ln -s ../z x/y/z
>
> Now go into x/y/z/a and try to create directory like that:
>
>   cd x/y/z/a
>   mkdir ../dir_xyz
>   mkdir ../../dir_xy
>   mkdir ../../../dir_x
>
> I would expet that there would be a directory like this:
>
>   x/dir_x
>   x/y/dir_xy
>   x/y/z/dir_xyz (x/z/dir_xyz)
>
> But the result is completely different:
>
>   dir_x
>   x/dir_xy
>   x/y/z/dir_xyz (x/z/dir_xyz)
>
> So when you want to create a directory in the parent structure from withi=
n
> the symbolic link, you will fail in doing so, because the symbolic link
> would be resolved during walking through parents, so you can get to
> completely different tree while creating your directory. It looks like a
> bug, because it is nowhere documented to behave like that (and the behavi=
our
> is strange by itself).
>
> Verified on Debian 4.0/RedHat 5.4 with coreutils 5.97 and on Gentoo with
> coreutils 8.12.
>
> Regards,
> Oldrich.
>



--=20
Lo=C3=AFc

--000e0cd3285a708f1304a5990f92
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi,<br><br>This behavior is normal. The key here is the .. link in each dir=
ectory, it always points to the parent directory.<br>For example, in your s=
ituation, the &quot;..&quot; in z is x, and it cannot be something else.<br=
>
Even if you access to z using the path x/y/z which use the symbolic link, a=
nd then use &quot;..&quot; link, you go to x, not y.<br><br>You may have th=
e impression that this is not true if you follow the same path using your s=
hell, because the shell remember the fact that you use the symbolic link an=
d don&#39;t really use the &quot;..&quot; link. When you do &quot;cd ..&quo=
t; in the shell, it just removes the last element between / in the current =
path.<br>
<br>I agree that it is a bit strange, but once you understand the fact that=
 each directory contains a &quot;..&quot; link which points to one unique l=
ocation and that when the path is interpreted by the kernel, it always foll=
ows those links, you understand how it works.<br>
<br>Best regards<br>Lo=C3=AFc<br><br><div class=3D"gmail_quote">2011/6/13 O=
ld=C5=99ich Jedli=C4=8Dka <span dir=3D"ltr">&lt;<a href=3D"http://oldium.pr=
o">oldium.pro</a>@<a href=3D"http://seznam.cz">seznam.cz</a>&gt;</span><br>=
<blockquote class=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; borde=
r-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi all,<br><br>I was trying to search for any description helping me unders=
tand in what I see, but actually I didn&#39;t find any, so I&#39;m here. I =
discovered it by using automake-1.11, because it uses relative paths a lot.=
 So my simplified testcase is as follows:<br>

<br>Have a directory structure x/y and x/z/a. Have a symbolic link from x/y=
/z that points to x/z.<br><br>=C2=A0 mkdir -p x/y<br>=C2=A0 mkdir -p x/z/a<=
br>=C2=A0 ln -s ../z x/y/z<br><br>Now go into x/y/z/a and try to create dir=
ectory like that:<br>

<br>=C2=A0 cd x/y/z/a<br>=C2=A0 mkdir ../dir_xyz<br>=C2=A0 mkdir ../../dir_=
xy<br>=C2=A0 mkdir ../../../dir_x<br><br>I would expet that there would be =
a directory like this:<br><br>=C2=A0 x/dir_x<br>=C2=A0 x/y/dir_xy<br>=C2=A0=
 x/y/z/dir_xyz (x/z/dir_xyz)<br>

<br>But the result is completely different:<br><br>=C2=A0 dir_x<br>=C2=A0 x=
/dir_xy<br>=C2=A0 x/y/z/dir_xyz (x/z/dir_xyz)<br><br>So when you want to cr=
eate a directory in the parent structure from within the symbolic link, you=
 will fail in doing so, because the symbolic link would be resolved during =
walking through parents, so you can get to completely different tree while =
creating your directory. It looks like a bug, because it is nowhere documen=
ted to behave like that (and the behaviour is strange by itself).<br>

<br>Verified on Debian 4.0/RedHat 5.4 with coreutils 5.97 and on Gentoo wit=
h coreutils 8.12.<br><br>Regards,<br>Oldrich.<br>
</blockquote></div><br><br clear=3D"all"><br>-- <br>Lo=C3=AFc<br>

--000e0cd3285a708f1304a5990f92--


From MAILER-DAEMON Mon Jun 13 11:24:14 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QW8zu-0001nZ-Nt
	for mharc-coreutils@gnu.org; Mon, 13 Jun 2011 11:24:14 -0400
Received: from eggs.gnu.org ([140.186.70.92]:60007)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <oldium.pro@googlemail.com>) id 1QW8zs-0001nR-7c
	for coreutils@gnu.org; Mon, 13 Jun 2011 11:24:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <oldium.pro@googlemail.com>) id 1QW8zq-0004eS-PS
	for coreutils@gnu.org; Mon, 13 Jun 2011 11:24:12 -0400
Received: from mail-fx0-f41.google.com ([209.85.161.41]:40408)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <oldium.pro@googlemail.com>) id 1QW8zq-0004bw-KA
	for coreutils@gnu.org; Mon, 13 Jun 2011 11:24:10 -0400
Received: by mail-fx0-f41.google.com with SMTP id 18so3420081fxm.0
	for <coreutils@gnu.org>; Mon, 13 Jun 2011 08:24:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=googlemail.com; s=gamma;
	h=domainkey-signature:sender:from:to:subject:date:user-agent:cc
	:references:in-reply-to:mime-version:content-type
	:content-transfer-encoding:message-id;
	bh=gQVUGyMyQGvJK5zU8zi3XmY3odBvsc62a1G94/vENQY=;
	b=a7EOHt61liC7j+cBTXw0q9UbD4RQRxFMTFOIU8L3WlpKAL3/fyvcw5BpD2si9gDcOB
	5PwnPnIF55IDlk724z0IY5ULsbu0RiHzRxcJMmXWR+6C7xzhJqwEmD+MpI8F75qBCghA
	Nu1gJk5HngpSHafmKIIpaiheEn61w3O9M6Fto=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma;
	h=sender:from:to:subject:date:user-agent:cc:references:in-reply-to
	:mime-version:content-type:content-transfer-encoding:message-id;
	b=HqgGFbc0ej6yuwzbixaL6DiKw0k58RD2Vd46bTijY1KjQk9uUB/EvLLouuKelyhiAq
	qe09H9Z+qgJRBxPsVATG5oehJs/wmkiu9E51lWWqt+25+eAjgRMvdD6V1Obd1hUNbADW
	nqkW+ukdtYGjF3CnZYGL3UQiJA8bqureAUB/I=
Received: by 10.223.17.140 with SMTP id s12mr5284085faa.49.1307978650083;
	Mon, 13 Jun 2011 08:24:10 -0700 (PDT)
Received: from oldium.localnet ([77.48.97.74])
	by mx.google.com with ESMTPS id o23sm2109262faa.9.2011.06.13.08.24.08
	(version=SSLv3 cipher=OTHER); Mon, 13 Jun 2011 08:24:08 -0700 (PDT)
Sender: =?UTF-8?B?T2xkxZlpY2ggSmVkbGnEjWth?= <oldium.pro@googlemail.com>
From: =?utf-8?q?Old=C5=99ich_Jedli=C4=8Dka?= <oldium.pro@seznam.cz>
To: =?utf-8?q?Lo=C3=AFc_Le_Loarer?= <loic.le-loarer@polytechnique.org>
Subject: Re: mkdir inside symlink creates wrong directory with relative parent
Date: Mon, 13 Jun 2011 17:24:05 +0200
User-Agent: KMail/1.13.7 (Linux/2.6.39-drm+; KDE/4.6.3; i686; ; )
References: <BANLkTi=Prc9WQhJgX486R6RXxPi1fm+Rmw@mail.gmail.com>
	<BANLkTikN+e=0NhsxOtO4bjyckJDsSEihk-_tZykCKqmZDEiXKQ@mail.gmail.com>
In-Reply-To: <BANLkTikN+e=0NhsxOtO4bjyckJDsSEihk-_tZykCKqmZDEiXKQ@mail.gmail.com>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Message-Id: <201106131724.06106.oldium.pro@seznam.cz>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.161.41
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, 13 Jun 2011 15:24:13 -0000

Hi Lo=C3=AFc,

Dne pond=C4=9Bl=C3=AD 13 =C4=8Cerven 2011 16:51:54 Lo=C3=AFc Le Loarer naps=
al(a):
> Hi,
>=20
> This behavior is normal. The key here is the .. link in each directory, it
> always points to the parent directory.
> For example, in your situation, the ".." in z is x, and it cannot be
> something else.
> Even if you access to z using the path x/y/z which use the symbolic link,
> and then use ".." link, you go to x, not y.
>=20
> You may have the impression that this is not true if you follow the same
> path using your shell, because the shell remember the fact that you use t=
he
> symbolic link and don't really use the ".." link. When you do "cd .." in
> the shell, it just removes the last element between / in the current path.

Thanks for the explanation, that made the things much clearer. I understand=
=20
now why the "test -d ../../something" doesn't work under the same condition=
s=20
(because the directory really doesn't exist for the program).

But what you say is only part of the story. The script/program has the full=
=20
knowledge od the current working directory and it can do the same trick wit=
h=20
the path traversing - remove the ".." in the same way as the shell would do=
=2E=20
This is normal when you canonicalize the path - remove the ".." from the pa=
th=20
and do not try to dereference. The key is that getcwd() returns really the=
=20
current working directory with symlinks unresolved - this is how the shell=
=20
sees it too.

> I agree that it is a bit strange, but once you understand the fact that
> each directory contains a ".." link which points to one unique location
> and that when the path is interpreted by the kernel, it always follows
> those links, you understand how it works.

Yes. it is strange and the program has the full knowledge to do the right=20
thing (TM) :-) So I think this can be fixed actually.

Best regards,
Oldrich.

>=20
> Best regards
> Lo=C3=AFc
>=20
> 2011/6/13 Old=C5=99ich Jedli=C4=8Dka <oldium.pro@seznam.cz>
>=20
> > Hi all,
> >=20
> > I was trying to search for any description helping me understand in what
> > I see, but actually I didn't find any, so I'm here. I discovered it by
> > using automake-1.11, because it uses relative paths a lot. So my
> > simplified testcase is as follows:
> >=20
> > Have a directory structure x/y and x/z/a. Have a symbolic link from x/y=
/z
> > that points to x/z.
> >=20
> >   mkdir -p x/y
> >   mkdir -p x/z/a
> >   ln -s ../z x/y/z
> >=20
> > Now go into x/y/z/a and try to create directory like that:
> >   cd x/y/z/a
> >   mkdir ../dir_xyz
> >   mkdir ../../dir_xy
> >   mkdir ../../../dir_x
> >=20
> > I would expet that there would be a directory like this:
> >   x/dir_x
> >   x/y/dir_xy
> >   x/y/z/dir_xyz (x/z/dir_xyz)
> >=20
> > But the result is completely different:
> >   dir_x
> >   x/dir_xy
> >   x/y/z/dir_xyz (x/z/dir_xyz)
> >=20
> > So when you want to create a directory in the parent structure from
> > within the symbolic link, you will fail in doing so, because the
> > symbolic link would be resolved during walking through parents, so you
> > can get to completely different tree while creating your directory. It
> > looks like a bug, because it is nowhere documented to behave like that
> > (and the behaviour is strange by itself).
> >=20
> > Verified on Debian 4.0/RedHat 5.4 with coreutils 5.97 and on Gentoo with
> > coreutils 8.12.
> >=20
> > Regards,
> > Oldrich.


From MAILER-DAEMON Mon Jun 13 12:40:47 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QWABy-00053Q-HT
	for mharc-coreutils@gnu.org; Mon, 13 Jun 2011 12:40:46 -0400
Received: from eggs.gnu.org ([140.186.70.92]:41563)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <llloic@gmail.com>) id 1QWABt-000527-7b
	for coreutils@gnu.org; Mon, 13 Jun 2011 12:40:42 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <llloic@gmail.com>) id 1QWABq-00020z-Q8
	for coreutils@gnu.org; Mon, 13 Jun 2011 12:40:40 -0400
Received: from mail-ew0-f41.google.com ([209.85.215.41]:56780)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <llloic@gmail.com>) id 1QWABq-00020g-As
	for coreutils@gnu.org; Mon, 13 Jun 2011 12:40:38 -0400
Received: by ewy9 with SMTP id 9so1907106ewy.0
	for <coreutils@gnu.org>; Mon, 13 Jun 2011 09:40:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	bh=7WJQm1UJUa/mUwvqfn5GcfnjwlnRN65P8UV+TR09Ysk=;
	b=KmnIV9V0Aw49PM7i5+AY298Sk2FPBJQdMW52brb09trmG6JEjcEC60PiJfVZngyJQS
	F/Ge/oNqYZEYzSaAxv7ZrqxwsqK/NWVq+pJywdFxJkcCJPhe8/uvu1eQ7IiMff2fKP5U
	GHbS5cwzctc2AqsKb6qXkxI/6YRkWieROCiCo=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type;
	b=d9JTqbRp880HSD3ylB0cvdLdpBM4s89Y8EFRL8Xe9AJ6fh4D7APQmgubELor9Scnp8
	RE1YoY/l7ooJXyWwLFI5NQ8zgK4Q+nEFrjkZQTcMi9sxFKD4Ll3JsiWcmjmmperv14K5
	gd6cEsF49zzKy4SALop+ukOIOpOLyAOoObCok=
MIME-Version: 1.0
Received: by 10.14.18.19 with SMTP id k19mr2342157eek.166.1307983237233; Mon,
	13 Jun 2011 09:40:37 -0700 (PDT)
Sender: llloic@gmail.com
Received: by 10.14.119.73 with HTTP; Mon, 13 Jun 2011 09:40:36 -0700 (PDT)
In-Reply-To: <201106131724.06106.oldium.pro@seznam.cz>
References: <BANLkTi=Prc9WQhJgX486R6RXxPi1fm+Rmw@mail.gmail.com>
	<BANLkTikN+e=0NhsxOtO4bjyckJDsSEihk-_tZykCKqmZDEiXKQ@mail.gmail.com>
	<201106131724.06106.oldium.pro@seznam.cz>
Date: Mon, 13 Jun 2011 18:40:36 +0200
X-Google-Sender-Auth: za6_gstDRphRi9UZ1x86z9nWY8I
Message-ID: <BANLkTimKkjXHfZEcK=CK1P_MyDA8f-SwjqsjNYHYfRFKC4AKJQ@mail.gmail.com>
Subject: Re: mkdir inside symlink creates wrong directory with relative parent
From: =?ISO-8859-1?Q?Lo=EFc_Le_Loarer?= <loic.le-loarer@polytechnique.org>
To: =?ISO-8859-2?Q?Old=F8ich_Jedli=E8ka?= <oldium.pro@seznam.cz>
Content-Type: multipart/alternative; boundary=0016e65b40c43a3e9c04a59a94d1
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.215.41
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, 13 Jun 2011 16:40:43 -0000

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

Hi Old=C5=99ich,

2011/6/13 Old=C5=99ich Jedli=C4=8Dka <oldium.pro@seznam.cz>

> Dne pond=C4=9Bl=C3=AD 13 =C4=8Cerven 2011 16:51:54 Lo=C3=AFc Le Loarer na=
psal(a):
> > This behavior is normal. The key here is the .. link in each directory,
> it
> > always points to the parent directory.
> > For example, in your situation, the ".." in z is x, and it cannot be
> > something else.
> > Even if you access to z using the path x/y/z which use the symbolic lin=
k,
> > and then use ".." link, you go to x, not y.
> >
> > You may have the impression that this is not true if you follow the sam=
e
> > path using your shell, because the shell remember the fact that you use
> the
> > symbolic link and don't really use the ".." link. When you do "cd .." i=
n
> > the shell, it just removes the last element between / in the current
> path.
>
> Thanks for the explanation, that made the things much clearer. I understa=
nd
> now why the "test -d ../../something" doesn't work under the same
> conditions
> (because the directory really doesn't exist for the program).
>
> But what you say is only part of the story. The script/program has the fu=
ll
> knowledge of the current working directory and it can do the same trick
> with
> the path traversing - remove the ".." in the same way as the shell would
> do.
> This is normal when you canonicalize the path - remove the ".." from the
> path
> and do not try to dereference. The key is that getcwd() returns really th=
e
> current working directory with symlinks unresolved - this is how the shel=
l
> sees it too.
>

I have tested this last sentence, and as far as I can see, getcwd is
returning resolved path. You can check this by doing a small program callin=
g
getcwd system call or by  launching the command "stat /proc/self/cwd", it i=
s
doing the same.

In order to know if the current dir which canonical name is "x/z" has been
accessed using "cd x/z" or cd "x/y/z", the shell store the access path in
PWD. Any script or program can use the PWD variable to mimic the shell
behavior (see man get_current_dir_name), but it is not what is expected fro=
m
mkdir or other basic commands.

When you run the "mkdir ../../dir_xy" command, mkdir command is calling the
mkdir system call with "../../dir_xy" argument, and each part of the
relative part is resolved by the kernel, the first ".." is pointing to the
"x" directory, not the "y". And that's it.

Best regards
Lo=C3=AFc


> > I agree that it is a bit strange, but once you understand the fact that
> > each directory contains a ".." link which points to one unique location
> > and that when the path is interpreted by the kernel, it always follows
> > those links, you understand how it works.
>
> Yes. it is strange and the program has the full knowledge to do the right
> thing (TM) :-) So I think this can be fixed actually.
>
> Best regards,
> Oldrich.
>
> >
> > Best regards
> > Lo=C3=AFc
> >
> > 2011/6/13 Old=C5=99ich Jedli=C4=8Dka <oldium.pro@seznam.cz>
> >
> > > Hi all,
> > >
> > > I was trying to search for any description helping me understand in
> what
> > > I see, but actually I didn't find any, so I'm here. I discovered it b=
y
> > > using automake-1.11, because it uses relative paths a lot. So my
> > > simplified testcase is as follows:
> > >
> > > Have a directory structure x/y and x/z/a. Have a symbolic link from
> x/y/z
> > > that points to x/z.
> > >
> > >   mkdir -p x/y
> > >   mkdir -p x/z/a
> > >   ln -s ../z x/y/z
> > >
> > > Now go into x/y/z/a and try to create directory like that:
> > >   cd x/y/z/a
> > >   mkdir ../dir_xyz
> > >   mkdir ../../dir_xy
> > >   mkdir ../../../dir_x
> > >
> > > I would expet that there would be a directory like this:
> > >   x/dir_x
> > >   x/y/dir_xy
> > >   x/y/z/dir_xyz (x/z/dir_xyz)
> > >
> > > But the result is completely different:
> > >   dir_x
> > >   x/dir_xy
> > >   x/y/z/dir_xyz (x/z/dir_xyz)
> > >
> > > So when you want to create a directory in the parent structure from
> > > within the symbolic link, you will fail in doing so, because the
> > > symbolic link would be resolved during walking through parents, so yo=
u
> > > can get to completely different tree while creating your directory. I=
t
> > > looks like a bug, because it is nowhere documented to behave like tha=
t
> > > (and the behaviour is strange by itself).
> > >
> > > Verified on Debian 4.0/RedHat 5.4 with coreutils 5.97 and on Gentoo
> with
> > > coreutils 8.12.
> > >
> > > Regards,
> > > Oldrich.
>



--=20
Lo=C3=AFc

--0016e65b40c43a3e9c04a59a94d1
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Hi Old=C5=99ich,<br><br><div class=3D"gmail_quote">2011/6/13 Old=C5=99ich J=
edli=C4=8Dka <span dir=3D"ltr">&lt;<a href=3D"http://oldium.pro">oldium.pro=
</a>@<a href=3D"http://seznam.cz">seznam.cz</a>&gt;</span><br><blockquote c=
lass=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px s=
olid rgb(204, 204, 204); padding-left: 1ex;">
Dne pond=C4=9Bl=C3=AD 13 =C4=8Cerven 2011 16:51:54 Lo=C3=AFc Le Loarer naps=
al(a):<br>
<div class=3D"im">&gt; This behavior is normal. The key here is the .. link=
 in each directory, it<br>
&gt; always points to the parent directory.<br>
&gt; For example, in your situation, the &quot;..&quot; in z is x, and it c=
annot be<br>
&gt; something else.<br>
&gt; Even if you access to z using the path x/y/z which use the symbolic li=
nk,<br>
&gt; and then use &quot;..&quot; link, you go to x, not y.<br>
&gt;<br>
&gt; You may have the impression that this is not true if you follow the sa=
me<br>
&gt; path using your shell, because the shell remember the fact that you us=
e the<br>
&gt; symbolic link and don&#39;t really use the &quot;..&quot; link. When y=
ou do &quot;cd ..&quot; in<br>
&gt; the shell, it just removes the last element between / in the current p=
ath.<br>
<br>
</div>Thanks for the explanation, that made the things much clearer. I unde=
rstand<br>
now why the &quot;test -d ../../something&quot; doesn&#39;t work under the =
same conditions<br>
(because the directory really doesn&#39;t exist for the program).<br>
<br>
But what you say is only part of the story. The script/program has the full=
<br>
knowledge of the current working directory and it can do the same trick wit=
h<br>
the path traversing - remove the &quot;..&quot; in the same way as the shel=
l would do.<br>
This is normal when you canonicalize the path - remove the &quot;..&quot; f=
rom the path<br>
and do not try to dereference. The key is that getcwd() returns really the<=
br>
current working directory with symlinks unresolved - this is how the shell<=
br>
sees it too.<br></blockquote><div><br>I have tested this last sentence, and=
 as far as I can see, getcwd is returning resolved path. You can check this=
 by doing a small program calling getcwd system call or by=C2=A0 launching =
the command &quot;stat /proc/self/cwd&quot;, it is doing the same.<br>
<br>In order to know if the  current dir which canonical name is &quot;x/z&=
quot; has been accessed using &quot;cd x/z&quot; or cd &quot;x/y/z&quot;, t=
he shell store the access path in PWD. Any script or program can use the PW=
D variable to mimic the shell=20
behavior (see man get_current_dir_name), but it is not what is expected=20
from mkdir or other basic commands.<br>
<br>When you run the &quot;mkdir ../../dir_xy&quot; command, mkdir command =
is calling the mkdir system call with &quot;../../dir_xy&quot; argument, an=
d each part of the relative part is resolved by the kernel, the first &quot=
;..&quot; is pointing to the &quot;x&quot; directory, not the &quot;y&quot;=
. And that&#39;s it.<br>
<br>Best regards<br>Lo=C3=AFc<br><br></div><blockquote class=3D"gmail_quote=
" style=3D"margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, =
204); padding-left: 1ex;">
<div class=3D"im"><br>
&gt; I agree that it is a bit strange, but once you understand the fact tha=
t<br>
&gt; each directory contains a &quot;..&quot; link which points to one uniq=
ue location<br>
&gt; and that when the path is interpreted by the kernel, it always follows=
<br>
&gt; those links, you understand how it works.<br>
<br>
</div>Yes. it is strange and the program has the full knowledge to do the r=
ight<br>
thing (TM) :-) So I think this can be fixed actually.<br>
<br>
Best regards,<br>
Oldrich.<br>
<div><div></div><div class=3D"h5"><br>
&gt;<br>
&gt; Best regards<br>
&gt; Lo=C3=AFc<br>
&gt;<br>
&gt; 2011/6/13 Old=C5=99ich Jedli=C4=8Dka &lt;<a href=3D"http://oldium.pro"=
 target=3D"_blank">oldium.pro</a>@<a href=3D"http://seznam.cz" target=3D"_b=
lank">seznam.cz</a>&gt;<br>
&gt;<br>
&gt; &gt; Hi all,<br>
&gt; &gt;<br>
&gt; &gt; I was trying to search for any description helping me understand =
in what<br>
&gt; &gt; I see, but actually I didn&#39;t find any, so I&#39;m here. I dis=
covered it by<br>
&gt; &gt; using automake-1.11, because it uses relative paths a lot. So my<=
br>
&gt; &gt; simplified testcase is as follows:<br>
&gt; &gt;<br>
&gt; &gt; Have a directory structure x/y and x/z/a. Have a symbolic link fr=
om x/y/z<br>
&gt; &gt; that points to x/z.<br>
&gt; &gt;<br>
&gt; &gt; =C2=A0 mkdir -p x/y<br>
&gt; &gt; =C2=A0 mkdir -p x/z/a<br>
&gt; &gt; =C2=A0 ln -s ../z x/y/z<br>
&gt; &gt;<br>
&gt; &gt; Now go into x/y/z/a and try to create directory like that:<br>
&gt; &gt; =C2=A0 cd x/y/z/a<br>
&gt; &gt; =C2=A0 mkdir ../dir_xyz<br>
&gt; &gt; =C2=A0 mkdir ../../dir_xy<br>
&gt; &gt; =C2=A0 mkdir ../../../dir_x<br>
&gt; &gt;<br>
&gt; &gt; I would expet that there would be a directory like this:<br>
&gt; &gt; =C2=A0 x/dir_x<br>
&gt; &gt; =C2=A0 x/y/dir_xy<br>
&gt; &gt; =C2=A0 x/y/z/dir_xyz (x/z/dir_xyz)<br>
&gt; &gt;<br>
&gt; &gt; But the result is completely different:<br>
&gt; &gt; =C2=A0 dir_x<br>
&gt; &gt; =C2=A0 x/dir_xy<br>
&gt; &gt; =C2=A0 x/y/z/dir_xyz (x/z/dir_xyz)<br>
&gt; &gt;<br>
&gt; &gt; So when you want to create a directory in the parent structure fr=
om<br>
&gt; &gt; within the symbolic link, you will fail in doing so, because the<=
br>
&gt; &gt; symbolic link would be resolved during walking through parents, s=
o you<br>
&gt; &gt; can get to completely different tree while creating your director=
y. It<br>
&gt; &gt; looks like a bug, because it is nowhere documented to behave like=
 that<br>
&gt; &gt; (and the behaviour is strange by itself).<br>
&gt; &gt;<br>
&gt; &gt; Verified on Debian 4.0/RedHat 5.4 with coreutils 5.97 and on Gent=
oo with<br>
&gt; &gt; coreutils 8.12.<br>
&gt; &gt;<br>
&gt; &gt; Regards,<br>
&gt; &gt; Oldrich.<br>
</div></div></blockquote></div><br><br clear=3D"all"><br>-- <br>Lo=C3=AFc<b=
r>

--0016e65b40c43a3e9c04a59a94d1--


From MAILER-DAEMON Mon Jun 13 12:48:40 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QWAJc-00065r-7Y
	for mharc-coreutils@gnu.org; Mon, 13 Jun 2011 12:48:40 -0400
Received: from eggs.gnu.org ([140.186.70.92]:45692)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <oldium.pro@googlemail.com>) id 1QWAJZ-00065P-T1
	for coreutils@gnu.org; Mon, 13 Jun 2011 12:48:39 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <oldium.pro@googlemail.com>) id 1QWAJX-0003Og-Q9
	for coreutils@gnu.org; Mon, 13 Jun 2011 12:48:37 -0400
Received: from mail-fx0-f41.google.com ([209.85.161.41]:44640)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <oldium.pro@googlemail.com>) id 1QWAJX-0003OL-9k
	for coreutils@gnu.org; Mon, 13 Jun 2011 12:48:35 -0400
Received: by fxm18 with SMTP id 18so3480362fxm.0
	for <coreutils@gnu.org>; Mon, 13 Jun 2011 09:48:34 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=googlemail.com; s=gamma;
	h=domainkey-signature:sender:from:to:subject:date:user-agent:cc
	:references:in-reply-to:mime-version:content-type
	:content-transfer-encoding:message-id;
	bh=AL0dp57LpEcSjIxPMSueOZpwY9YAYa1qsR0Yfot/f7Q=;
	b=bfBlbPnDvtBtaeWn0lUFfw+4SCtTQHDpozde6GHWeEMrmjqezZ3UmcC/0JzBWblfgy
	nnifQ7mHI4P5zmicd/fwxMHtuZdkJMZOQO9LRtYPg7yBHipKtMcjY3iQtQe/9MVVdi8v
	o1Ka4Q+6Cy27+R6YxDka9G479Ighansrg2eeA=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma;
	h=sender:from:to:subject:date:user-agent:cc:references:in-reply-to
	:mime-version:content-type:content-transfer-encoding:message-id;
	b=GLOuMkLX3ibBS0MFhhTp88PAI5pgJVnki3xlpvrsuikHI6xqtmoJvaXLjtEcs+2ByT
	GgsKPHA2SkkH6WCrRQ7hKCysowZtv05ZEMYe64/W5R4G57RhGY+njXpZcLH5KUCE7iOa
	TOW7n4gjq8scRWHvEp0G4WOxP6HTiTaeKB88k=
Received: by 10.223.127.213 with SMTP id h21mr5402130fas.45.1307983713780;
	Mon, 13 Jun 2011 09:48:33 -0700 (PDT)
Received: from oldium.localnet ([77.48.97.74])
	by mx.google.com with ESMTPS id l26sm2139552fah.38.2011.06.13.09.48.31
	(version=SSLv3 cipher=OTHER); Mon, 13 Jun 2011 09:48:32 -0700 (PDT)
Sender: =?UTF-8?B?T2xkxZlpY2ggSmVkbGnEjWth?= <oldium.pro@googlemail.com>
From: =?utf-8?q?Old=C5=99ich_Jedli=C4=8Dka?= <oldium.pro@seznam.cz>
To: =?utf-8?q?Lo=C3=AFc_Le_Loarer?= <loic.le-loarer@polytechnique.org>
Subject: Re: mkdir inside symlink creates wrong directory with relative parent
Date: Mon, 13 Jun 2011 18:48:29 +0200
User-Agent: KMail/1.13.7 (Linux/2.6.39-drm+; KDE/4.6.3; i686; ; )
References: <BANLkTi=Prc9WQhJgX486R6RXxPi1fm+Rmw@mail.gmail.com>
	<201106131724.06106.oldium.pro@seznam.cz>
	<BANLkTimKkjXHfZEcK=CK1P_MyDA8f-SwjqsjNYHYfRFKC4AKJQ@mail.gmail.com>
In-Reply-To: <BANLkTimKkjXHfZEcK=CK1P_MyDA8f-SwjqsjNYHYfRFKC4AKJQ@mail.gmail.com>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Message-Id: <201106131848.30158.oldium.pro@seznam.cz>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.161.41
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, 13 Jun 2011 16:48:39 -0000

Hi Lo=C3=AFc,

Dne pond=C4=9Bl=C3=AD 13 =C4=8Cerven 2011 18:40:36 Lo=C3=AFc Le Loarer naps=
al(a):
> Hi Old=C5=99ich,
>=20
> 2011/6/13 Old=C5=99ich Jedli=C4=8Dka <oldium.pro@seznam.cz>
>=20
> > Dne pond=C4=9Bl=C3=AD 13 =C4=8Cerven 2011 16:51:54 Lo=C3=AFc Le Loarer =
napsal(a):
> > > This behavior is normal. The key here is the .. link in each director=
y,
> >=20
> > it
> >=20
> > > always points to the parent directory.
> > > For example, in your situation, the ".." in z is x, and it cannot be
> > > something else.
> > > Even if you access to z using the path x/y/z which use the symbolic
> > > link, and then use ".." link, you go to x, not y.
> > >=20
> > > You may have the impression that this is not true if you follow the
> > > same path using your shell, because the shell remember the fact that
> > > you use
> >=20
> > the
> >=20
> > > symbolic link and don't really use the ".." link. When you do "cd .."
> > > in the shell, it just removes the last element between / in the
> > > current
> >=20
> > path.
> >=20
> > Thanks for the explanation, that made the things much clearer. I
> > understand now why the "test -d ../../something" doesn't work under the
> > same conditions
> > (because the directory really doesn't exist for the program).
> >=20
> > But what you say is only part of the story. The script/program has the
> > full knowledge of the current working directory and it can do the same
> > trick with
> > the path traversing - remove the ".." in the same way as the shell would
> > do.
> > This is normal when you canonicalize the path - remove the ".." from the
> > path
> > and do not try to dereference. The key is that getcwd() returns really
> > the current working directory with symlinks unresolved - this is how the
> > shell sees it too.
>=20
> I have tested this last sentence, and as far as I can see, getcwd is
> returning resolved path. You can check this by doing a small program
> calling getcwd system call or by  launching the command "stat
> /proc/self/cwd", it is doing the same.
>=20
> In order to know if the current dir which canonical name is "x/z" has been
> accessed using "cd x/z" or cd "x/y/z", the shell store the access path in
> PWD. Any script or program can use the PWD variable to mimic the shell
> behavior (see man get_current_dir_name), but it is not what is expected
> from mkdir or other basic commands.
>=20
> When you run the "mkdir ../../dir_xy" command, mkdir command is calling t=
he
> mkdir system call with "../../dir_xy" argument, and each part of the
> relative part is resolved by the kernel, the first ".." is pointing to the
> "x" directory, not the "y". And that's it.

Ok, sorry for the noise. I did my testing earlier too and mixed up the=20
results. You are completely right, the getcwd() returns the resolved path.

Best regards,
Oldrich.

>=20
> Best regards
> Lo=C3=AFc
>=20
> > > I agree that it is a bit strange, but once you understand the fact th=
at
> > > each directory contains a ".." link which points to one unique locati=
on
> > > and that when the path is interpreted by the kernel, it always follows
> > > those links, you understand how it works.
> >=20
> > Yes. it is strange and the program has the full knowledge to do the rig=
ht
> > thing (TM) :-) So I think this can be fixed actually.
> >=20
> > Best regards,
> > Oldrich.
> >=20
> > > Best regards
> > > Lo=C3=AFc
> > >=20
> > > 2011/6/13 Old=C5=99ich Jedli=C4=8Dka <oldium.pro@seznam.cz>
> > >=20
> > > > Hi all,
> > > >=20
> > > > I was trying to search for any description helping me understand in
> >=20
> > what
> >=20
> > > > I see, but actually I didn't find any, so I'm here. I discovered it
> > > > by using automake-1.11, because it uses relative paths a lot. So my
> > > > simplified testcase is as follows:
> > > >=20
> > > > Have a directory structure x/y and x/z/a. Have a symbolic link from
> >=20
> > x/y/z
> >=20
> > > > that points to x/z.
> > > >=20
> > > >   mkdir -p x/y
> > > >   mkdir -p x/z/a
> > > >   ln -s ../z x/y/z
> > > >=20
> > > > Now go into x/y/z/a and try to create directory like that:
> > > >   cd x/y/z/a
> > > >   mkdir ../dir_xyz
> > > >   mkdir ../../dir_xy
> > > >   mkdir ../../../dir_x
> > > >=20
> > > > I would expet that there would be a directory like this:
> > > >   x/dir_x
> > > >   x/y/dir_xy
> > > >   x/y/z/dir_xyz (x/z/dir_xyz)
> > > >=20
> > > > But the result is completely different:
> > > >   dir_x
> > > >   x/dir_xy
> > > >   x/y/z/dir_xyz (x/z/dir_xyz)
> > > >=20
> > > > So when you want to create a directory in the parent structure from
> > > > within the symbolic link, you will fail in doing so, because the
> > > > symbolic link would be resolved during walking through parents, so
> > > > you can get to completely different tree while creating your
> > > > directory. It looks like a bug, because it is nowhere documented to
> > > > behave like that (and the behaviour is strange by itself).
> > > >=20
> > > > Verified on Debian 4.0/RedHat 5.4 with coreutils 5.97 and on Gentoo
> >=20
> > with
> >=20
> > > > coreutils 8.12.
> > > >=20
> > > > Regards,
> > > > Oldrich.


From MAILER-DAEMON Tue Jun 14 10:14:51 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QWUOJ-00030F-8p
	for mharc-coreutils@gnu.org; Tue, 14 Jun 2011 10:14:51 -0400
Received: from eggs.gnu.org ([140.186.70.92]:36583)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QWUOG-0002zU-4j
	for coreutils@gnu.org; Tue, 14 Jun 2011 10:14:49 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QWUOE-0006p4-0F
	for coreutils@gnu.org; Tue, 14 Jun 2011 10:14:47 -0400
Received: from mx.meyering.net ([82.230.74.64]:36560)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QWUOD-0006oo-HE
	for coreutils@gnu.org; Tue, 14 Jun 2011 10:14:45 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id A0EB760141; Tue, 14 Jun 2011 16:14:44 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH] tests: use printf, not echo in init.sh's warn_ function
Date: Tue, 14 Jun 2011 16:14:44 +0200
Message-ID: <874o3s8ppn.fsf@rho.meyering.net>
Lines: 34
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: 82.230.74.64
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, 14 Jun 2011 14:14:50 -0000

I have been using "warn/die"-style functions like these for a few years,
and they are all based on printf (not echo) for precisely the reasons
listed in the log below.  I'm surprised that I put an echo-based
implementation into the relatively modern "init.sh".

Anyhow, this fixes it:

>From c1aff7b4429ec916f47ce115ab11e06938599e99 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Tue, 14 Jun 2011 15:37:48 +0200
Subject: [PATCH] tests: use printf, not echo in init.sh's warn_ function

* tests/init.sh (warn_): Use printf, not echo.  The latter
would misbehave when given strings containing a backslash
or starting with e.g., -n.
---
 tests/init.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tests/init.sh b/tests/init.sh
index 4a52626..b1b176c 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -74,7 +74,7 @@ Exit () { set +e; (exit $1); exit $1; }
 # the reason for skip/failure to console, rather than to the .log files.
 : ${stderr_fileno_=2}

-warn_ () { echo "$@" 1>&$stderr_fileno_; }
+warn_ () { printf '%s\n' "$@" 1>&$stderr_fileno_; }
 fail_ () { warn_ "$ME_: failed test: $@"; Exit 1; }
 skip_ () { warn_ "$ME_: skipped test: $@"; Exit 77; }
 fatal_ () { warn_ "$ME_: hard error: $@"; Exit 99; }
--
1.7.6.rc0.293.g40857


From MAILER-DAEMON Tue Jun 14 10:26:28 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QWUZX-0005YE-JI
	for mharc-coreutils@gnu.org; Tue, 14 Jun 2011 10:26:27 -0400
Received: from eggs.gnu.org ([140.186.70.92]:40744)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QWUZT-0005XH-Kt
	for coreutils@gnu.org; Tue, 14 Jun 2011 10:26:25 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QWUZL-0000iu-Sg
	for coreutils@gnu.org; Tue, 14 Jun 2011 10:26:23 -0400
Received: from mx1.redhat.com ([209.132.183.28]:60945)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QWUZL-0000ik-Aj
	for coreutils@gnu.org; Tue, 14 Jun 2011 10:26:15 -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 p5EEQDKL020216
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 14 Jun 2011 10:26:13 -0400
Received: from [10.3.113.153] (ovpn-113-153.phx2.redhat.com [10.3.113.153])
	by int-mx12.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id p5EEQC5R024910; Tue, 14 Jun 2011 10:26:13 -0400
Message-ID: <4DF76F84.8020201@redhat.com>
Date: Tue, 14 Jun 2011 08:26:12 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14
	Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
Subject: Re: [PATCH] tests: use printf, not echo in init.sh's warn_ function
References: <874o3s8ppn.fsf@rho.meyering.net>
In-Reply-To: <874o3s8ppn.fsf@rho.meyering.net>
X-Enigmail-Version: 1.1.2
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="------------enig10DB96636FECAE429A07DCB0"
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
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, 14 Jun 2011 14:26:25 -0000

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

On 06/14/2011 08:14 AM, Jim Meyering wrote:
> I have been using "warn/die"-style functions like these for a few years=
,
> and they are all based on printf (not echo) for precisely the reasons
> listed in the log below.  I'm surprised that I put an echo-based
> implementation into the relatively modern "init.sh".
>=20
> Anyhow, this fixes it:

Not quite.

>=20
> -warn_ () { echo "$@" 1>&$stderr_fileno_; }
> +warn_ () { printf '%s\n' "$@" 1>&$stderr_fileno_; }

"warn_ a b" now results in:

a
b

instead of the desired

a b

You want: printf '%s\n' "$*"

--=20
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


--------------enig10DB96636FECAE429A07DCB0
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.11 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJN92+EAAoJEKeha0olJ0NqM4AH/0JpJuKNrcnAFqilsmkfmIa+
yutdFpkiqS7Pn0hOCdenWozNuy5aW2vvMhrFqJXU5xNbuUt2z6wXWzlnyBuiqHWJ
xgY4e1WvCUhFcjN0N4veZSwMmJEWjUSfLuR467m2sCMs7dFQ/9ILI3O53AOBNq8h
J6QqqwJzIgaYT/Df6oEKndgJ7baWIC7H7Q64+fK92MlE4//ZAUFFyCWIqQJeXu8W
FaQbR7RvBW0ViWbMlyAD0Mmk5dpEaGvTeJYNb7lTiT89Q0ImCCYBHUMIW2X7y1H1
A4ue1rc/21M5zyQteEZEPlFWDCAQq4DOuoLikISS0HrbocXpPgTs36/HTHKB+8Y=
=8J9T
-----END PGP SIGNATURE-----

--------------enig10DB96636FECAE429A07DCB0--


From MAILER-DAEMON Tue Jun 14 10:38:41 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QWUlN-0007Rl-2D
	for mharc-coreutils@gnu.org; Tue, 14 Jun 2011 10:38:41 -0400
Received: from eggs.gnu.org ([140.186.70.92]:57730)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QWUlK-0007R0-2K
	for coreutils@gnu.org; Tue, 14 Jun 2011 10:38:39 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QWUlE-00037A-HD
	for coreutils@gnu.org; Tue, 14 Jun 2011 10:38:37 -0400
Received: from mx.meyering.net ([82.230.74.64]:41783)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QWUlE-000371-Ab
	for coreutils@gnu.org; Tue, 14 Jun 2011 10:38:32 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 8E540600CC; Tue, 14 Jun 2011 16:38:31 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Eric Blake <eblake@redhat.com>
Subject: Re: [PATCH] tests: use printf, not echo in init.sh's warn_ function
In-Reply-To: <4DF76F84.8020201@redhat.com> (Eric Blake's message of "Tue, 14
	Jun 2011 08:26:12 -0600")
References: <874o3s8ppn.fsf@rho.meyering.net> <4DF76F84.8020201@redhat.com>
Date: Tue, 14 Jun 2011 16:38:31 +0200
Message-ID: <87y6147a1k.fsf@rho.meyering.net>
Lines: 27
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: 82.230.74.64
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, 14 Jun 2011 14:38:39 -0000

Eric Blake wrote:
> On 06/14/2011 08:14 AM, Jim Meyering wrote:
>> I have been using "warn/die"-style functions like these for a few years,
>> and they are all based on printf (not echo) for precisely the reasons
>> listed in the log below.  I'm surprised that I put an echo-based
>> implementation into the relatively modern "init.sh".
>>
>> Anyhow, this fixes it:
>
> Not quite.
>
>>
>> -warn_ () { echo "$@" 1>&$stderr_fileno_; }
>> +warn_ () { printf '%s\n' "$@" 1>&$stderr_fileno_; }
>
> "warn_ a b" now results in:
>
> a
> b
>
> instead of the desired
>
> a b
>
> You want: printf '%s\n' "$*"

Argh.  Thanks.  Fixed.


From MAILER-DAEMON Tue Jun 14 16:15:11 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QWa11-00012c-9K
	for mharc-coreutils@gnu.org; Tue, 14 Jun 2011 16:15:11 -0400
Received: from eggs.gnu.org ([140.186.70.92]:46926)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <james@youngman.org>) id 1QWa0x-0000zx-UI
	for coreutils@gnu.org; Tue, 14 Jun 2011 16:15:09 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <james@youngman.org>) id 1QWa0v-0004rR-Ru
	for coreutils@gnu.org; Tue, 14 Jun 2011 16:15:07 -0400
Received: from mail-vw0-f41.google.com ([209.85.212.41]:65270)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <james@youngman.org>) id 1QWa0v-0004px-Hc
	for coreutils@gnu.org; Tue, 14 Jun 2011 16:15:05 -0400
Received: by vws4 with SMTP id 4so6209605vws.0
	for <coreutils@gnu.org>; Tue, 14 Jun 2011 13:15:04 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.52.97.99 with SMTP id dz3mr549552vdb.161.1308082504169; Tue,
	14 Jun 2011 13:15:04 -0700 (PDT)
Sender: james@youngman.org
Received: by 10.52.168.132 with HTTP; Tue, 14 Jun 2011 13:15:04 -0700 (PDT)
In-Reply-To: <4DF76F84.8020201@redhat.com>
References: <874o3s8ppn.fsf@rho.meyering.net>
	<4DF76F84.8020201@redhat.com>
Date: Tue, 14 Jun 2011 21:15:04 +0100
X-Google-Sender-Auth: 3zymYk1bghOsesznXcYtS-RurcA
Message-ID: <BANLkTimC0=+MV96gUhmLvYPpfYPGMyaZPg@mail.gmail.com>
Subject: Re: [PATCH] tests: use printf, not echo in init.sh's warn_ function
From: James Youngman <jay@gnu.org>
To: Eric Blake <eblake@redhat.com>
Content-Type: text/plain; charset=UTF-8
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.212.41
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, 14 Jun 2011 20:15:09 -0000

On Tue, Jun 14, 2011 at 3:26 PM, Eric Blake <eblake@redhat.com> wrote:

> You want: printf '%s\n' "$*"

I'd doubt that there are gnulib tests for which this will really make
a difference, but

( IFS=' '; printf '%s\n' "$*"; )

is perhaps slightly more reproducible.

James.


From MAILER-DAEMON Wed Jun 15 16:15:43 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QWwV4-0006xT-D0
	for mharc-coreutils@gnu.org; Wed, 15 Jun 2011 16:15:42 -0400
Received: from eggs.gnu.org ([140.186.70.92]:37324)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QWwV1-0006wh-8B
	for coreutils@gnu.org; Wed, 15 Jun 2011 16:15:40 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QWwUz-00044j-Cy
	for coreutils@gnu.org; Wed, 15 Jun 2011 16:15:39 -0400
Received: from mx.meyering.net ([82.230.74.64]:36235)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>)
	id 1QWwUz-00044b-1n; Wed, 15 Jun 2011 16:15:37 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id EA17A600D4; Wed, 15 Jun 2011 22:15:35 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: James Youngman <jay@gnu.org>
Subject: Re: [PATCH] tests: use printf, not echo in init.sh's warn_ function
In-Reply-To: <BANLkTimC0=+MV96gUhmLvYPpfYPGMyaZPg@mail.gmail.com> (James
	Youngman's message of "Tue, 14 Jun 2011 21:15:04 +0100")
References: <874o3s8ppn.fsf@rho.meyering.net> <4DF76F84.8020201@redhat.com>
	<BANLkTimC0=+MV96gUhmLvYPpfYPGMyaZPg@mail.gmail.com>
Date: Wed, 15 Jun 2011 22:15:35 +0200
Message-ID: <87zkliyhp4.fsf@rho.meyering.net>
Lines: 23
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: 82.230.74.64
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, 15 Jun 2011 20:15:40 -0000

James Youngman wrote:
> I'd doubt that there are gnulib tests for which this will really make
> a difference, but

There is none in coreutils, but there *are* tests there that set IFS.
Just none that use these relatively new functions in an affected scope.

> ( IFS=' '; printf '%s\n' "$*"; )
>
> is perhaps slightly more reproducible.

Good suggestion.  Setting IFS does seem prudent.
However, I'm inclined to use a subshell only if necessary:

warn_ ()
{
  case $IFS in
    ' '*)         printf '%s\n' "$*" 1>&$stderr_fileno_   ;;
    *) ( IFS=' '; printf '%s\n' "$*" 1>&$stderr_fileno_ ) ;;
  esac
}

Thanks!


From MAILER-DAEMON Thu Jun 16 03:00:16 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QX6Yq-0007aD-1S
	for mharc-coreutils@gnu.org; Thu, 16 Jun 2011 03:00:16 -0400
Received: from eggs.gnu.org ([140.186.70.92]:34097)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QX6Ym-0007YW-51
	for coreutils@gnu.org; Thu, 16 Jun 2011 03:00:13 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QX6Yj-00087y-Rr
	for coreutils@gnu.org; Thu, 16 Jun 2011 03:00:11 -0400
Received: from mx.meyering.net ([82.230.74.64]:34825)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>)
	id 1QX6Yj-00087S-Cn; Thu, 16 Jun 2011 03:00:09 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 24A7060145; Thu, 16 Jun 2011 09:00:08 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: "Voelker\, Bernhard" <bernhard.voelker@siemens-enterprise.com>
Subject: Re: [PATCH] tests: use printf, not echo in init.sh's warn_ function
In-Reply-To: <7856072A9D04C24B82DFE2B1112FE38A08807C218F@MCHP058A.global-ad.net>
	(Bernhard Voelker's message of "Thu, 16 Jun 2011 08:49:57 +0200")
References: <874o3s8ppn.fsf@rho.meyering.net> <4DF76F84.8020201@redhat.com>
	<BANLkTimC0=+MV96gUhmLvYPpfYPGMyaZPg@mail.gmail.com>
	<87zkliyhp4.fsf@rho.meyering.net>
	<7856072A9D04C24B82DFE2B1112FE38A08807C218F@MCHP058A.global-ad.net>
Date: Thu, 16 Jun 2011 09:00:08 +0200
Message-ID: <87zkliw9af.fsf@rho.meyering.net>
Lines: 37
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: 82.230.74.64
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: Thu, 16 Jun 2011 07:00:14 -0000

Voelker, Bernhard wrote:

> Jim Meyering wrote:
>> James Youngman wrote:
>>> ( IFS=' '; printf '%s\n' "$*"; )
>>>
>>> is perhaps slightly more reproducible.
>>
>> Good suggestion.  Setting IFS does seem prudent.
>> However, I'm inclined to use a subshell only if necessary:
>>
>> warn_ ()
>> {
>>   case $IFS in
>>     ' '*)         printf '%s\n' "$*" 1>&$stderr_fileno_   ;;
>>     *) ( IFS=' '; printf '%s\n' "$*" 1>&$stderr_fileno_ ) ;;
>>   esac
>> }
>
> is a subshell really needed to change IFS?
>
>   warn_ ()
>   {
>     IFS=' ' printf '%s\n' "$*" 1>&$stderr_fileno_
>   }
>
> or don't all shells understand this?

That would be better -- if it worked.
IFS is a shell variable, not an environment variable.
Try this on the command line:

  stderr_fileno_=2
  warn_ () { IFS=' ' printf '%s\n' "$*" 1>&$stderr_fileno_; }

  $ (IFS=:; warn_ a b)
  a:b


From MAILER-DAEMON Thu Jun 16 09:20:25 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QXCUh-0001yB-Mm
	for mharc-coreutils@gnu.org; Thu, 16 Jun 2011 09:20:23 -0400
Received: from eggs.gnu.org ([140.186.70.92]:60950)
	by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <pth@suse.de>)
	id 1QXCUb-0001uS-6G
	for coreutils@gnu.org; Thu, 16 Jun 2011 09:20:21 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <pth@suse.de>) id 1QXCUZ-0002J5-3w
	for coreutils@gnu.org; Thu, 16 Jun 2011 09:20:16 -0400
Received: from cantor.suse.de ([195.135.220.2]:52152 helo=mx1.suse.de)
	by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <pth@suse.de>)
	id 1QXCUX-0002Hz-M9
	for coreutils@gnu.org; Thu, 16 Jun 2011 09:20:14 -0400
Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.suse.de (Postfix) with ESMTP id 0D52A90975;
	Thu, 16 Jun 2011 14:48:43 +0200 (CEST)
Date: Thu, 16 Jun 2011 14:48:42 +0200
From: Philipp Thomas <pth@suse.de>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Subject: Re: Supporting reflinked/cow files in coreutils
Message-ID: <20110616124842.GG11744@paradies.suse.de>
References: <20110414143352.GC5231@paradies.suse.de>
	<4DA71296.8040000@draigBrady.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
In-Reply-To: <4DA71296.8040000@draigBrady.com>
X-Operating-System: openSUSE - Kernel Linux 3.0.0-rc2-1-desktop x86_64
Organization: SUSE LINUX Products GmbH, =?iso-8859-1?Q?G?=
	=?iso-8859-1?Q?F=3A_Jeff_Hawn=2C_Jennifer_Guild=2C_Felix_Imend=F6rffer=2C?=
	=?iso-8859-1?Q?_HRB_21284_=28AG_N=FCrnberg=29?=
User-Agent: Mutt/1.5.21 (2010-09-15)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6
X-Received-From: 195.135.220.2
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, 16 Jun 2011 13:20:21 -0000

Hi P=E1draig,

* P=E1draig Brady (P@draigBrady.com) [20110414 17:30]:

> Note cp already supports --reflink on BTRFS
> (see clone_file() in copy.c).
> Doing the same mechanism on OCFS2 would be trivial.

I finally got the time to look into copy.c and found the code you're
speaking of. Looking at the ocfs2 code it seems to me that OCFS2_IOC_REFL=
INK
is what is needed for but that is where my knowledge ends. Jeff could you
fill in the pieces needed to make clone_file also work on ocfs2?

Philipp



From MAILER-DAEMON Thu Jun 16 10:15:11 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QXDLh-0007ub-TW
	for mharc-coreutils@gnu.org; Thu, 16 Jun 2011 10:15:10 -0400
Received: from eggs.gnu.org ([140.186.70.92]:52258)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bernhard.voelker@siemens-enterprise.com>)
	id 1QX6Ow-0006LI-Dx
	for coreutils@gnu.org; Thu, 16 Jun 2011 02:50:03 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bernhard.voelker@siemens-enterprise.com>)
	id 1QX6Ov-00066l-DD
	for coreutils@gnu.org; Thu, 16 Jun 2011 02:50:02 -0400
Received: from mail182.messagelabs.com ([85.158.139.83]:43888)
	by eggs.gnu.org with smtp (Exim 4.71)
	(envelope-from <bernhard.voelker@siemens-enterprise.com>)
	id 1QX6Ou-00066I-Vx; Thu, 16 Jun 2011 02:50:01 -0400
X-VirusChecked: Checked
X-Env-Sender: bernhard.voelker@siemens-enterprise.com
X-Msg-Ref: server-13.tower-182.messagelabs.com!1308206998!9169953!1
X-StarScan-Version: 6.2.17; banners=-,-,-
X-Originating-IP: [62.134.46.10]
Received: (qmail 8307 invoked from network); 16 Jun 2011 06:49:58 -0000
Received: from unknown (HELO senmx12-mx) (62.134.46.10)
	by server-13.tower-182.messagelabs.com with SMTP;
	16 Jun 2011 06:49:58 -0000
Received: from MCHP064A.global-ad.net (unknown [172.29.37.63])
	by senmx12-mx (Server) with ESMTP id 31CF923F03E9;
	Thu, 16 Jun 2011 08:49:58 +0200 (CEST)
Received: from MCHP058A.global-ad.net ([172.29.37.57]) by
	MCHP064A.global-ad.net ([172.29.37.63]) with mapi;
	Thu, 16 Jun 2011 08:49:58 +0200
From: "Voelker, Bernhard" <bernhard.voelker@siemens-enterprise.com>
To: Jim Meyering <jim@meyering.net>, James Youngman <jay@gnu.org>
Date: Thu, 16 Jun 2011 08:49:57 +0200
Subject: RE: [PATCH] tests: use printf, not echo in init.sh's warn_ function
Thread-Topic: [PATCH] tests: use printf, not echo in init.sh's warn_ function
Thread-Index: AcwrovvWWX40rV+NQXOe7/JQYp0oFgAThfaw
Message-ID: <7856072A9D04C24B82DFE2B1112FE38A08807C218F@MCHP058A.global-ad.net>
References: <874o3s8ppn.fsf@rho.meyering.net> <4DF76F84.8020201@redhat.com>
	<BANLkTimC0=+MV96gUhmLvYPpfYPGMyaZPg@mail.gmail.com>
	<87zkliyhp4.fsf@rho.meyering.net>
In-Reply-To: <87zkliyhp4.fsf@rho.meyering.net>
Accept-Language: de-DE, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: de-DE, en-US
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6
X-Received-From: 85.158.139.83
X-Mailman-Approved-At: Thu, 16 Jun 2011 10:15:07 -0400
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: Thu, 16 Jun 2011 06:50:03 -0000

Jim Meyering wrote:
> James Youngman wrote:
>> ( IFS=3D' '; printf '%s\n' "$*"; )
>>
>> is perhaps slightly more reproducible.
>
> Good suggestion.  Setting IFS does seem prudent.
> However, I'm inclined to use a subshell only if necessary:
>
> warn_ ()
> {
>   case $IFS in
>     ' '*)         printf '%s\n' "$*" 1>&$stderr_fileno_   ;;
>     *) ( IFS=3D' '; printf '%s\n' "$*" 1>&$stderr_fileno_ ) ;;
>   esac
> }

is a subshell really needed to change IFS?

  warn_ ()
  {
    IFS=3D' '  printf '%s\n' "$*" 1>&$stderr_fileno_
  }

or don't all shells understand this?

Have a nice day,
Berny



From MAILER-DAEMON Thu Jun 16 10:15:11 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QXDLj-0007wa-6K
	for mharc-coreutils@gnu.org; Thu, 16 Jun 2011 10:15:11 -0400
Received: from eggs.gnu.org ([140.186.70.92]:57173)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <inpost@gmail.com>) id 1QX8yO-0000XV-Fq
	for coreutils@gnu.org; Thu, 16 Jun 2011 05:34:52 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <inpost@gmail.com>) id 1QX8yI-0003xi-8R
	for coreutils@gnu.org; Thu, 16 Jun 2011 05:34:48 -0400
Received: from mail-vx0-f169.google.com ([209.85.220.169]:46354)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <inpost@gmail.com>) id 1QX8yH-0003xa-VS
	for coreutils@gnu.org; Thu, 16 Jun 2011 05:34:42 -0400
Received: by vxg38 with SMTP id 38so25553vxg.0
	for <coreutils@gnu.org>; Thu, 16 Jun 2011 02:34:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:date:message-id:subject:from:to
	:content-type:content-transfer-encoding;
	bh=BQ9qzw9FYmp8E36HtxoiqI8jgjuHJf/fC5UuCmWp8/o=;
	b=Q+6i3wQPdGIpxqKZugV+zUApYXnTgIc94wngq7e2Dcv++60ETUBWehhBuDrzsIFBZe
	EwdaEuYGyY8DYwqbxWM1lWCIDnt7IBBXU5bP9LDKpDx4caUJCcdViUQy1uCEoeaNuAJv
	wcil+FUM1Ud7lwL3R50cpu6rk2hdQt/fIDToE=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type
	:content-transfer-encoding;
	b=oWWpF7Np5xxDT1P4ukQYzw5vm4YxHaBbp44k1S6FycYOoCotuVKnp8fVj7pEYGX+/E
	A24y8BrDrlB7sZnBm0ZrTOLuvVGtJpscM5gPepZwsoza8yJQMHBuYx7TZNiXS3hmFskc
	MMN4YzonpCc7+G4lfFgJio245aIOTmUPaga1g=
MIME-Version: 1.0
Received: by 10.220.185.141 with SMTP id co13mr226904vcb.223.1308216880940;
	Thu, 16 Jun 2011 02:34:40 -0700 (PDT)
Received: by 10.220.65.86 with HTTP; Thu, 16 Jun 2011 02:34:40 -0700 (PDT)
Date: Thu, 16 Jun 2011 10:34:40 +0100
Message-ID: <BANLkTi=Twi+ibF_HcK2AYiVr0_xx64vR3A@mail.gmail.com>
Subject: base64 terminal input failure
From: e-letter <inpost@gmail.com>
To: coreutils@gnu.org
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, 2)
X-Received-From: 209.85.220.169
X-Mailman-Approved-At: Thu, 16 Jun 2011 10:15:07 -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: Thu, 16 Jun 2011 09:34:53 -0000

Readers,

I have tried to copy base64 encoded text from the clipboard (i.e. a
web mail message) to the command terminal:

base64 -d 'xyz'

where 'xyz' is the base64 text. According to the manual, standard
input can be accepted if a file is not accepted but instead the
terminal response is:

base64: xyz: No such file or directory

What is my mistake please?

The command:
'echo xyz | base64 -d'

returns:
=EF=BF=BD,base64: invalid input

If the base64 text is saved as a file, conversion is successful.

yours,

mandriva2008
gnome220


From MAILER-DAEMON Thu Jun 16 20:19:16 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QXMmJ-0006MA-Kj
	for mharc-coreutils@gnu.org; Thu, 16 Jun 2011 20:19:15 -0400
Received: from eggs.gnu.org ([140.186.70.92]:51055)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bob@proulx.com>) id 1QXMmG-0006LI-11
	for coreutils@gnu.org; Thu, 16 Jun 2011 20:19:14 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bob@proulx.com>) id 1QXMmE-0005QE-0Z
	for coreutils@gnu.org; Thu, 16 Jun 2011 20:19:11 -0400
Received: from joseki.proulx.com ([216.17.153.58]:59196)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bob@proulx.com>) id 1QXMmD-0005NQ-F1
	for coreutils@gnu.org; Thu, 16 Jun 2011 20:19:09 -0400
Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119])
	by joseki.proulx.com (Postfix) with ESMTP id D6DE321310;
	Thu, 16 Jun 2011 18:19:04 -0600 (MDT)
Received: by hysteria.proulx.com (Postfix, from userid 1000)
	id 8F98C2DC67; Thu, 16 Jun 2011 18:19:04 -0600 (MDT)
Date: Thu, 16 Jun 2011 18:19:04 -0600
From: Bob Proulx <bob@proulx.com>
To: e-letter <inpost@gmail.com>
Subject: Re: base64 terminal input failure
Message-ID: <20110617001904.GA19982@hysteria.proulx.com>
Mail-Followup-To: e-letter <inpost@gmail.com>, coreutils@gnu.org
References: <BANLkTi=Twi+ibF_HcK2AYiVr0_xx64vR3A@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
In-Reply-To: <BANLkTi=Twi+ibF_HcK2AYiVr0_xx64vR3A@mail.gmail.com>
User-Agent: Mutt/1.5.21 (2010-09-15)
Content-Transfer-Encoding: quoted-printable
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, 17 Jun 2011 00:19:14 -0000

e-letter wrote:
> I have tried to copy base64 encoded text from the clipboard (i.e. a
> web mail message) to the command terminal:
>=20
> base64 -d 'xyz'
>=20
> where 'xyz' is the base64 text. According to the manual, standard
> input can be accepted if a file is not accepted but instead the
> terminal response is:
>=20
> base64: xyz: No such file or directory
>=20
> What is my mistake please?

The base64 syntax is:

  base64 [OPTION]... [FILE]

You have specified one option and what appears to the command to be
one file.  The -d fits in the [OPTION] spot and the xyz fits in the
[FILE] spot.

The brackets indicate that those parts are optional.  For [OPTIONS] no
options means to encode.  Specifying -d means to decode.

For [FILE] this means that if a file is specified then the command
will open the file and read it.  If no file is specified on the
command line then it will read standard input.

> The command:
> 'echo xyz | base64 -d'
>=20
> returns:
> =EF=BF=BD,base64: invalid input
>=20
> If the base64 text is saved as a file, conversion is successful.

This is because "xyz" isn't valid base64 encoded data.  It works
successfully if you give it valid input data instead of random
characters.  See this example:

  $ echo foo | base64
  Zm9vCg=3D=3D

  $ echo foo | base64 | base64 -d
  foo

  $ echo Zm9vCg=3D=3D | base64 -d
  foo

As you can see if the input is valid then it will decode it correctly.

Bob


From MAILER-DAEMON Fri Jun 17 04:38:19 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QXUZH-00070y-EB
	for mharc-coreutils@gnu.org; Fri, 17 Jun 2011 04:38:19 -0400
Received: from eggs.gnu.org ([140.186.70.92]:40992)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <inpost@gmail.com>) id 1QXUZD-0006zy-BF
	for coreutils@gnu.org; Fri, 17 Jun 2011 04:38:17 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <inpost@gmail.com>) id 1QXUZ7-0003bV-Q1
	for coreutils@gnu.org; Fri, 17 Jun 2011 04:38:14 -0400
Received: from mail-vx0-f169.google.com ([209.85.220.169]:61563)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <inpost@gmail.com>) id 1QXUZ6-0003bH-NT
	for coreutils@gnu.org; Fri, 17 Jun 2011 04:38:09 -0400
Received: by vxg38 with SMTP id 38so1000082vxg.0
	for <coreutils@gnu.org>; Fri, 17 Jun 2011 01:38:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:in-reply-to:references:date
	:message-id:subject:from:to:content-type:content-transfer-encoding;
	bh=/MUsFzBIxt4so0LNzM4HJ0n1LLQyi5OpgvQbBHtfreY=;
	b=gHtHNv/s6hlpKtoCzkn6bYiH4Gg3HG1QsfiK7E3dgd0yFQ3egT2LO6TQFM3Kfua5cS
	B49fXvSboUmtIKZGzi29mUDCh1UcB7Ox5ys5332BZli4ypGYlInC0zlla2jiDpFTMRxI
	36nh+QcBrVs1gdbxQntQWtZ5mQCHszALm7184=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type:content-transfer-encoding;
	b=irksrAdcUJJjlWZWOCJQqOheiluXdHgEOsBjkloZtOT9T8edxviEA+LSi5ed7OEKYx
	cCr/vtqUAhKkmxC3tZ3f5PKnVNbQhzLSWH2MwcwDXd+gyg94jOXZYWFy9y9lM0YybxnV
	presqLx3D1VLTmD7iLTZELhPidCH3yybTSrKc=
MIME-Version: 1.0
Received: by 10.220.136.2 with SMTP id p2mr72181vct.223.1308299887462; Fri, 17
	Jun 2011 01:38:07 -0700 (PDT)
Received: by 10.220.65.86 with HTTP; Fri, 17 Jun 2011 01:38:07 -0700 (PDT)
In-Reply-To: <20110617001904.GA19982@hysteria.proulx.com>
References: <BANLkTi=Twi+ibF_HcK2AYiVr0_xx64vR3A@mail.gmail.com>
	<20110617001904.GA19982@hysteria.proulx.com>
Date: Fri, 17 Jun 2011 09:38:07 +0100
Message-ID: <BANLkTinUBu0LX651XcH43dNE8e2usi1=ew@mail.gmail.com>
Subject: Re: base64 terminal input failure
From: e-letter <inpost@gmail.com>
To: e-letter <inpost@gmail.com>, coreutils@gnu.org
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, 2)
X-Received-From: 209.85.220.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, 17 Jun 2011 08:38:17 -0000

On 17/06/2011, Bob Proulx <bob@proulx.com> wrote:
> e-letter wrote:
>> I have tried to copy base64 encoded text from the clipboard (i.e. a
>> web mail message) to the command terminal:
>>
>> base64 -d 'xyz'
>>
>> where 'xyz' is the base64 text. According to the manual, standard
>> input can be accepted if a file is not accepted but instead the
>> terminal response is:
>>
>> base64: xyz: No such file or directory
>>
>> What is my mistake please?
>
> The base64 syntax is:
>
>   base64 [OPTION]... [FILE]
>
> You have specified one option and what appears to the command to be
> one file.  The -d fits in the [OPTION] spot and the xyz fits in the
> [FILE] spot.
>
> The brackets indicate that those parts are optional.  For [OPTIONS] no
> options means to encode.  Specifying -d means to decode.
>
> For [FILE] this means that if a file is specified then the command
> will open the file and read it.  If no file is specified on the
> command line then it will read standard input.
>
>> The command:
>> 'echo xyz | base64 -d'
>>
>> returns:
>> =EF=BF=BD,base64: invalid input
>>
>> If the base64 text is saved as a file, conversion is successful.
>
> This is because "xyz" isn't valid base64 encoded data.  It works
> successfully if you give it valid input data instead of random
> characters.  See this example:
>

I wrote 'xyz' not as literal, verbatim encoded text but as an example.
Repeating this as follows causes the same error:

...@localhost ~]$ base64 -d Zm9vCg=3D=3D
base64: Zm9vCg=3D=3D: No such file or directory

>   $ echo foo | base64
>   Zm9vCg=3D=3D
>
>   $ echo foo | base64 | base64 -d
>   foo
>
>   $ echo Zm9vCg=3D=3D | base64 -d
>   foo
>

This occurs, but is not explained in the manual. The manual clearly
states that the option is to be entered before the file/standard
input.


From MAILER-DAEMON Fri Jun 17 09:49:13 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QXZQ8-0004VB-Tw
	for mharc-coreutils@gnu.org; Fri, 17 Jun 2011 09:49:13 -0400
Received: from eggs.gnu.org ([140.186.70.92]:57275)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QXZQ5-0004U7-NG
	for coreutils@gnu.org; Fri, 17 Jun 2011 09:49:10 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QXZPz-0004iP-6V
	for coreutils@gnu.org; Fri, 17 Jun 2011 09:49:09 -0400
Received: from mx.meyering.net ([82.230.74.64]:51996)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QXZPy-0004hk-AM
	for coreutils@gnu.org; Fri, 17 Jun 2011 09:49:02 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id D86A06005D; Fri, 17 Jun 2011 12:04:13 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH] tests: avoid sort-spinlock-abuse false positive under heavy
	load
Date: Fri, 17 Jun 2011 12:04:13 +0200
Message-ID: <87boxwkc4i.fsf@rho.meyering.net>
Lines: 68
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: 82.230.74.64
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, 17 Jun 2011 13:49:11 -0000

I have just seen this unwarranted failure again:

    sort (GNU coreutils) 8.12.86-cd27-dirty
    Copyright (C) 2011 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law.

    Written by Mike Haertel and Paul Eggert.
    + grep '^#define HAVE_PTHREAD_T 1' /h/j/w/co/cu/tests/torture/coreutils/test/coreutils-8.12.86-cd27-dirty/lib/config.h
    + seq 100000
    + mkfifo_or_skip_ fifo
    + test 1 = 1
    + mkfifo fifo
    + ulimit -t 7
    + sort --parallel=2 in
    ++ seq 80
    + for i in '$(seq 80)'
    + read line
    + echo 1
    1
    + sleep .1
    ./misc/sort-spinlock-abuse: line 37: 8828 Killed sort --parallel=2 in > fifo
    + fail=1
    + Exit 1
    + set +e
    + exit 1
    + exit 1
    + remove_tmp_
    + __st=1
    + cleanup_

That was one time too many, so with this change,
the offending test is relegated to being run at least
once per release, when I run the very expensive tests
as outlined in README-release.

>From 640023b63fe4609e6e98b1b988b292ef2707ea60 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Fri, 17 Jun 2011 12:01:10 +0200
Subject: [PATCH] tests: avoid sort-spinlock-abuse false positive under heavy
 load

* tests/misc/sort-spinlock-abuse: Classify as "very expensive" to
avoid unwarranted failure once and for all.
---
 tests/misc/sort-spinlock-abuse |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/tests/misc/sort-spinlock-abuse b/tests/misc/sort-spinlock-abuse
index 4cf8866..0e1c86b 100755
--- a/tests/misc/sort-spinlock-abuse
+++ b/tests/misc/sort-spinlock-abuse
@@ -20,6 +20,12 @@
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
 print_ver_ sort

+# This isn't terribly expensive, but it must not be run under heavy load.
+# Since the "very expensive" are already run only with -j1, adding this
+# test to the list ensures it still gets _some_ (albeit minimal) coverage
+# while not causing false-positive failures in day to day runs.
+very_expensive_
+
 grep '^#define HAVE_PTHREAD_T 1' "$CONFIG_HEADER" > /dev/null ||
   skip_ 'requires pthreads'

--
1.7.6.rc0.293.g40857


From MAILER-DAEMON Fri Jun 17 09:54:11 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QXZUv-0005zS-V2
	for mharc-coreutils@gnu.org; Fri, 17 Jun 2011 09:54:10 -0400
Received: from eggs.gnu.org ([140.186.70.92]:53466)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QXZUs-0005yF-D5
	for coreutils@gnu.org; Fri, 17 Jun 2011 09:54:07 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QXZUp-00063X-Vk
	for coreutils@gnu.org; Fri, 17 Jun 2011 09:54:06 -0400
Received: from mx.meyering.net ([82.230.74.64]:55852)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QXZUp-000630-Hv
	for coreutils@gnu.org; Fri, 17 Jun 2011 09:54:03 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 45A8760408; Fri, 17 Jun 2011 12:15:44 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH] maint: use modules/tempname.diff file, not a replacement;
	update gnulib
Date: Fri, 17 Jun 2011 12:15:44 +0200
Message-ID: <8762o4kblb.fsf@rho.meyering.net>
Lines: 108
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: 82.230.74.64
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, 17 Jun 2011 13:54:08 -0000

A naive update to latest gnulib was failing like this:

    mktemp.o: In function `mkdtemp_len':
    /h/j/w/co/cu/src/mktemp.c:127: undefined reference to `gen_tempname_len'
    mktemp.o: In function `mkstemp_len':
    /h/j/w/co/cu/src/mktemp.c:120: undefined reference to `gen_tempname_len'
    collect2: error: ld returned 1 exit status
    make[3]: *** [mktemp] Error 1
    make[3]: *** Waiting for unfinished jobs....

That was a result of my using a replacement gl/modules/tempname
file rather than a delta: gl/modules/tempname.diff
The recent change to gnulib's modules/tempname would have had
to be propagated to the copy we VC in coreutils.
Rather than do that and risk similar, I am now storing only the delta:


>From 23ddefd3d151fa20169ffb939b8b4b619af88c27 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Fri, 17 Jun 2011 10:02:58 +0200
Subject: [PATCH] maint: use modules/tempname.diff file, not a replacement;
 update gnulib

Using a .diff is much more maintainable.  Otherwise, changes in
the gnulib module description file may not be noticed and merged
promptly and may even result in subtle errors.  Luckily, this time,
the failure to propagate gnulib's changes to modules/tempname resulted
only in an obvious link failure.
* gl/modules/tempname: Remove file.
* gl/modules/tempname.diff: Use a .diff file instead.
* gnulib: Update submodule to latest.
---
 gl/modules/tempname      |   30 ------------------------------
 gl/modules/tempname.diff |   18 ++++++++++++++++++
 gnulib                   |    2 +-
 3 files changed, 19 insertions(+), 31 deletions(-)
 delete mode 100644 gl/modules/tempname
 create mode 100644 gl/modules/tempname.diff

diff --git a/gl/modules/tempname b/gl/modules/tempname
deleted file mode 100644
index 3d84317..0000000
--- a/gl/modules/tempname
+++ /dev/null
@@ -1,30 +0,0 @@
-Description:
-gen_tempname, gen_tempname_len: create a private temporary file or directory.
-
-Files:
-lib/tempname.c
-lib/tempname.h
-m4/tempname.m4
-
-Depends-on:
-extensions
-gettimeofday
-randint
-stdbool
-stdint
-sys_stat
-sys_time
-
-configure.ac:
-gl_FUNC_GEN_TEMPNAME
-
-Makefile.am:
-
-Include:
-"tempname.h"
-
-License:
-LGPL
-
-Maintainer:
-Eric Blake and Jim Meyering
diff --git a/gl/modules/tempname.diff b/gl/modules/tempname.diff
new file mode 100644
index 0000000..c5278d9
--- /dev/null
+++ b/gl/modules/tempname.diff
@@ -0,0 +1,18 @@
+--- /gnulib/modules/tempname	2011-06-17 11:41:46.070787376 +0200
++++ gl/modules/tempname	2011-06-17 11:43:49.571154551 +0200
+@@ -1,2 +1,2 @@
+ Description:
+-gen_tempname() function: create a private temporary file or directory.
++gen_tempname, gen_tempname_len: create a private temporary file or directory.
+
+ Files:
+ lib/tempname.c
+@@ -10,6 +10,8 @@ Depends-on:
+ extensions
+ gettimeofday
+ lstat
++randint
++stdbool
+ stdint
+ sys_stat
+ sys_time
diff --git a/gnulib b/gnulib
index a203d01..6eedb6a 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit a203d01a877e80e8a07147d892ec89a63498f7ff
+Subproject commit 6eedb6a104486c2df4384195e5dfc487d97c5beb
--
1.7.6.rc0.293.g40857


From MAILER-DAEMON Fri Jun 17 10:17:40 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QXZrf-0004aw-Sq
	for mharc-coreutils@gnu.org; Fri, 17 Jun 2011 10:17:40 -0400
Received: from eggs.gnu.org ([140.186.70.92]:57749)
	by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <pth@suse.de>)
	id 1QXZrc-0004Zt-Jn
	for coreutils@gnu.org; Fri, 17 Jun 2011 10:17:37 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <pth@suse.de>) id 1QXZra-0003vk-2s
	for coreutils@gnu.org; Fri, 17 Jun 2011 10:17:36 -0400
Received: from cantor2.suse.de ([195.135.220.15]:60322 helo=mx2.suse.de)
	by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <pth@suse.de>)
	id 1QXZrZ-0003uk-Du
	for coreutils@gnu.org; Fri, 17 Jun 2011 10:17:33 -0400
Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2])
	by mx2.suse.de (Postfix) with ESMTP id D423689E74
	for <coreutils@gnu.org>; Fri, 17 Jun 2011 12:45:49 +0200 (CEST)
Date: Fri, 17 Jun 2011 12:45:49 +0200
From: Philipp Thomas <pth@suse.de>
To: coreutils@gnu.org
Subject: Re: base64 terminal input failure
Message-ID: <20110617104549.GK11744@paradies.suse.de>
References: <BANLkTi=Twi+ibF_HcK2AYiVr0_xx64vR3A@mail.gmail.com>
	<20110617001904.GA19982@hysteria.proulx.com>
	<BANLkTinUBu0LX651XcH43dNE8e2usi1=ew@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <BANLkTinUBu0LX651XcH43dNE8e2usi1=ew@mail.gmail.com>
X-Operating-System: openSUSE - Kernel Linux 3.0.0-rc2-1-desktop x86_64
Organization: SUSE LINUX Products GmbH, =?iso-8859-1?Q?G?=
	=?iso-8859-1?Q?F=3A_Jeff_Hawn=2C_Jennifer_Guild=2C_Felix_Imend=F6rffer=2C?=
	=?iso-8859-1?Q?_HRB_21284_=28AG_N=FCrnberg=29?=
User-Agent: Mutt/1.5.21 (2010-09-15)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6
X-Received-From: 195.135.220.15
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, 17 Jun 2011 14:17:38 -0000

* e-letter (inpost@gmail.com) [20110617 10:38]:

> This occurs, but is not explained in the manual. The manual clearly
> states that the option is to be entered before the file/standard
> input.

But standard input doesn't mean that you can simply pass it the text on the
command line! That means that you pipe the text as Bob showed you.

Philipp


From MAILER-DAEMON Fri Jun 17 12:06:36 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QXbZ5-00034d-IF
	for mharc-coreutils@gnu.org; Fri, 17 Jun 2011 12:06:35 -0400
Received: from eggs.gnu.org ([140.186.70.92]:40334)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <dave_br@gmx.com>) id 1QXZkV-0002Yo-BP
	for coreutils@gnu.org; Fri, 17 Jun 2011 10:10:17 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <dave_br@gmx.com>) id 1QXZkT-000289-ON
	for coreutils@gnu.org; Fri, 17 Jun 2011 10:10:15 -0400
Message-Id: <E1QXZkT-000289-ON@eggs.gnu.org>
Received: from mailout-eu.gmx.com ([213.165.64.42]:45328)
	by eggs.gnu.org with smtp (Exim 4.71)
	(envelope-from <dave_br@gmx.com>) id 1QXZkS-00027G-Lb
	for coreutils@gnu.org; Fri, 17 Jun 2011 10:10:13 -0400
Received: (qmail invoked by alias); 17 Jun 2011 12:23:29 -0000
Received: from 20.Red-81-44-253.staticIP.rima-tde.net (EHLO zoot.sax)
	[81.44.253.20]
	by mail.gmx.com (mp-eu002) with SMTP; 17 Jun 2011 14:23:29 +0200
X-Authenticated: #48875277
X-Provags-ID: V01U2FsdGVkX1++rJcP1ES+nDTQgK7ezsgl2L+b6InZ0z8piSQLac
	wEka9/WgiMooxN
Date: Fri, 17 Jun 2011 14:18:45 +0200
From: Davide Brini <dave_br@gmx.com>
To: coreutils@gnu.org
Subject: Re: base64 terminal input failure
In-Reply-To: <BANLkTinUBu0LX651XcH43dNE8e2usi1=ew@mail.gmail.com>
References: <BANLkTi=Twi+ibF_HcK2AYiVr0_xx64vR3A@mail.gmail.com>
	<20110617001904.GA19982@hysteria.proulx.com>
	<BANLkTinUBu0LX651XcH43dNE8e2usi1=ew@mail.gmail.com>
X-Mailer: Claws Mail 3.7.9 (GTK+ 2.22.1; x86_64-pc-linux-gnu)
User-Agent: 
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Y-GMX-Trusted: 0
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 213.165.64.42
X-Mailman-Approved-At: Fri, 17 Jun 2011 12:06:33 -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: Fri, 17 Jun 2011 14:10:18 -0000

On Fri, 17 Jun 2011 09:38:07 +0100
e-letter <inpost@gmail.com> wrote:

> On 17/06/2011, Bob Proulx <bob@proulx.com> wrote:
> > e-letter wrote:
> >> I have tried to copy base64 encoded text from the clipboard (i.e. a
> >> web mail message) to the command terminal:
> >>
> >> base64 -d 'xyz'
> >>
> >> where 'xyz' is the base64 text. According to the manual, standard
> >> input can be accepted if a file is not accepted but instead the
> >> terminal response is:
> >>
> >> base64: xyz: No such file or directory
> >>
> >> What is my mistake please?
> >
> > The base64 syntax is:
> >
> >   base64 [OPTION]... [FILE]
> >
> > You have specified one option and what appears to the command to be
> > one file.  The -d fits in the [OPTION] spot and the xyz fits in the
> > [FILE] spot.
> >
> > The brackets indicate that those parts are optional.  For [OPTIONS] no
> > options means to encode.  Specifying -d means to decode.
> >
> > For [FILE] this means that if a file is specified then the command
> > will open the file and read it.  If no file is specified on the
> > command line then it will read standard input.
> >
> >> The command:
> >> 'echo xyz | base64 -d'
> >>
> >> returns:
> >> =EF=BF=BD,base64: invalid input
> >>
> >> If the base64 text is saved as a file, conversion is successful.
> >
> > This is because "xyz" isn't valid base64 encoded data.  It works
> > successfully if you give it valid input data instead of random
> > characters.  See this example:
> >
>=20
> I wrote 'xyz' not as literal, verbatim encoded text but as an example.
> Repeating this as follows causes the same error:
>=20
> ...@localhost ~]$ base64 -d Zm9vCg=3D=3D
> base64: Zm9vCg=3D=3D: No such file or directory

Which part of

base64 [OPTION]... [FILE]

is not clear?

--=20
D.


From MAILER-DAEMON Fri Jun 17 12:06:40 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QXbZA-00036c-82
	for mharc-coreutils@gnu.org; Fri, 17 Jun 2011 12:06:40 -0400
Received: from eggs.gnu.org ([140.186.70.92]:38187)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QXTUJ-0004kQ-9m
	for coreutils@gnu.org; Fri, 17 Jun 2011 03:29:12 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QXTUD-0008L2-90
	for coreutils@gnu.org; Fri, 17 Jun 2011 03:29:07 -0400
Received: from mx.meyering.net ([82.230.74.64]:40085)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>)
	id 1QXTUB-0008Kp-Vj; Fri, 17 Jun 2011 03:29:01 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 3B0FF601EE; Fri, 17 Jun 2011 09:28:59 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: James Youngman <jay@gnu.org>
Subject: Re: [PATCH] tests: use printf, not echo in init.sh's warn_ function
In-Reply-To: <87zkliyhp4.fsf@rho.meyering.net> (Jim Meyering's message of
	"Wed, 15 Jun 2011 22:15:35 +0200")
References: <874o3s8ppn.fsf@rho.meyering.net> <4DF76F84.8020201@redhat.com>
	<BANLkTimC0=+MV96gUhmLvYPpfYPGMyaZPg@mail.gmail.com>
	<87zkliyhp4.fsf@rho.meyering.net>
Date: Fri, 17 Jun 2011 09:28:59 +0200
Message-ID: <87fwn8lxvo.fsf@rho.meyering.net>
Lines: 1764
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: 82.230.74.64
X-Mailman-Approved-At: Fri, 17 Jun 2011 12:06:38 -0400
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Fri, 17 Jun 2011 07:29:12 -0000

Jim Meyering wrote:

> James Youngman wrote:
>> I'd doubt that there are gnulib tests for which this will really make
>> a difference, but
>
> There is none in coreutils, but there *are* tests there that set IFS.
> Just none that use these relatively new functions in an affected scope.
>
>> ( IFS=' '; printf '%s\n' "$*"; )
>>
>> is perhaps slightly more reproducible.
>
> Good suggestion.  Setting IFS does seem prudent.
> However, I'm inclined to use a subshell only if necessary:
>
> warn_ ()
> {
>   case $IFS in
>     ' '*)         printf '%s\n' "$*" 1>&$stderr_fileno_   ;;
>     *) ( IFS=' '; printf '%s\n' "$*" 1>&$stderr_fileno_ ) ;;
>   esac
> }

While that duplication isn't too bad, given the second patch below,
you see that it has to be factored anyway.  Once warn_ emits
both to stderr and $stderr_fileno_ (when different),
in coreutils I can finally remove the coreutils-specific
"use skip_test_, not skip_" advice from this copy of init.sh.

The first patch does the above, with the printf code factored into w2_.
The second makes warn_ always emit to stderr (usually the log),
and when $stderr_fileno_ != 2 it also prints the first line to that FD.
The third changes all of coreutils skip_test_ uses back to skip_, now
that init.sh's skip_ is more generally useful for automake-driven tests.


>From 7f8d9892fb4ce29821fc824defaa6e0d32740feb Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Tue, 14 Jun 2011 15:37:48 +0200
Subject: [PATCH 1/3] tests: use printf, not echo in init.sh's warn_ function

* tests/init.sh (warn_): Use printf, not echo.  The latter would
misbehave when given strings containing a backslash or starting
with e.g., -n.  James Youngman suggested setting IFS.
---
 tests/init.sh |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/tests/init.sh b/tests/init.sh
index 4a52626..5f06b5e 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -74,7 +74,17 @@ Exit () { set +e; (exit $1); exit $1; }
 # the reason for skip/failure to console, rather than to the .log files.
 : ${stderr_fileno_=2}

-warn_ () { echo "$@" 1>&$stderr_fileno_; }
+# Call w2_ only via warn_, since correct expansion of "$*" depends on
+# IFS starting with ' '.
+w2_ () { printf '%s\n' "$*" 1>&$stderr_fileno_ ; }
+warn_ ()
+{
+  # If IFS does not start with ' ', set it and emit the warning in a subshell.
+  case $IFS in
+    ' '*) w2_ "$@";;
+    *) (IFS=' '; w2_ "$@");;
+  esac
+}
 fail_ () { warn_ "$ME_: failed test: $@"; Exit 1; }
 skip_ () { warn_ "$ME_: skipped test: $@"; Exit 77; }
 fatal_ () { warn_ "$ME_: hard error: $@"; Exit 99; }
--
1.7.6.rc0.293.g40857


>From 13672ec3211a5a77caf16dc24b83100d57e2a2ec Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Fri, 17 Jun 2011 09:02:09 +0200
Subject: [PATCH 2/3] tests: make init.sh's warn_ emit to both the tty and the
 log file

* tests/init.sh (warn_): When $stderr_fileno_ != 2,
emit the diagnostic to both the tty and the log file.
---
 tests/init.sh |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/tests/init.sh b/tests/init.sh
index 5f06b5e..d7a5d83 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -75,8 +75,12 @@ Exit () { set +e; (exit $1); exit $1; }
 : ${stderr_fileno_=2}

 # Call w2_ only via warn_, since correct expansion of "$*" depends on
-# IFS starting with ' '.
-w2_ () { printf '%s\n' "$*" 1>&$stderr_fileno_ ; }
+# IFS starting with ' '.  Always write the full diagnostic to stderr.
+# When stderr_fileno_ is not 2, also emit the first line of the
+# diagnostic to that file descriptor.
+w2_ () { printf '%s\n' "$*" >&2
+         test $stderr_fileno_ = 2 \
+           || { printf '%s\n' "$*" | head -1 >&$stderr_fileno_ ; } ; }
 warn_ ()
 {
   # If IFS does not start with ' ', set it and emit the warning in a subshell.
--
1.7.6.rc0.293.g40857


>From 2e580ca741b83202e6b22e0bb58b18101a443bd8 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Tue, 14 Jun 2011 16:22:41 +0200
Subject: [PATCH 3/3] tests: remove skip_test_ function; use new skip_ instead

* tests/init.cfg (skip_test_): Remove function.
Use skip_ in place of skip_test_ everywhere else.
* cfg.mk (sc_prohibit_skip_): Remove rule.
* tests/**: Use skip_, not skip_test_, everywhere.
---
 cfg.mk                              |    6 ---
 tests/chgrp/deref                   |    2 +-
 tests/chmod/setgid                  |    2 +-
 tests/chown/separator               |    2 +-
 tests/cp/acl                        |    4 +-
 tests/cp/capability                 |   10 ++--
 tests/cp/cp-a-selinux               |    4 +-
 tests/cp/cp-mv-enotsup-xattr        |   12 +++---
 tests/cp/fiemap-2                   |    2 +-
 tests/cp/fiemap-empty               |   14 +++---
 tests/cp/fiemap-perf                |    8 ++--
 tests/cp/link-symlink               |    4 +-
 tests/cp/preserve-gid               |    2 +-
 tests/cp/preserve-slink-time        |    2 +-
 tests/cp/proc-short-read            |    2 +-
 tests/cp/reflink-perm               |    2 +-
 tests/cp/sparse-fiemap              |    8 ++--
 tests/dd/direct                     |    2 +-
 tests/dd/skip-seek-past-dev         |    2 +-
 tests/df/total-verify               |    2 +-
 tests/du/2g                         |    4 +-
 tests/du/8gb                        |    4 +-
 tests/du/bigtime                    |    6 +-
 tests/du/files0-from-dir            |    2 +-
 tests/du/long-from-unreadable       |    2 +-
 tests/du/long-sloop                 |    2 +-
 tests/du/move-dir-while-traversing  |    2 +-
 tests/du/slink                      |    2 +-
 tests/init.cfg                      |   70 +++++++++++++++--------------------
 tests/init.sh                       |    4 +-
 tests/install/install-C-selinux     |    4 +-
 tests/ls/capability                 |    6 +-
 tests/ls/multihardlink              |    2 +-
 tests/ls/nameless-uid               |    2 +-
 tests/ls/no-cap                     |    2 +-
 tests/ls/readdir-mountpoint-inode   |    6 +-
 tests/ls/stat-dtype                 |    2 +-
 tests/misc/cat-proc                 |    2 +-
 tests/misc/env                      |    2 +-
 tests/misc/nice                     |    2 +-
 tests/misc/od-x8                    |    2 +-
 tests/misc/printenv                 |    2 +-
 tests/misc/pwd-option               |    2 +-
 tests/misc/selinux                  |    2 +-
 tests/misc/seq-long-double          |    2 +-
 tests/misc/sort-continue            |    2 +-
 tests/misc/sort-month               |    2 +-
 tests/misc/sort-spinlock-abuse      |    2 +-
 tests/misc/sort-stale-thread-mem    |    4 +-
 tests/misc/sort-unique-segv         |    2 +-
 tests/misc/stat-nanoseconds         |    2 +-
 tests/misc/stdbuf                   |    2 +-
 tests/misc/stty-row-col             |    4 +-
 tests/misc/tac-continue             |    2 +-
 tests/misc/xattr                    |   26 ++++++------
 tests/mkdir/writable-under-readonly |    2 +-
 tests/mv/acl                        |    4 +-
 tests/mv/i-3                        |    6 +-
 tests/mv/no-target-dir              |    2 +-
 tests/mv/sticky-to-xpart            |    2 +-
 tests/other-fs-tmpdir               |    2 +-
 tests/rm/ext3-perf                  |    4 +-
 tests/rm/fail-2eperm                |    2 +-
 tests/rm/isatty                     |    2 +-
 tests/rm/one-file-system            |    2 +-
 tests/rm/read-only                  |    4 +-
 tests/split/filter                  |    2 +-
 tests/tail-2/append-only            |    2 +-
 tests/tail-2/big-4gb                |    2 +-
 tests/tail-2/inotify-race           |    4 +-
 tests/tail-2/pid                    |    2 +-
 tests/touch/dangling-symlink        |    2 +-
 tests/touch/no-dereference          |    4 +-
 tests/touch/not-owner               |    4 +-
 74 files changed, 158 insertions(+), 174 deletions(-)

diff --git a/cfg.mk b/cfg.mk
index af5542a..6c8acaa 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -221,12 +221,6 @@ sc_prohibit_emacs__indent_tabs_mode__setting:
 	halt='use of emacs indent-tabs-mode: setting'			\
 	  $(_sc_search_regexp)

-# Use skip_test_ rather than init.sh's "skip_" function.
-sc_prohibit_skip_:
-	@prohibit=' skip[_] '						\
-	halt="use init.cfg's skip_test_, not init.sh's skip_"		\
-	  $(_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.
diff --git a/tests/chgrp/deref b/tests/chgrp/deref
index cb66463..d7225d1 100755
--- a/tests/chgrp/deref
+++ b/tests/chgrp/deref
@@ -31,7 +31,7 @@ chgrp -h $g2 symlink 2> /dev/null
 set _ `ls -ln symlink`
 g=$5
 test "$g" = $g2 ||
-  skip_test_ "your system doesn't support changing the owner or group" \
+  skip_ "your system doesn't support changing the owner or group" \
       "of a symbolic link."


diff --git a/tests/chmod/setgid b/tests/chmod/setgid
index 3efffab..364d25d 100755
--- a/tests/chmod/setgid
+++ b/tests/chmod/setgid
@@ -38,7 +38,7 @@ chmod g+s d 2> /dev/null && env -- test -g d ||

 # "chmod g+s d" does nothing on some NFS file systems.
 env -- test -g d ||
-  skip_test_ 'cannot create setgid directories'
+  skip_ 'cannot create setgid directories'


 chmod 755 d
diff --git a/tests/chown/separator b/tests/chown/separator
index 8a11225..c10c5d9 100755
--- a/tests/chown/separator
+++ b/tests/chown/separator
@@ -37,7 +37,7 @@ test -n "$id_gn" || framework_failure
 case $host_triplet in
   *-freebsd6.*)
     case $id_gn in
-      *[^a-zA-Z0-9._-]*) skip_test_ "invalid group name: $id_gn";;
+      *[^a-zA-Z0-9._-]*) skip_ "invalid group name: $id_gn";;
     esac;;
   *) ;;
 esac
diff --git a/tests/cp/acl b/tests/cp/acl
index b99ac6b..8c132a9 100755
--- a/tests/cp/acl
+++ b/tests/cp/acl
@@ -24,7 +24,7 @@ require_acl_

 # Skip this test if cp was built without ACL support:
 grep '^#define USE_ACL 1' $CONFIG_HEADER > /dev/null ||
-  skip_test_ "insufficient ACL support"
+  skip_ "insufficient ACL support"

 mkdir -p a b || framework_failure
 touch a/file || framework_failure
@@ -34,7 +34,7 @@ skip=no
 acl1=`cd a && getfacl file` || skip=yes
 setfacl -m user:bin:rw a/file 2> /dev/null || skip=yes
 test $skip = yes &&
-  skip_test_ "'.' is not on a suitable file system for this test"
+  skip_ "'.' is not on a suitable file system for this test"

 # copy a file without preserving permissions
 cp a/file b/ || fail=1
diff --git a/tests/cp/capability b/tests/cp/capability
index 0106b8b..be5fb08 100755
--- a/tests/cp/capability
+++ b/tests/cp/capability
@@ -23,21 +23,21 @@ working_umask_or_skip_


 grep '^#define HAVE_CAP 1' $CONFIG_HEADER > /dev/null \
-  || skip_test_ "configured without libcap support"
+  || skip_ "configured without libcap support"

 (setcap --help) 2>&1 |grep 'usage: setcap' > /dev/null \
-  || skip_test_ "setcap utility not found"
+  || skip_ "setcap utility not found"
 (getcap --help) 2>&1 |grep 'usage: getcap' > /dev/null \
-  || skip_test_ "getcap utility not found"
+  || skip_ "getcap utility not found"


 touch file || framework_failure
 chown $NON_ROOT_USERNAME file || framework_failure

 setcap 'cap_net_bind_service=ep' file ||
-  skip_test_ "setcap doesn't work"
+  skip_ "setcap doesn't work"
 getcap file | grep cap_net_bind_service >/dev/null ||
-  skip_test_ "getcap doesn't work"
+  skip_ "getcap doesn't work"

 cp --preserve=xattr file copy1 || fail=1

diff --git a/tests/cp/cp-a-selinux b/tests/cp/cp-a-selinux
index 3d55a0f..76684d6 100755
--- a/tests/cp/cp-a-selinux
+++ b/tests/cp/cp-a-selinux
@@ -46,11 +46,11 @@ skip=0
 dd if=/dev/zero of=blob bs=8192 count=200    || skip=1
 mkdir mnt                                    || skip=1
 mkfs -t ext2 -F blob ||
-  skip_test_ "failed to create an ext2 file system"
+  skip_ "failed to create an ext2 file system"

 mount -oloop,context=$ctx blob mnt           || skip=1
 test $skip = 1 \
-  && skip_test_ "insufficient mount/ext2 support"
+  && skip_ "insufficient mount/ext2 support"

 cd mnt                                       || framework_failure

diff --git a/tests/cp/cp-mv-enotsup-xattr b/tests/cp/cp-mv-enotsup-xattr
index 1732e2e..2f26dbd 100755
--- a/tests/cp/cp-mv-enotsup-xattr
+++ b/tests/cp/cp-mv-enotsup-xattr
@@ -39,13 +39,13 @@ make_fs() {
                                                  || skip=1
   mkdir "$where"                                 || skip=1
   mkfs -t ext2 -F "$fs" ||
-    skip_test_ "failed to create ext2 file system"
+    skip_ "failed to create ext2 file system"
   mount -oloop,$opts "$fs" "$where"              || skip=1
   echo test > "$where"/f                         || skip=1
   test -s "$where"/f                             || skip=1

   test $skip = 1 &&
-    skip_test_ "insufficient mount/ext2 support"
+    skip_ "insufficient mount/ext2 support"
 }

 make_fs noxattr nouser_xattr
@@ -57,13 +57,13 @@ xattr_value="bar"
 xattr_pair="$xattr_name=\"$xattr_value\""

 echo test > xattr/a || framework_failure
-getfattr -d xattr/a >out_a || skip_test_ "failed to get xattr of file"
+getfattr -d xattr/a >out_a || skip_ "failed to get xattr of file"
 grep -F "$xattr_pair" out_a >/dev/null && framework_failure
 setfattr -n "$xattr_name" -v "$xattr_value" xattr/a >out_a \
-  || skip_test_ "failed to set xattr of file"
-getfattr -d xattr/a >out_a || skip_test_ "failed to get xattr of file"
+  || skip_ "failed to set xattr of file"
+getfattr -d xattr/a >out_a || skip_ "failed to get xattr of file"
 grep -F "$xattr_pair" out_a >/dev/null \
-  || skip_test_ "failed to set xattr of file"
+  || skip_ "failed to set xattr of file"


 # This should pass without diagnostics
diff --git a/tests/cp/fiemap-2 b/tests/cp/fiemap-2
index 76edd48..691ead2 100755
--- a/tests/cp/fiemap-2
+++ b/tests/cp/fiemap-2
@@ -22,7 +22,7 @@ print_ver_ cp
 # Require a fiemap-enabled FS.
 touch fiemap_chk # check a file rather than current dir for best coverage
 fiemap_capable_ fiemap_chk \
-  || skip_test_ "this file system lacks FIEMAP support"
+  || skip_ "this file system lacks FIEMAP support"

 # Exercise the code that handles a file ending in a hole.
 printf x > k || framework_failure_
diff --git a/tests/cp/fiemap-empty b/tests/cp/fiemap-empty
index 836668e..095d1b7 100755
--- a/tests/cp/fiemap-empty
+++ b/tests/cp/fiemap-empty
@@ -22,18 +22,18 @@ print_ver_ cp
 # FIXME: enable any part of this test that is still relevant,
 # or, if none are relevant (now that cp does not handle unwritten
 # extents), just remove the test altogether.
-skip_test_ 'disabled for now'
+skip_ 'disabled for now'

 touch fiemap_chk
 fiemap_capable_ fiemap_chk ||
-  skip_test_ 'this file system lacks FIEMAP support'
+  skip_ 'this file system lacks FIEMAP support'
 rm fiemap_chk

 # TODO: rather than requiring `fallocate`, possible add
 # this functionality to truncate --alloc
-fallocate --help >/dev/null || skip_test_ 'The fallocate utility is required'
+fallocate --help >/dev/null || skip_ 'The fallocate utility is required'
 fallocate -l 1 -n falloc.test ||
-  skip_test_ 'this file system lacks FALLOCATE support'
+  skip_ 'this file system lacks FALLOCATE support'
 rm falloc.test

 # Require more space than we'll actually use, so that
@@ -44,13 +44,13 @@ rm falloc.test
 require_file_system_bytes_free_ 800000000

 fallocate -l 600MiB space.test ||
-  skip_test_ 'this test needs at least 600MiB free space'
+  skip_ 'this test needs at least 600MiB free space'

 # Disable this test on old BTRFS (e.g. Fedora 14)
 # which reports ordinary extents for unwritten ones.
-filefrag space.test || skip_test_ 'the `filefrag` utility is missing'
+filefrag space.test || skip_ 'the `filefrag` utility is missing'
 filefrag -v space.test | grep -F 'unwritten' > /dev/null ||
-  skip_test_ 'this file system does not report empty extents as "unwritten"'
+  skip_ 'this file system does not report empty extents as "unwritten"'

 rm space.test

diff --git a/tests/cp/fiemap-perf b/tests/cp/fiemap-perf
index 2c56fc8..b17360e 100755
--- a/tests/cp/fiemap-perf
+++ b/tests/cp/fiemap-perf
@@ -22,21 +22,21 @@ print_ver_ cp
 # Require a fiemap-enabled FS.
 touch fiemap_chk
 fiemap_capable_ fiemap_chk ||
-  skip_test_ "this file system lacks FIEMAP support"
+  skip_ "this file system lacks FIEMAP support"

 # Exclude ext3 (or unknown fs types)
 # as the emulated extent scanning is slow
 df -t ext3 . >/dev/null &&
-  skip_test_ "ext3 has known slow FIEMAP scanning"
+  skip_ "ext3 has known slow FIEMAP scanning"

 # Create a large-but-sparse file.
 timeout 10 truncate -s1T f || framework_failure_

 # Disable this test on old BTRFS (e.g. Fedora 14)
 # which reports (unwritten) extents for holes.
-filefrag f || skip_test_ 'the `filefrag` utility is missing'
+filefrag f || skip_ 'the `filefrag` utility is missing'
 filefrag f | grep -F ': 0 extents found' > /dev/null ||
-  skip_test_ 'this file system reports extents for holes'
+  skip_ 'this file system reports extents for holes'

 # Nothing can read (much less write) that many bytes in so little time.
 timeout 10 cp f f2 || fail=1
diff --git a/tests/cp/link-symlink b/tests/cp/link-symlink
index 443b337..0d09f5d 100755
--- a/tests/cp/link-symlink
+++ b/tests/cp/link-symlink
@@ -24,10 +24,10 @@ print_ver_ cp
 touch file
 ln -s file link || framework_failure
 touch -m -h -d 2011-01-01 link ||
-  skip_test_ "Your system doesn't support updating symlink timestamps"
+  skip_ "Your system doesn't support updating symlink timestamps"
 case `stat --format=%y link` in
   2011-01-01*) ;;
-  *) skip_test_ "Your system doesn't support updating symlink timestamps" ;;
+  *) skip_ "Your system doesn't support updating symlink timestamps" ;;
 esac

 # link.cp is probably a hardlink, but may also be a symlink
diff --git a/tests/cp/preserve-gid b/tests/cp/preserve-gid
index de4bc5b..6893ba2 100755
--- a/tests/cp/preserve-gid
+++ b/tests/cp/preserve-gid
@@ -74,7 +74,7 @@ nameless_gid2=`$PERL -le '
 if test -z "$nameless_uid" \
     || test -z "$nameless_gid1" \
     || test -z "$nameless_gid2"; then
-  skip_test_ "couldn't find a nameless UID or GID"
+  skip_ "couldn't find a nameless UID or GID"
 fi

 chown "+$nameless_uid:+0" .
diff --git a/tests/cp/preserve-slink-time b/tests/cp/preserve-slink-time
index 0dd6e7c..0f9bfe5 100755
--- a/tests/cp/preserve-slink-time
+++ b/tests/cp/preserve-slink-time
@@ -21,7 +21,7 @@ print_ver_ cp

 grep '^#define HAVE_UTIMENSAT 1' "$CONFIG_HEADER" > /dev/null ||
 grep '^#define HAVE_LUTIMES 1' "$CONFIG_HEADER" > /dev/null ||
-  skip_test_ 'this system lacks the utimensat function'
+  skip_ 'this system lacks the utimensat function'

 ln -s no-such dangle || framework_failure

diff --git a/tests/cp/proc-short-read b/tests/cp/proc-short-read
index a90446d..2276a6e 100755
--- a/tests/cp/proc-short-read
+++ b/tests/cp/proc-short-read
@@ -21,7 +21,7 @@ print_ver_ cp

 kall=/proc/kallsyms

-test -r $kall || skip_test_ "your system lacks $kall"
+test -r $kall || skip_ "your system lacks $kall"

 # Before coreutils-7.3, cp would copy less than 4KiB of this 1MB+ file.
 cp $kall 1    || fail=1
diff --git a/tests/cp/reflink-perm b/tests/cp/reflink-perm
index 736f33a..367704d 100755
--- a/tests/cp/reflink-perm
+++ b/tests/cp/reflink-perm
@@ -24,7 +24,7 @@ print_ver_ cp
 : > file
 ts='2009-08-28 19:00'
 touch -d "$ts" file || framework_failure
-test time_check -nt file || skip_test_ "The system clock is wrong"
+test time_check -nt file || skip_ "The system clock is wrong"

 chmod a=rwx file || framework_failure
 umask 077
diff --git a/tests/cp/sparse-fiemap b/tests/cp/sparse-fiemap
index 64668ed..3d34077 100755
--- a/tests/cp/sparse-fiemap
+++ b/tests/cp/sparse-fiemap
@@ -18,7 +18,7 @@

 . "${srcdir=.}/init.sh"; path_prepend_ ../src
 print_ver_ cp
-$PERL -e 1 || skip_test_ 'you lack perl'
+$PERL -e 1 || skip_ 'you lack perl'

 # The test was seen to fail on ext3 so exclude that type
 # (or any file system where the type can't be determined)
@@ -28,7 +28,7 @@ if fiemap_capable_ fiemap_chk && ! df -t ext3 . >/dev/null; then
 else
   # FIXME: temporarily(?) skip this variant, at least until after this bug
   # is fixed: http://thread.gmane.org/gmane.comp.file-systems.ext4/24495
-  skip_test_ "current file system has insufficient FIEMAP support"
+  skip_ "current file system has insufficient FIEMAP support"

   # It's not;  we need to create one, hence we need root access.
   require_root_
@@ -41,14 +41,14 @@ else
   dd if=/dev/zero of=blob bs=32k count=1000 || skip=1
   mkdir mnt
   mkfs -t ext4 -F blob ||
-    skip_test_ "failed to create ext4 file system"
+    skip_ "failed to create ext4 file system"
   mount -oloop blob mnt   || skip=1
   cd mnt                  || skip=1
   echo test > f           || skip=1
   test -s f               || skip=1

   test $skip = 1 &&
-    skip_test_ "insufficient mount/ext4 support"
+    skip_ "insufficient mount/ext4 support"
 fi

 # =================================================
diff --git a/tests/dd/direct b/tests/dd/direct
index 6d45ce2..9350545 100755
--- a/tests/dd/direct
+++ b/tests/dd/direct
@@ -21,7 +21,7 @@ print_ver_ dd

 truncate -s 8192 in || framework_failure
 dd if=in oflag=direct of=out 2> /dev/null \
-  || skip_test_ 'this file system lacks support for O_DIRECT'
+  || skip_ 'this file system lacks support for O_DIRECT'

 truncate -s 511 short || framework_failure
 truncate -s 8191 m1 || framework_failure
diff --git a/tests/dd/skip-seek-past-dev b/tests/dd/skip-seek-past-dev
index 59f229f..a54e010 100755
--- a/tests/dd/skip-seek-past-dev
+++ b/tests/dd/skip-seek-past-dev
@@ -36,7 +36,7 @@ get_device_size() {
 device=$(df -P . | tail -n1 | cut -d' ' -f1) || framework_failure

 dev_size=$(get_device_size "$device") ||
-  skip_test_ "failed to determine size of $device"
+  skip_ "failed to determine size of $device"

 # Don't use shell arithmetic as older versions of dash use longs
 DEV_OFLOW=$(expr $dev_size + 1)
diff --git a/tests/df/total-verify b/tests/df/total-verify
index 7eaf4ff..bc9c99e 100755
--- a/tests/df/total-verify
+++ b/tests/df/total-verify
@@ -19,7 +19,7 @@
 . "${srcdir=.}/init.sh"; path_prepend_ ../src
 print_ver_ df

-df || skip_test_ "df fails"
+df || skip_ "df fails"

 cat <<\EOF > check-df || framework_failure
 my ($total, $used, $avail) = (0, 0, 0);
diff --git a/tests/du/2g b/tests/du/2g
index 553dc50..280ba30 100755
--- a/tests/du/2g
+++ b/tests/du/2g
@@ -33,14 +33,14 @@ very_expensive_
 free_kb=`df -kP .|tail -1|sed 's/ [0-9][0-9]*%.*//;s/ *$//;s/.* //'`
 case "$free_kb" in
   [0-9]*) ;;
-  *) skip_test_ "invalid size from df: $free_kb";;
+  *) skip_ "invalid size from df: $free_kb";;
 esac

 # Require about 3GB free.
 min_kb=3000000
 test $min_kb -lt $free_kb ||
 {
-  skip_test_ \
+  skip_ \
     "too little free space on current partition: $free_kb (need $min_kb KB)"
 }

diff --git a/tests/du/8gb b/tests/du/8gb
index 2bd4306..ab283e4 100755
--- a/tests/du/8gb
+++ b/tests/du/8gb
@@ -23,7 +23,7 @@ require_sparse_support_

 dd bs=1 seek=8G of=big < /dev/null 2> /dev/null
 if test $? != 0; then
-  skip_test_ 'cannot create a file large enough for this test; possibly
+  skip_ 'cannot create a file large enough for this test; possibly
 because file offsets are only 32 bits on this file system'
 fi

@@ -35,7 +35,7 @@ fi
 set x `ls -gG big`
 size=$4
 if test "$size" = 0; then
-  skip_test_ "cannot create a file large enough for this test
+  skip_ "cannot create a file large enough for this test
 possibly because this system's NFS support is buggy
 Consider rerunning this test on a different file system."
 fi
diff --git a/tests/du/bigtime b/tests/du/bigtime
index 1498719..b33b801 100755
--- a/tests/du/bigtime
+++ b/tests/du/bigtime
@@ -30,11 +30,11 @@ case "$future_time" in
 *" $bignum "*)
   : ;;
 *' Dec  4  300627798676 '*)
-  skip_test_ "file system and localtime both handle big timestamps" ;;
+  skip_ "file system and localtime both handle big timestamps" ;;
 *)
-  skip_test_ "file system or localtime mishandles big time stamps:" \
+  skip_ "file system or localtime mishandles big time stamps:" \
       "$future_time" ;;
-esac || skip_test_ "file system cannot represent big time stamps"
+esac || skip_ "file system cannot represent big time stamps"

 printf "0\t$bignum\tfuture\n" > exp || framework_failure_
 printf "du: time $bignum is out of range\n" > err_ok || framework_failure_
diff --git a/tests/du/files0-from-dir b/tests/du/files0-from-dir
index a722122..fc1e184 100755
--- a/tests/du/files0-from-dir
+++ b/tests/du/files0-from-dir
@@ -25,7 +25,7 @@ mkdir dir
 # In that case, using --files0-from=dir would yield garbage,
 # interpreting the directory entry as a sequence of
 # NUL-separated file names.
-cat dir > /dev/null && skip_test_ "cat dir/ succeeds"
+cat dir > /dev/null && skip_ "cat dir/ succeeds"

 for prog in du wc; do
   $prog --files0-from=dir > /dev/null 2>err && fail=1
diff --git a/tests/du/long-from-unreadable b/tests/du/long-from-unreadable
index 43ef60d..92cd378 100755
--- a/tests/du/long-from-unreadable
+++ b/tests/du/long-from-unreadable
@@ -33,7 +33,7 @@ print_ver_ du

 proc_file=/proc/self/fd
 if test ! -d $proc_file; then
-  skip_test_ 'This test would fail, since your system lacks /proc support.'
+  skip_ 'This test would fail, since your system lacks /proc support.'
 fi

 dir=`printf '%200s\n' ' '|tr ' ' x`
diff --git a/tests/du/long-sloop b/tests/du/long-sloop
index 117e9da..1f46a4a 100755
--- a/tests/du/long-sloop
+++ b/tests/du/long-sloop
@@ -54,7 +54,7 @@ echo foo > $i
 # name traversal exceeds MAXSYMLINKS'.

 cat $file > /dev/null 2> err &&
-    skip_test_ 'Your system appears to be able to handle more than $n symlinks
+    skip_ 'Your system appears to be able to handle more than $n symlinks
 in file name resolution'
 too_many=`sed 's/.*: //' err`

diff --git a/tests/du/move-dir-while-traversing b/tests/du/move-dir-while-traversing
index 0270389..68302b8 100755
--- a/tests/du/move-dir-while-traversing
+++ b/tests/du/move-dir-while-traversing
@@ -21,7 +21,7 @@ print_ver_ du

 # We use a python-inotify script, so...
 python -m pyinotify -h > /dev/null \
-  || skip_test_ 'python inotify package not installed'
+  || skip_ 'python inotify package not installed'

 # Move a directory "up" while du is processing its sub-directories.
 # While du is processing a hierarchy .../B/C/D/... this script
diff --git a/tests/du/slink b/tests/du/slink
index c20d753..7f6c79d 100755
--- a/tests/du/slink
+++ b/tests/du/slink
@@ -27,7 +27,7 @@ require_local_dir_
 if df --type=xfs . >/dev/null 2>&1; then
   # At least on Irix-6.5.19, when using an xfs file system,
   # each created symlink (name lengths up to 255) would have a size of `0'.
-  skip_test_ "\`.' is on an XFS file system"
+  skip_ "\`.' is on an XFS file system"
 fi

 symlink_name_lengths='1 15 16 31 32 59 60 63 64 127 128 255 256 511 512 1024'
diff --git a/tests/init.cfg b/tests/init.cfg
index 795f23c..1b8f870 100644
--- a/tests/init.cfg
+++ b/tests/init.cfg
@@ -34,16 +34,6 @@ sanitize_path_()
   export PATH
 }

-# Use this function rather than init.sh's skip_.
-# The "skip_" function emits its diagnostic only to one stream.
-# This one emits it both to the tty and to the log file.
-skip_test_()
-{
-  echo "$0: skipping test: $@" | head -1 1>&9
-  echo "$0: skipping test: $@" 1>&2
-  Exit 77
-}
-
 getlimits_()
 {
   eval $(getlimits)
@@ -55,10 +45,10 @@ require_acl_()
 {
   getfacl --version < /dev/null > /dev/null 2>&1 \
     && setfacl --version < /dev/null > /dev/null 2>&1 \
-      || skip_test_ "This test requires getfacl and setfacl."
+      || skip_ "This test requires getfacl and setfacl."

   id -u bin > /dev/null 2>&1 \
-    || skip_test_ "This test requires a local user named bin."
+    || skip_ "This test requires a local user named bin."
 }

 is_local_dir_()
@@ -70,14 +60,14 @@ is_local_dir_()
 require_local_dir_()
 {
   is_local_dir_ . ||
-    skip_test_ "This test must be run on a local file system."
+    skip_ "This test must be run on a local file system."
 }

 # Skip this test if we're not in SELinux "enforcing" mode.
 require_selinux_enforcing_()
 {
   test "$(getenforce)" = Enforcing \
-    || skip_test_ "This test is useful only with SELinux in Enforcing mode."
+    || skip_ "This test is useful only with SELinux in Enforcing mode."
 }

 require_openat_support_()
@@ -85,13 +75,13 @@ require_openat_support_()
   # Skip this test if your system has neither the openat-style functions
   # nor /proc/self/fd support with which to emulate them.
   test -z "$CONFIG_HEADER" \
-    && skip_test_ 'internal error: CONFIG_HEADER not defined'
+    && skip_ 'internal error: CONFIG_HEADER not defined'

   _skip=yes
   grep '^#define HAVE_OPENAT' "$CONFIG_HEADER" > /dev/null && _skip=no
   test -d /proc/self/fd && _skip=no
   if test $_skip = yes; then
-    skip_test_ 'this system lacks openat support'
+    skip_ 'this system lacks openat support'
   fi
 }

@@ -107,12 +97,12 @@ require_ulimit_()
   ( ulimit -v 20;    date ) > /dev/null 2>&1 && ulimit_works=no

   test $ulimit_works = no \
-    && skip_test_ "this shell lacks ulimit support"
+    && skip_ "this shell lacks ulimit support"
 }

 require_readable_root_()
 {
-  test -r / || skip_test_ "/ is not readable"
+  test -r / || skip_ "/ is not readable"
 }

 # Skip the current test if strace is not available or doesn't work
@@ -122,10 +112,10 @@ require_strace_()
   test $# = 1 || framework_failure

   strace -V < /dev/null > /dev/null 2>&1 ||
-    skip_test_ 'no strace program'
+    skip_ 'no strace program'

   strace -qe "$1" echo > /dev/null 2>&1 ||
-    skip_test_ 'strace -qe "'"$1"'" does not work'
+    skip_ 'strace -qe "'"$1"'" does not work'
 }

 # Require a controlling input `terminal'.
@@ -134,7 +124,7 @@ require_controlling_input_terminal_()
   tty -s || have_input_tty=no
   test -t 0 || have_input_tty=no
   if test "$have_input_tty" = no; then
-    skip_test_ 'requires controlling input terminal
+    skip_ 'requires controlling input terminal
 This test must have a controlling input "terminal", so it may not be
 run via "batch", "at", or "ssh".  On some systems, it may not even be
 run in the background.'
@@ -151,7 +141,7 @@ require_built_()
     esac
   done

-  test $skip_ = yes && skip_test_ "required program(s) not built"
+  test $skip_ = yes && skip_ "required program(s) not built"
 }

 require_file_system_bytes_free_()
@@ -159,7 +149,7 @@ require_file_system_bytes_free_()
   local req=$1
   local expr=$(stat -f --printf "$req / %S <= %a" .)
   awk "BEGIN{ exit !($expr) }" \
-    || skip_test_ "this test needs at least $req bytes of free space"
+    || skip_ "this test needs at least $req bytes of free space"
 }

 uid_is_privileged_()
@@ -219,8 +209,8 @@ rwx_to_mode_()
 skip_if_()
 {
   case $1 in
-    root) skip_test_ must be run as root ;;
-    non-root) skip_test_ must be run as non-root ;;
+    root) skip_ must be run as root ;;
+    non-root) skip_ must be run as non-root ;;
     *) ;;  # FIXME?
   esac
 }
@@ -230,13 +220,13 @@ require_selinux_()
   # When in a chroot of an SELinux-enabled system, but with a mock-simulated
   # SELinux-*disabled* system, recognize that SELinux is disabled system wide:
   grep 'selinuxfs$' /proc/filesystems > /dev/null \
-    || skip_test_ "this system lacks SELinux support"
+    || skip_ "this system lacks SELinux support"

   # Independent of whether SELinux is enabled system-wide,
   # the current file system may lack SELinux support.
   case `ls -Zd .` in
     '? .'|'unlabeled .')
-      skip_test_ "this system (or maybe just" \
+      skip_ "this system (or maybe just" \
         "the current file system) lacks SELinux support"
     ;;
   esac
@@ -245,7 +235,7 @@ require_selinux_()
 very_expensive_()
 {
   if test "$RUN_VERY_EXPENSIVE_TESTS" != yes; then
-    skip_test_ 'very expensive: disabled by default
+    skip_ 'very expensive: disabled by default
 This test is very expensive, so it is disabled by default.
 To run it anyway, rerun make check with the RUN_VERY_EXPENSIVE_TESTS
 environment variable set to yes.  E.g.,
@@ -258,7 +248,7 @@ environment variable set to yes.  E.g.,
 expensive_()
 {
   if test "$RUN_EXPENSIVE_TESTS" != yes; then
-    skip_test_ 'expensive: disabled by default
+    skip_ 'expensive: disabled by default
 This test is relatively expensive, so it is disabled by default.
 To run it anyway, rerun make check with the RUN_EXPENSIVE_TESTS
 environment variable set to yes.  E.g.,
@@ -270,12 +260,12 @@ environment variable set to yes.  E.g.,

 require_root_()
 {
-  uid_is_privileged_ || skip_test_ "must be run as root"
+  uid_is_privileged_ || skip_ "must be run as root"
   NON_ROOT_USERNAME=${NON_ROOT_USERNAME=nobody}
   NON_ROOT_GROUP=${NON_ROOT_GROUP=$(id -g $NON_ROOT_USERNAME)}
 }

-skip_if_root_() { uid_is_privileged_ && skip_test_ "must be run as non-root"; }
+skip_if_root_() { uid_is_privileged_ && skip_ "must be run as non-root"; }
 error_() { echo "$0: $@" 1>&2; Exit 1; }
 framework_failure() { error_ 'failure in testing framework'; }

@@ -288,7 +278,7 @@ require_membership_in_two_groups_()
   groups=${COREUTILS_GROUPS-`(id -G || /usr/xpg4/bin/id -G) 2>/dev/null`}
   case "$groups" in
     *' '*) ;;
-    *) skip_test_ 'requires membership in two groups
+    *) skip_ 'requires membership in two groups
 this test requires that you be a member of more than one group,
 but running `id -G'\'' either failed or found just one.  If you really
 are a member of at least two groups, then rerun this test with
@@ -309,7 +299,7 @@ require_proc_pid_status_()
     local pid=$!
     sleep .5
     grep '^State:[	 ]*[S]' /proc/$pid/status > /dev/null 2>&1 ||
-    skip_test_ "/proc/$pid/status: missing or 'different'"
+    skip_ "/proc/$pid/status: missing or 'different'"
     kill $pid
 }

@@ -329,10 +319,10 @@ fiemap_capable_()
 require_dirent_d_type_()
 {
   python < /dev/null \
-    || skip_test_ python missing: assuming no d_type support
+    || skip_ python missing: assuming no d_type support

   python $abs_srcdir/d_type-check \
-    || skip_test_ requires d_type support
+    || skip_ requires d_type support
 }

 # Does the current (working-dir) file system support sparse files?
@@ -348,7 +338,7 @@ require_sparse_support_()
   kb_size=$2
   rm -f $t
   if test $kb_size -ge 128; then
-    skip_test_ 'this file system does not support sparse files'
+    skip_ 'this file system does not support sparse files'
   fi
 }

@@ -360,7 +350,7 @@ mkfifo_or_skip_()
     # failure as a test failure.  However, in this case, when running on a SunOS
     # system using a disk NFS mounted from OpenBSD, the above fails like this:
     # mkfifo: cannot make fifo `fifo-10558': Not owner
-    skip_test_ 'unable to create a fifo'
+    skip_ 'unable to create a fifo'
   fi
 }

@@ -375,7 +365,7 @@ skip_if_setgid_()
   case $perms in
     drwx------);;
     drwxr-xr-x);;  # Windows98 + DJGPP 2.03
-    *) skip_test_ 'this directory has the setgid bit set';;
+    *) skip_ 'this directory has the setgid bit set';;
   esac
 }

@@ -390,7 +380,7 @@ skip_if_mcstransd_is_running_()
   case $__ctx in
     *:*:*:*) ;; # four components is ok
     *) # anything else probably means mcstransd is running
-        skip_test_ "unexpected context '$__ctx'; turn off mcstransd" ;;
+        skip_ "unexpected context '$__ctx'; turn off mcstransd" ;;
   esac
 }

@@ -407,7 +397,7 @@ working_umask_or_skip_()

   case $perms in
   *'
-  '*) skip_test_ 'your build directory has unusual umask semantics'
+  '*) skip_ 'your build directory has unusual umask semantics'
   esac
 }

diff --git a/tests/init.sh b/tests/init.sh
index d7a5d83..b857730 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -32,7 +32,7 @@
 #   or perhaps export PATH='$(abs_top_builddir)/src$(PATH_SEPARATOR)'"$$PATH"
 #   to all tests via automake's TESTS_ENVIRONMENT.
 #   Set the exit code 0 for success, 77 for skipped, or 1 or other for failure.
-#   Use the skip_test_ and fail_ functions to print a diagnostic and then exit
+#   Use the skip_ and fail_ functions to print a diagnostic and then exit
 #   with the corresponding exit code.
 #   Exit $?

@@ -163,7 +163,7 @@ else
     # If we've made it all the way to the sentinel, "fail" without
     # finding even a marginal shell, skip this test.
     if test "$re_shell_" = fail; then
-      test -z "$marginal_" && skip_test_ failed to find an adequate shell
+      test -z "$marginal_" && skip_ failed to find an adequate shell
       re_shell_=$marginal_
       break
     fi
diff --git a/tests/install/install-C-selinux b/tests/install/install-C-selinux
index 426beb8..072297d 100755
--- a/tests/install/install-C-selinux
+++ b/tests/install/install-C-selinux
@@ -22,7 +22,7 @@ require_selinux_


 echo test > a || framework_failure
-chcon -u system_u a || skip_test_ "chcon doesn't work"
+chcon -u system_u a || skip_ "chcon doesn't work"

 echo "\`a' -> \`b'" > out_installed_first
 echo "removed \`b'
@@ -42,7 +42,7 @@ ginstall -v --preserve-context a b > out || fail=1
 compare out out_installed_second || fail=1

 # destination file exists but SELinux context differs
-chcon -u unconfined_u a || skip_test_ "chcon doesn't work"
+chcon -u unconfined_u a || skip_ "chcon doesn't work"
 ginstall -Cv --preserve-context a b > out || fail=1
 compare out out_installed_second || fail=1
 ginstall -Cv --preserve-context a b > out || fail=1
diff --git a/tests/ls/capability b/tests/ls/capability
index 9cc8ba2..c4762c9 100755
--- a/tests/ls/capability
+++ b/tests/ls/capability
@@ -21,10 +21,10 @@ print_ver_ ls
 require_root_

 grep '^#define HAVE_CAP 1' $CONFIG_HEADER > /dev/null \
-  || skip_test_ "configured without libcap support"
+  || skip_ "configured without libcap support"

 (setcap --help) 2>&1 |grep 'usage: setcap' > /dev/null \
-  || skip_test_ "setcap utility not found"
+  || skip_ "setcap utility not found"

 # Don't let a different umask perturb the results.
 umask 22
@@ -38,7 +38,7 @@ cd test
 touch cap_pos dir/cap_pos dir/cap_neg
 for file in cap_pos dir/cap_neg; do
   setcap 'cap_net_bind_service=ep' $file ||
-    skip_test_ "setcap doesn't work"
+    skip_ "setcap doesn't work"
 done

 code='30;41'
diff --git a/tests/ls/multihardlink b/tests/ls/multihardlink
index cf7db21..a9d31f4 100755
--- a/tests/ls/multihardlink
+++ b/tests/ls/multihardlink
@@ -21,7 +21,7 @@ print_ver_ ls
 working_umask_or_skip_

 touch file file1 || framework_failure
-ln file1 file2 || skip_test_ "can't create hard link"
+ln file1 file2 || skip_ "can't create hard link"
 code_mh='44;37'
 code_ex='01;32'
 code_png='01;35'
diff --git a/tests/ls/nameless-uid b/tests/ls/nameless-uid
index 7bd4f0e..a0de6ce 100755
--- a/tests/ls/nameless-uid
+++ b/tests/ls/nameless-uid
@@ -29,7 +29,7 @@ nameless_uid=`$PERL -e '
 '`

 if test x$nameless_uid = x; then
-  skip_test_ "couldn't find a nameless UID"
+  skip_ "couldn't find a nameless UID"
 fi

 touch f || framework_failure
diff --git a/tests/ls/no-cap b/tests/ls/no-cap
index 193aea3..2cca71c 100755
--- a/tests/ls/no-cap
+++ b/tests/ls/no-cap
@@ -21,7 +21,7 @@ print_ver_ ls
 require_strace_ capget

 strace -e capget ls --color=always > /dev/null 2> out || fail=1
-$EGREP 'capget\(' out || skip_test_ "your ls doesn't call capget"
+$EGREP 'capget\(' out || skip_ "your ls doesn't call capget"

 rm -f out
 eval "$(TERM=xterm dircolors -b | sed 's/ca=[^:]*:/ca=:/')"
diff --git a/tests/ls/readdir-mountpoint-inode b/tests/ls/readdir-mountpoint-inode
index bd827ac..83e67b0 100755
--- a/tests/ls/readdir-mountpoint-inode
+++ b/tests/ls/readdir-mountpoint-inode
@@ -23,7 +23,7 @@ print_ver_ ls
 # potentially very many remote mounts.
 mount_points=$(df --local -P 2>&1 | sed -n 's,.*[0-9]% \(/.\),\1,p')
 test -z "$mount_points" &&
-   skip_test_ "this test requires a non-root mount point"
+   skip_ "this test requires a non-root mount point"

 # Given e.g., /dev/shm, produce the list of GNU ls options that
 # let us list just that entry using readdir data from its parent:
@@ -50,8 +50,8 @@ inode_via_readdir()
   mount_point=$1
   base=$(basename $mount_point)
   case $base in
-    .*) skip_test_ 'mount point component starts with "."' ;;
-    *[*?]*) skip_test_ 'mount point component contains "?" or "*"' ;;
+    .*) skip_ 'mount point component starts with "."' ;;
+    *[*?]*) skip_ 'mount point component contains "?" or "*"' ;;
   esac
   opts=$(ls_ignore_options "$base")
   parent_dir=$(dirname $mount_point)
diff --git a/tests/ls/stat-dtype b/tests/ls/stat-dtype
index ddf8d2e..dfa2dd5 100755
--- a/tests/ls/stat-dtype
+++ b/tests/ls/stat-dtype
@@ -30,7 +30,7 @@ print_ver_ ls
 mkdir -p c/d || framework_failure
 chmod a-x c || framework_failure
 if test "X`ls -p c 2>&1`" != Xd/; then
-  skip_test_ "'.' is not on a suitable file system for this test"
+  skip_ "'.' is not on a suitable file system for this test"
 fi

 mkdir d || framework_failure
diff --git a/tests/misc/cat-proc b/tests/misc/cat-proc
index 3cdc2bb..83c1735 100755
--- a/tests/misc/cat-proc
+++ b/tests/misc/cat-proc
@@ -23,7 +23,7 @@ print_ver_ cat

 f=/proc/cpuinfo
 test -f $f \
-  || skip_test_ "no $f"
+  || skip_ "no $f"


 # Yes, parts of /proc/cpuinfo might change between cat runs.
diff --git a/tests/misc/env b/tests/misc/env
index 948b475..d5e4fd6 100755
--- a/tests/misc/env
+++ b/tests/misc/env
@@ -57,7 +57,7 @@ test $? = 127 || fail=1
 # For these reasons, it is more portable to grep that our desired changes
 # took place, rather than comparing output of env over an entire environment.
 if env | grep '^ENV_TEST' >/dev/null ; then
-  skip_test_ "environment has potential interference from ENV_TEST*"
+  skip_ "environment has potential interference from ENV_TEST*"
 fi

 ENV_TEST1=a
diff --git a/tests/misc/nice b/tests/misc/nice
index dc4c1b2..f63a28e 100755
--- a/tests/misc/nice
+++ b/tests/misc/nice
@@ -49,7 +49,7 @@ niceness=`nice`
 if test "$niceness" = 0; then
     : ok
 else
-  skip_test_ "this test must be run at nice level 0"
+  skip_ "this test must be run at nice level 0"
 fi

 while :; do
diff --git a/tests/misc/od-x8 b/tests/misc/od-x8
index 7504414..4936109 100755
--- a/tests/misc/od-x8
+++ b/tests/misc/od-x8
@@ -21,7 +21,7 @@
 print_ver_ od

 od -t x8 /dev/null >/dev/null ||
-  skip_test_ "od lacks support for 8-byte quantities"
+  skip_ "od lacks support for 8-byte quantities"

 echo abcdefgh |tr -d '\n' > in || framework_failure

diff --git a/tests/misc/printenv b/tests/misc/printenv
index 5744afd..607914c 100755
--- a/tests/misc/printenv
+++ b/tests/misc/printenv
@@ -31,7 +31,7 @@ compare exp out || fail=1
 # Environment variable values may contain newlines, which cannot be
 # observed by merely inspecting output from printenv.
 if env -- printenv | grep '^ENV_TEST' >/dev/null ; then
-  skip_test_ "environment has potential interference from ENV_TEST*"
+  skip_ "environment has potential interference from ENV_TEST*"
 fi

 # Printing a single variable's value.
diff --git a/tests/misc/pwd-option b/tests/misc/pwd-option
index 8eaf6be..c900493 100755
--- a/tests/misc/pwd-option
+++ b/tests/misc/pwd-option
@@ -29,7 +29,7 @@ test "x$PWD" = "x$base" || framework_failure

 # Enter a logical directory.
 cd c || framework_failure
-test "x$PWD" = "x$base/c" || skip_test_ "cd does not properly update \$PWD"
+test "x$PWD" = "x$base/c" || skip_ "cd does not properly update \$PWD"

 env -- pwd -L > out || fail=1
 printf %s\\n "$base/c" > exp || fail=1
diff --git a/tests/misc/selinux b/tests/misc/selinux
index d1bc9ca..df3cb3e 100755
--- a/tests/misc/selinux
+++ b/tests/misc/selinux
@@ -33,7 +33,7 @@ mkfifo_or_skip_ p
 ctx=root:object_r:tmp_t:s0

 chcon $ctx f d p ||
-  skip_test_ '"chcon '$ctx' ..." failed'
+  skip_ '"chcon '$ctx' ..." failed'

 # inspect that context with both ls -Z and stat.
 for i in d f p; do
diff --git a/tests/misc/seq-long-double b/tests/misc/seq-long-double
index 4d3a208..230912c 100755
--- a/tests/misc/seq-long-double
+++ b/tests/misc/seq-long-double
@@ -34,7 +34,7 @@ int foo[sizeof (long double) - sizeof (double) - 1];
 #endif
 EOF
 $CC -c long.c \
-  || skip_test_ \
+  || skip_ \
      'this test runs only on systems with glibc and long double != double'

 a=$INTMAX_MAX
diff --git a/tests/misc/sort-continue b/tests/misc/sort-continue
index 40105d5..43881ac 100755
--- a/tests/misc/sort-continue
+++ b/tests/misc/sort-continue
@@ -21,7 +21,7 @@ print_ver_ sort

 # Skip the test when running under valgrind.
 ( ulimit -n 6; sort < /dev/null ) \
-  || skip_test_ 'fd-limited sort failed; are you running under valgrind?'
+  || skip_ 'fd-limited sort failed; are you running under valgrind?'

 for i in $(seq 31); do
   echo $i | tee -a in > __test.$i || framework_failure
diff --git a/tests/misc/sort-month b/tests/misc/sort-month
index 126c615..1b5b76c 100755
--- a/tests/misc/sort-month
+++ b/tests/misc/sort-month
@@ -20,7 +20,7 @@
 print_ver_ sort

 locale --version >/dev/null 2>&1 ||
-  skip_test_ 'The locale utility is not present'
+  skip_ 'The locale utility is not present'

 # C will be used if the locale is not present
 for LOC in "$LOCALE_FR" "$LOCALE_FR_UTF8" "ja_JP.utf8"; do
diff --git a/tests/misc/sort-spinlock-abuse b/tests/misc/sort-spinlock-abuse
index fc9612c..4cf8866 100755
--- a/tests/misc/sort-spinlock-abuse
+++ b/tests/misc/sort-spinlock-abuse
@@ -21,7 +21,7 @@
 print_ver_ sort

 grep '^#define HAVE_PTHREAD_T 1' "$CONFIG_HEADER" > /dev/null ||
-  skip_test_ 'requires pthreads'
+  skip_ 'requires pthreads'

 seq 100000 > in || framework_failure_
 mkfifo_or_skip_ fifo
diff --git a/tests/misc/sort-stale-thread-mem b/tests/misc/sort-stale-thread-mem
index 6f676ef..5e9c0e7 100755
--- a/tests/misc/sort-stale-thread-mem
+++ b/tests/misc/sort-stale-thread-mem
@@ -23,9 +23,9 @@ print_ver_ sort

 very_expensive_

-valgrind --help >/dev/null || skip_test_ "requires valgrind"
+valgrind --help >/dev/null || skip_ "requires valgrind"
 grep '^#define HAVE_PTHREAD_T 1' "$CONFIG_HEADER" > /dev/null ||
-  skip_test_ 'requires pthreads'
+  skip_ 'requires pthreads'

 # gensort output seems to trigger the failure more often,
 # so prefer gensort if it is available.
diff --git a/tests/misc/sort-unique-segv b/tests/misc/sort-unique-segv
index 41eede2..6a40c37 100755
--- a/tests/misc/sort-unique-segv
+++ b/tests/misc/sort-unique-segv
@@ -20,7 +20,7 @@
 print_ver_ sort

 grep '^#define HAVE_PTHREAD_T 1' "$CONFIG_HEADER" > /dev/null ||
-  skip_test_ 'requires pthreads'
+  skip_ 'requires pthreads'

 cat <<\EOF > in || framework_failure_

diff --git a/tests/misc/stat-nanoseconds b/tests/misc/stat-nanoseconds
index 33dc58a..27282f4 100755
--- a/tests/misc/stat-nanoseconds
+++ b/tests/misc/stat-nanoseconds
@@ -27,7 +27,7 @@ export TZ
 touch -d '1970-01-01 18:43:33.023456789' k || framework_failure_

 ls --full-time | grep 18:43:33.023456789 \
-  || skip_test_ this file system does not support sub-second time stamps
+  || skip_ this file system does not support sub-second time stamps

 test "$(stat -c       %X k)" =    67413               || fail=1
 test "$(stat -c      %.X k)" =    67413.023456789     || fail=1
diff --git a/tests/misc/stdbuf b/tests/misc/stdbuf
index 80ad870..ccf60b1 100755
--- a/tests/misc/stdbuf
+++ b/tests/misc/stdbuf
@@ -28,7 +28,7 @@ lf='
 '
 case $abs_top_builddir in
   *[\\\"\#\$\&\'\`$lf\ \	]*)
-    skip_test_ "unsafe absolute build directory name: $abs_top_builddir";;
+    skip_ "unsafe absolute build directory name: $abs_top_builddir";;
 esac

 # Use a fifo rather than a pipe in the tests below
diff --git a/tests/misc/stty-row-col b/tests/misc/stty-row-col
index d1d1143..f54ea7d 100755
--- a/tests/misc/stty-row-col
+++ b/tests/misc/stty-row-col
@@ -52,7 +52,7 @@ NA LAST NA
 set $tests

 saved_size=`stty size` && test -n "$saved_size" \
-  || skip_test_ "can't get window size"
+  || skip_ "can't get window size"

 # Linux virtual consoles issue an error if you
 # try to increase their size.  So skip in that case.
@@ -60,7 +60,7 @@ if test "x$saved_size" != "x0 0"; then
   srow=$(echo $saved_size | cut -d ' ' -f1)
   scol=$(echo $saved_size | cut -d ' ' -f2)
   stty rows $(expr $srow + 1) cols $(expr $scol + 1) ||
-    skip_test_ "can't increase window size"
+    skip_ "can't increase window size"
 fi

 while :; do
diff --git a/tests/misc/tac-continue b/tests/misc/tac-continue
index 2f6e813..0040ac6 100755
--- a/tests/misc/tac-continue
+++ b/tests/misc/tac-continue
@@ -23,7 +23,7 @@ print_ver_ tac

 # See if the envvar is defined.
 if test x = "x$FULL_PARTITION_TMPDIR"; then
-  skip_test_ "FULL_PARTITION_TMPDIR not defined"
+  skip_ "FULL_PARTITION_TMPDIR not defined"
 fi

 if ! test -d "$FULL_PARTITION_TMPDIR"; then
diff --git a/tests/misc/xattr b/tests/misc/xattr
index 60fc24c..05437d0 100755
--- a/tests/misc/xattr
+++ b/tests/misc/xattr
@@ -24,7 +24,7 @@ print_ver_ cp mv ginstall
 # Skip this test if cp was built without xattr support:
 touch src dest || framework_failure
 cp --preserve=xattr -n src dest \
-  || skip_test_ "coreutils built without xattr support"
+  || skip_ "coreutils built without xattr support"

 # this code was taken from test mv/backup-is-src
 cleanup_() { rm -rf "$other_partition_tmpdir"; }
@@ -39,42 +39,42 @@ xattr_pair="$xattr_name=\"$xattr_value\""

 # create new file and check its xattrs
 touch a || framework_failure
-getfattr -d a >out_a || skip_test_ "failed to get xattr of file"
+getfattr -d a >out_a || skip_ "failed to get xattr of file"
 grep -F "$xattr_pair" out_a && framework_failure

 # try to set user xattr on file
 setfattr -n "$xattr_name" -v "$xattr_value" a >out_a \
-  || skip_test_ "failed to set xattr of file"
-getfattr -d a >out_a || skip_test_ "failed to get xattr of file"
+  || skip_ "failed to set xattr of file"
+getfattr -d a >out_a || skip_ "failed to get xattr of file"
 grep -F "$xattr_pair" out_a \
-  || skip_test_ "failed to set xattr of file"
+  || skip_ "failed to set xattr of file"


 # cp should not preserve xattr by default
 cp a b || fail=1
-getfattr -d b >out_b || skip_test_ "failed to get xattr of file"
+getfattr -d b >out_b || skip_ "failed to get xattr of file"
 grep -F "$xattr_pair" out_b && fail=1

 # test if --preserve=xattr option works
 cp --preserve=xattr a b || fail=1
-getfattr -d b >out_b || skip_test_ "failed to get xattr of file"
+getfattr -d b >out_b || skip_ "failed to get xattr of file"
 grep -F "$xattr_pair" out_b || fail=1

 # test if --preserve=all option works
 cp --preserve=all a c || fail=1
-getfattr -d c >out_c || skip_test_ "failed to get xattr of file"
+getfattr -d c >out_c || skip_ "failed to get xattr of file"
 grep -F "$xattr_pair" out_c || fail=1

 # cp's -a option must produce no diagnostics.
 cp -a a d 2>err && test -s err && fail=1
-getfattr -d d >out_d || skip_test_ "failed to get xattr of file"
+getfattr -d d >out_d || skip_ "failed to get xattr of file"
 grep -F "$xattr_pair" out_d || fail=1

 # test if --preserve=xattr works even for files without write access
 chmod a-w a || framework_failure
 rm -f e
 cp --preserve=xattr a e || fail=1
-getfattr -d e >out_e || skip_test_ "failed to get xattr of file"
+getfattr -d e >out_e || skip_ "failed to get xattr of file"
 grep -F "$xattr_pair" out_e || fail=1

 # Ensure that permission bits are preserved, too.
@@ -88,14 +88,14 @@ rm b || framework_failure

 # install should never preserve xattr
 ginstall a b || fail=1
-getfattr -d b >out_b || skip_test_ "failed to get xattr of file"
+getfattr -d b >out_b || skip_ "failed to get xattr of file"
 grep -F "$xattr_pair" out_b && fail=1

 # mv should preserve xattr when renaming within a file system.
 # This is implicitly done by rename () and doesn't need explicit
 # xattr support in mv.
 mv a b || fail=1
-getfattr -d b >out_b || skip_test_ "failed to get xattr of file"
+getfattr -d b >out_b || skip_ "failed to get xattr of file"
 grep -F "$xattr_pair" out_b || cat >&2 <<EOF
 =================================================================
 $0: WARNING!!!
@@ -116,7 +116,7 @@ if test $test_mv -eq 1; then
   # mv should preserve xattr when copying content from one partition to another
   mv b "$b_other" || fail=1
   getfattr -d "$b_other" >out_b ||
-    skip_test_ "failed to get xattr of file"
+    skip_ "failed to get xattr of file"
   grep -F "$xattr_pair" out_b || fail=1
 else
   cat >&2 <<EOF
diff --git a/tests/mkdir/writable-under-readonly b/tests/mkdir/writable-under-readonly
index 38bd5ae..c0f83fb 100755
--- a/tests/mkdir/writable-under-readonly
+++ b/tests/mkdir/writable-under-readonly
@@ -29,7 +29,7 @@ print_ver_ mkdir
 require_root_

 # FIXME: for now, skip it unconditionally
-skip_test_ temporarily disabled
+skip_ temporarily disabled

 # FIXME: define cleanup_ to do the umount

diff --git a/tests/mv/acl b/tests/mv/acl
index 0abc5da..669868d 100755
--- a/tests/mv/acl
+++ b/tests/mv/acl
@@ -24,7 +24,7 @@ require_acl_

 # Skip this test if cp was built without ACL support:
 grep '^#define USE_ACL 1' $CONFIG_HEADER > /dev/null ||
-  skip_test_ "insufficient ACL support"
+  skip_ "insufficient ACL support"

 cleanup_() { rm -rf "$other_partition_tmpdir"; }
 . "$abs_srcdir/other-fs-tmpdir"
@@ -41,7 +41,7 @@ setfacl -m user:bin:rw $t1 || skip_partition=$other_partition_tmpdir
 acl1=`getfacl file` || skip_partition=.

 test $skip_partition != none &&
-  skip_test_ "'$skip_partition' is not on a suitable file system for this test"
+  skip_ "'$skip_partition' is not on a suitable file system for this test"

 # move the access acl of a file
 mv file "$other_partition_tmpdir" || fail=1
diff --git a/tests/mv/i-3 b/tests/mv/i-3
index 83d93a8..867b7cb 100755
--- a/tests/mv/i-3
+++ b/tests/mv/i-3
@@ -23,21 +23,21 @@ require_controlling_input_terminal_
 skip_if_root_
 trap '' TTIN # Ignore SIGTTIN

-test "$(uname -s)" = FreeBSD && skip_test_ "known spurious failure on FreeBSD"
+test "$(uname -s)" = FreeBSD && skip_ "known spurious failure on FreeBSD"

 touch f g h i || framework_failure
 chmod 0 g i || framework_failure


 ls /dev/stdin >/dev/null 2>&1 \
-  || skip_test_ 'there is no /dev/stdin file'
+  || skip_ 'there is no /dev/stdin file'

 # work around a dash bug when redirecting
 # from symlinked ttys in the background
 tty=$(readlink -f /dev/stdin)

 test -r "$tty" 2>&1 \
-  || skip_test_ '/dev/stdin is not readable'
+  || skip_ '/dev/stdin is not readable'

 mv f g < $tty > out 2>&1 & pid=$!

diff --git a/tests/mv/no-target-dir b/tests/mv/no-target-dir
index f1e21d6..a73fae9 100755
--- a/tests/mv/no-target-dir
+++ b/tests/mv/no-target-dir
@@ -27,7 +27,7 @@ touch f || framework_failure
 mkdir a b b/a || framework_failure

 mv a b ||
-  skip_test_ "your kernel's rename syscall is buggy"
+  skip_ "your kernel's rename syscall is buggy"


 # This should succeed, since both src and dest are directories,
diff --git a/tests/mv/sticky-to-xpart b/tests/mv/sticky-to-xpart
index 979d31f..f689d9d 100755
--- a/tests/mv/sticky-to-xpart
+++ b/tests/mv/sticky-to-xpart
@@ -47,7 +47,7 @@ version=`
 `
 case $version in
   $PACKAGE_VERSION) ;;
-  *) skip_test_ "cannot access just-built mv as user $NON_ROOT_USERNAME";;
+  *) skip_ "cannot access just-built mv as user $NON_ROOT_USERNAME";;
 esac

 setuidgid $NON_ROOT_USERNAME env PATH="$PATH" \
diff --git a/tests/other-fs-tmpdir b/tests/other-fs-tmpdir
index 074be07..9ea8a33 100644
--- a/tests/other-fs-tmpdir
+++ b/tests/other-fs-tmpdir
@@ -45,7 +45,7 @@ for d in $CANDIDATE_TMP_DIRS; do
 done

 if test -z "$other_partition_tmpdir"; then
-  skip_test_ \
+  skip_ \
 "requires a writable directory on a different disk partition,
 and I couldn't find one.  I tried these:
   $CANDIDATE_TMP_DIRS
diff --git a/tests/rm/ext3-perf b/tests/rm/ext3-perf
index efaaf67..95cce33 100755
--- a/tests/rm/ext3-perf
+++ b/tests/rm/ext3-perf
@@ -41,13 +41,13 @@ n=400000
 # FIXME-maybe: try to find a suitable file system or allow
 # the user to specify it via an envvar.
 df -T -t ext3 -t ext4dev -t ext4 . \
-  || skip_test_ 'this test runs only on an ext3 or ext4 file system'
+  || skip_ 'this test runs only on an ext3 or ext4 file system'

 # Skip if there are too few inodes free.  Require some slack.
 free_inodes=$(stat -f --format=%d .) || framework_failure
 min_free_inodes=$(expr 12 \* $n / 10)
 test $min_free_inodes -lt $free_inodes \
-  || skip_test_ "too few free inodes on '.': $free_inodes;" \
+  || skip_ "too few free inodes on '.': $free_inodes;" \
       "this test requires at least $min_free_inodes"

 ok=0
diff --git a/tests/rm/fail-2eperm b/tests/rm/fail-2eperm
index 92d19ec..4137d9d 100755
--- a/tests/rm/fail-2eperm
+++ b/tests/rm/fail-2eperm
@@ -37,7 +37,7 @@ rm_version=`
 `
 case $rm_version in
   $PACKAGE_VERSION) ;;
-  *) skip_test_ "cannot access just-built rm as user $NON_ROOT_USERNAME";;
+  *) skip_ "cannot access just-built rm as user $NON_ROOT_USERNAME";;
 esac
 setuidgid $NON_ROOT_USERNAME env PATH="$PATH" rm -rf a 2> out-t && fail=1

diff --git a/tests/rm/isatty b/tests/rm/isatty
index ea2daba..1118b94 100755
--- a/tests/rm/isatty
+++ b/tests/rm/isatty
@@ -23,7 +23,7 @@ skip_if_root_

 # Skip this test if there is no /dev/stdin file.
 ls /dev/stdin >/dev/null 2>&1 \
-  || skip_test_ 'there is no /dev/stdin file'
+  || skip_ 'there is no /dev/stdin file'

 touch f
 chmod 0 f
diff --git a/tests/rm/one-file-system b/tests/rm/one-file-system
index 36990b2..1ef61a7 100755
--- a/tests/rm/one-file-system
+++ b/tests/rm/one-file-system
@@ -33,7 +33,7 @@ cleanup_()
 t=$other_partition_tmpdir
 mkdir -p a/b $t/y
 mount --bind $t a/b \
-  || skip_test_ "This test requires mount with a working --bind option."
+  || skip_ "This test requires mount with a working --bind option."

 cat <<\EOF > exp || framework_failure
 rm: skipping `a/b', since it's on a different device
diff --git a/tests/rm/read-only b/tests/rm/read-only
index 35919d3..c52883b 100755
--- a/tests/rm/read-only
+++ b/tests/rm/read-only
@@ -29,7 +29,7 @@ dd if=/dev/zero of=blob bs=8192 count=200 > /dev/null 2>&1 \
                                              || skip=1
 mkdir mnt                                    || skip=1
 mkfs -t ext2 -F blob \
-  || skip_test_ "failed to create ext2 file system"
+  || skip_ "failed to create ext2 file system"

 mount -oloop blob mnt                        || skip=1
 echo test > mnt/f                            || skip=1
@@ -37,7 +37,7 @@ test -s mnt/f                                || skip=1
 mount -o remount,loop,ro mnt                 || skip=1

 test $skip = 1 \
-  && skip_test_ "insufficient mount/ext2 support"
+  && skip_ "insufficient mount/ext2 support"

 # Applying rm -f to a nonexistent file on a read-only file system must succeed.
 rm -f mnt/no-such > out 2>&1 || fail=1
diff --git a/tests/split/filter b/tests/split/filter
index 5bc5458..afdd4d2 100755
--- a/tests/split/filter
+++ b/tests/split/filter
@@ -18,7 +18,7 @@

 . "${srcdir=.}/init.sh"; path_prepend_ ../src
 print_ver_ split
-xz --version || skip_test_ "xz (better than gzip/bzip2) required"
+xz --version || skip_ "xz (better than gzip/bzip2) required"

 for total_n_lines in 5 3000 20000; do
   seq $total_n_lines > in || framework_failure_
diff --git a/tests/tail-2/append-only b/tests/tail-2/append-only
index ba55fcf..1457b13 100755
--- a/tests/tail-2/append-only
+++ b/tests/tail-2/append-only
@@ -28,7 +28,7 @@ chattr +a f 2>/dev/null || chattr_a_works=0
 echo x >> f || chattr_a_works=0

 if test $chattr_a_works = 0; then
-  skip_test_ "chattr +a doesn't work on this file system"
+  skip_ "chattr +a doesn't work on this file system"
 fi


diff --git a/tests/tail-2/big-4gb b/tests/tail-2/big-4gb
index 0889713..11faed5 100755
--- a/tests/tail-2/big-4gb
+++ b/tests/tail-2/big-4gb
@@ -31,7 +31,7 @@ echo 87654321 | tr -d '\n' > tmp || framework_failure
 dd bs=1 seek=4294967288 if=tmp of=big 2> err || dd_failed=1
 if test "$dd_failed" = 1; then
   cat err 1>&2
-  skip_test_ \
+  skip_ \
 'cannot create a file large enough for this test,
 possibly because this system does not support large files;
 Consider rerunning this test on a different file system.'
diff --git a/tests/tail-2/inotify-race b/tests/tail-2/inotify-race
index 7e23100..b88b847 100755
--- a/tests/tail-2/inotify-race
+++ b/tests/tail-2/inotify-race
@@ -34,7 +34,7 @@ touch tail.out || framework_failure
 ( timeout 10s gdb --version ) > gdb.out 2>&1
 case $(cat gdb.out) in
     *'GNU gdb'*) ;;
-    *) skip_test_ "can't run gdb";;
+    *) skip_ "can't run gdb";;
 esac

 # See if gdb works and
@@ -48,7 +48,7 @@ timeout 10s gdb -nx --batch-silent                 \
 # FIXME: The above is seen to _intermittently_ fail with:
 # warning: .dynamic section for "/lib/libc.so.6" is not at the expected address
 # warning: difference appears to be caused by prelink, adjusting expectations
-test -s gdb.out && { cat gdb.out; skip_test_ "can't set breakpoints in tail"; }
+test -s gdb.out && { cat gdb.out; skip_ "can't set breakpoints in tail"; }

 # Run "tail -f file", stopping to append a line just before
 # inotify initialization, and then continue.  Before the fix,
diff --git a/tests/tail-2/pid b/tests/tail-2/pid
index 6aba749..f75c3de 100755
--- a/tests/tail-2/pid
+++ b/tests/tail-2/pid
@@ -40,7 +40,7 @@ for inotify in ---disable-inotify ''; do
   # Use an unlikely-to-be-live PID
   timeout 10 tail -f -s.1 --pid=$PID_T_MAX $inotify empty
   ret=$?
-  test $ret = 124 && skip_test_ "pid $PID_T_MAX present or tail too slow"
+  test $ret = 124 && skip_ "pid $PID_T_MAX present or tail too slow"
   test $ret = 0 || fail=1

   # Ensure tail doesn't wait for data when PID is dead
diff --git a/tests/touch/dangling-symlink b/tests/touch/dangling-symlink
index dfde5c1..27534da 100755
--- a/tests/touch/dangling-symlink
+++ b/tests/touch/dangling-symlink
@@ -34,7 +34,7 @@ if test $fail = 1; then
     *linux-gnu*)
       case "`uname -r`" in
         2.3.9[0-9]*)
-          skip_test_ \
+          skip_ \
 '****************************************************
 WARNING!!!
 This version of the Linux kernel causes touch to fail
diff --git a/tests/touch/no-dereference b/tests/touch/no-dereference
index 6d13811..b732746 100755
--- a/tests/touch/no-dereference
+++ b/tests/touch/no-dereference
@@ -41,7 +41,7 @@ test -f nowhere && fail=1
 # The remaining tests of -h require kernel support for changing symlink times.
 grep '^#define HAVE_UTIMENSAT 1' "$CONFIG_HEADER" > /dev/null ||
 grep '^#define HAVE_LUTIMES 1' "$CONFIG_HEADER" > /dev/null ||
-  skip_test_ 'this system lacks the utimensat function'
+  skip_ 'this system lacks the utimensat function'

 # Changing time of dangling symlink is okay.
 # Skip the test if this fails, but the error text corresponds to
@@ -51,7 +51,7 @@ case $? in
   0) test -f nowhere && fail=1
      test -s err && fail=1;;
   1) grep 'Function not implemented' err \
-       && skip_test_ 'this system lacks the utimensat function'
+       && skip_ 'this system lacks the utimensat function'
      fail=1;;
   *) fail=1;;
 esac
diff --git a/tests/touch/not-owner b/tests/touch/not-owner
index 953e76b..1166c16 100755
--- a/tests/touch/not-owner
+++ b/tests/touch/not-owner
@@ -21,11 +21,11 @@
 print_ver_ touch

 if env -- test -w /; then
-  skip_test_ you have write access to /.
+  skip_ you have write access to /.
 fi

 if env -- test -O / || env -- test -G /; then
-  skip_test_ "you own /."
+  skip_ "you own /."
 fi

 skip_if_root_
--
1.7.6.rc0.293.g40857


From MAILER-DAEMON Fri Jun 17 12:31:40 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QXbxL-0001q3-OH
	for mharc-coreutils@gnu.org; Fri, 17 Jun 2011 12:31:40 -0400
Received: from eggs.gnu.org ([140.186.70.92]:47721)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bob@proulx.com>) id 1QXbxH-0001oy-4z
	for coreutils@gnu.org; Fri, 17 Jun 2011 12:31:37 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bob@proulx.com>) id 1QXbxE-0000sG-Oq
	for coreutils@gnu.org; Fri, 17 Jun 2011 12:31:34 -0400
Received: from joseki.proulx.com ([216.17.153.58]:38791)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bob@proulx.com>) id 1QXbxE-0000ru-77
	for coreutils@gnu.org; Fri, 17 Jun 2011 12:31:32 -0400
Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119])
	by joseki.proulx.com (Postfix) with ESMTP id EF47921312
	for <coreutils@gnu.org>; Fri, 17 Jun 2011 10:31:29 -0600 (MDT)
Received: by hysteria.proulx.com (Postfix, from userid 1000)
	id E2F102DC65; Fri, 17 Jun 2011 10:31:29 -0600 (MDT)
Date: Fri, 17 Jun 2011 10:31:29 -0600
From: Bob Proulx <bob@proulx.com>
To: coreutils@gnu.org
Subject: Re: base64 terminal input failure
Message-ID: <20110617163129.GA19625@hysteria.proulx.com>
Mail-Followup-To: coreutils@gnu.org
References: <BANLkTi=Twi+ibF_HcK2AYiVr0_xx64vR3A@mail.gmail.com>
	<20110617001904.GA19982@hysteria.proulx.com>
	<BANLkTinUBu0LX651XcH43dNE8e2usi1=ew@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <BANLkTinUBu0LX651XcH43dNE8e2usi1=ew@mail.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
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, 17 Jun 2011 16:31:37 -0000

e-letter wrote:
> I wrote 'xyz' not as literal, verbatim encoded text but as an example.

But your example displayed the output from base64 that corresponded
exactly to literally giving it "xyz" as input.  We only know what you
are doing from the data you show us.  Therefore literal and verbatim
is important to avoid miscommunication.

> Repeating this as follows causes the same error:
> 
> ...@localhost ~]$ base64 -d Zm9vCg==
> base64: Zm9vCg==: No such file or directory
> 
> >   $ echo foo | base64
> >   Zm9vCg==
> >
> >   $ echo foo | base64 | base64 -d
> >   foo
> >
> >   $ echo Zm9vCg== | base64 -d
> >   foo
> >
> 
> This occurs, but is not explained in the manual. The manual clearly
> states that the option is to be entered before the file/standard
> input.

You seem to be confused or misunderstanding about the concept of
standard input.  Let me try to explain this concept.  Standard input
(or also known as stdin) isn't a string on the command line.
[Although using echo and printf strings on the command line can be
written as standard output (aka stdout) from one program and connected
by a pipe to the stdin of another.]  Nor is standard output a file on
the command line.  Stdin is data read from the standard input stream.

Perhaps this reference will do a better job of explaining this than I
will:

  http://en.wikipedia.org/wiki/Standard_streams

The command syntax synopsis is:

     base64 [OPTION]... [FILE]

You are trying:

> ...@localhost ~]$ base64 -d Zm9vCg==
> base64: Zm9vCg==: No such file or directory

When you say "-d" that is parsed as an option.  It starts with a dash
and corresponds to a valid option.  Operate as a decoder.

The remaining option argument string is "Zm9vCg==".  Not starting with
a dash it is not an option argument.  That string appears in the
[FILE] position.  The syntax synopsis shows that if there is a
non-option argument then the only valid strings there must be the
named files on disk.  The program attempts to read the named file.
This operation fails and is reported.

This is standard behavior for all programs and is not something
particular to base64.  Look at the 'cat' command syntax synopsis for
another example.  Everything we have said here could also be said
about the cat command.  In fact I would suggest using cat as your
illustrative example until everything becomes clear since it is
simpler and universally known and understood.

The base64 command reads from named files specified as file option
arguments or if none are specified it will read from standard input.
That is the significance of the brackets [...] as the brackets show
that the file name argument is optional.  If you want to read from
stdin then do not specify any file option arguments and provide the
data in stdin.

To try to remove the confusion let's try a different syntax synopsis.
Let's look at mkdir.

     mkdir [OPTION]... NAME...

That syntax synopsis specifies that mkdir may have option arguments.
Then it specifies that it *must* have a file name argument.  It
specifies this by not including brackets.  Because NAME does not
include brackets around it that specifies that it is not optional.
The mkdir command must have a filename on the command line.  It is not
optional.

Hope this further explanation helps.

Bob


From MAILER-DAEMON Fri Jun 17 15:12:21 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QXeSr-0007Uo-2Y
	for mharc-coreutils@gnu.org; Fri, 17 Jun 2011 15:12:21 -0400
Received: from eggs.gnu.org ([140.186.70.92]:55333)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <inpost@gmail.com>) id 1QXeSn-0007Ud-Ui
	for coreutils@gnu.org; Fri, 17 Jun 2011 15:12:19 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <inpost@gmail.com>) id 1QXeSm-0005bD-Nr
	for coreutils@gnu.org; Fri, 17 Jun 2011 15:12:17 -0400
Received: from mail-vx0-f169.google.com ([209.85.220.169]:59710)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <inpost@gmail.com>) id 1QXeSm-0005b2-LU
	for coreutils@gnu.org; Fri, 17 Jun 2011 15:12:16 -0400
Received: by vxg38 with SMTP id 38so1527603vxg.0
	for <coreutils@gnu.org>; Fri, 17 Jun 2011 12:12:15 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:in-reply-to:references:date
	:message-id:subject:from:to:content-type;
	bh=enbJkbsvtZpRkig0FAwWW4E+AJoNWKpX8D+/tPs0tMk=;
	b=JMqAdqymlv1IFKhWwrctxGTXFrFwD1cgYsJRWul/KmOiqfEIEh6DJJ/+0zoigJAhdA
	K5lmber1MvWE+LP2VyKfwq4Etdfi0m8Sjk7RBfl0uaFwVSGtrFofhtvrqPp7eQPZ4WkU
	ofFEJtPTEcrxeOKwTAipxcvcf6LvH2A0lVUkE=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type;
	b=FMS5EiZYCQWCfw+9adR+NEW9tkW54flEIBZHY7pTPYkRO6ZWmpV7W+Uk3a93SAMaX2
	X+wa3vUwo2dm/iCQSriI/lrXPKa7FVbK1NmIl/AzAGPWVLLJ4nM6hf/4mZxVHCKguM5S
	WZHm1g6+/C/ZejkvDBQQ7ob9FUf3YNYKczrkQ=
MIME-Version: 1.0
Received: by 10.220.180.202 with SMTP id bv10mr917970vcb.153.1308337934104;
	Fri, 17 Jun 2011 12:12:14 -0700 (PDT)
Received: by 10.220.65.86 with HTTP; Fri, 17 Jun 2011 12:12:14 -0700 (PDT)
In-Reply-To: <mailman.780.1308326798.770.coreutils@gnu.org>
References: <mailman.780.1308326798.770.coreutils@gnu.org>
Date: Fri, 17 Jun 2011 20:12:14 +0100
Message-ID: <BANLkTi=6TNhz+_Bbg0dBaH4JcHT8JdgxhA@mail.gmail.com>
Subject: Re: coreutils Digest, Vol 16, Issue 11
From: e-letter <inpost@gmail.com>
To: coreutils@gnu.org
Content-Type: text/plain; charset=UTF-8
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.220.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, 17 Jun 2011 19:12:19 -0000

On 17/06/2011, coreutils-request@gnu.org <coreutils-request@gnu.org> wrote:
> Send coreutils mailing list submissions to
> 	coreutils@gnu.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	https://lists.gnu.org/mailman/listinfo/coreutils
> or, via email, send a message with subject or body 'help' to
> 	coreutils-request@gnu.org
>
> You can reach the person managing the list at
> 	coreutils-owner@gnu.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of coreutils digest..."
>
>
> Today's Topics:
>
>    1. Re: base64 terminal input failure (Davide Brini)
>    2. Re: [PATCH] tests: use printf, not echo in init.sh's warn_
>       function (Jim Meyering)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 17 Jun 2011 14:18:45 +0200
> From: Davide Brini <dave_br@gmx.com>
> To: coreutils@gnu.org
> Subject: Re: base64 terminal input failure
> Message-ID: <E1QXZkT-000289-ON@eggs.gnu.org>
> Content-Type: text/plain; charset=UTF-8
>
> On Fri, 17 Jun 2011 09:38:07 +0100
> e-letter <inpost@gmail.com> wrote:
>
>> On 17/06/2011, Bob Proulx <bob@proulx.com> wrote:
>> > e-letter wrote:
>> >> I have tried to copy base64 encoded text from the clipboard (i.e. a
>> >> web mail message) to the command terminal:
>> >>
>> >> base64 -d 'xyz'
>> >>
>> >> where 'xyz' is the base64 text. According to the manual, standard
>> >> input can be accepted if a file is not accepted but instead the
>> >> terminal response is:
>> >>
>> >> base64: xyz: No such file or directory
>> >>
>> >> What is my mistake please?
>> >
>> > The base64 syntax is:
>> >
>> >   base64 [OPTION]... [FILE]
>> >
>> > You have specified one option and what appears to the command to be
>> > one file.  The -d fits in the [OPTION] spot and the xyz fits in the
>> > [FILE] spot.
>> >
>> > The brackets indicate that those parts are optional.  For [OPTIONS] no
>> > options means to encode.  Specifying -d means to decode.
>> >
>> > For [FILE] this means that if a file is specified then the command
>> > will open the file and read it.  If no file is specified on the
>> > command line then it will read standard input.
>> >
>> >> The command:
>> >> 'echo xyz | base64 -d'
>> >>
>> >> returns:
>> >> ?,base64: invalid input
>> >>
>> >> If the base64 text is saved as a file, conversion is successful.
>> >
>> > This is because "xyz" isn't valid base64 encoded data.  It works
>> > successfully if you give it valid input data instead of random
>> > characters.  See this example:
>> >
>>
>> I wrote 'xyz' not as literal, verbatim encoded text but as an example.
>> Repeating this as follows causes the same error:
>>
>> ...@localhost ~]$ base64 -d Zm9vCg==
>> base64: Zm9vCg==: No such file or directory
>
> Which part of
>
> base64 [OPTION]... [FILE]
>
> is not clear?
>
isn't option '-d' not correct?

Therefore the syntax seems

base64 -d ...

If no file is to be specified then it seems logical to add the base64
encoded text where the ellipsis are shown above.


From MAILER-DAEMON Fri Jun 17 16:27:19 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QXfdO-0002PA-Gb
	for mharc-coreutils@gnu.org; Fri, 17 Jun 2011 16:27:18 -0400
Received: from eggs.gnu.org ([140.186.70.92]:41588)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <inpost@gmail.com>) id 1QXfdK-0002OG-LP
	for coreutils@gnu.org; Fri, 17 Jun 2011 16:27:15 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <inpost@gmail.com>) id 1QXfdI-000301-PZ
	for coreutils@gnu.org; Fri, 17 Jun 2011 16:27:14 -0400
Received: from mail-vx0-f169.google.com ([209.85.220.169]:44293)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <inpost@gmail.com>) id 1QXfdI-0002zq-A4
	for coreutils@gnu.org; Fri, 17 Jun 2011 16:27:12 -0400
Received: by vxg38 with SMTP id 38so1586074vxg.0
	for <coreutils@gnu.org>; Fri, 17 Jun 2011 13:27:11 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:in-reply-to:references:date
	:message-id:subject:from:to:content-type;
	bh=FNREL6tlDv4L47F8nUZQsY00kTKHCTqx9eJv/+7miM4=;
	b=NovH4xNxDbFZ8PNRDIabv3cb1KUAdxnGFRIJyTwEwNPVDOFmeUc3fMNZCDg17G5y2S
	zP1D+XIKANJ0G/Swv979sSrZcnqW/cAM3bjSA+cSv15Zg/YTLLNcS2A5VqiZWkw+kFzI
	UbmHTBfxX19ZcCx0pVm2vU6UJSlwjeKwVWDKE=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:content-type;
	b=l8O9QrP4kwgs1w0vy0S+esif3hcdeJusqqF8zyn9+T1RH4QFljCHxC5l66ktWJ+qnd
	n8Ov+V0YQV1PsNWt4Q4marF0t61pSv1VJKr3pwvvRSxzZTIBpOi/BoOttfDESz2/IOCn
	1j3uwIiGm3V/7lgEiMTpLDnJSJRbhicNb2i8w=
MIME-Version: 1.0
Received: by 10.220.102.17 with SMTP id e17mr890295vco.258.1308338525179; Fri,
	17 Jun 2011 12:22:05 -0700 (PDT)
Received: by 10.220.65.86 with HTTP; Fri, 17 Jun 2011 12:22:05 -0700 (PDT)
In-Reply-To: <mailman.221.1308326453.3776.coreutils@gnu.org>
References: <mailman.221.1308326453.3776.coreutils@gnu.org>
Date: Fri, 17 Jun 2011 20:22:05 +0100
Message-ID: <BANLkTinN6kh=3j0erCOOE7Gans4MCjeVjA@mail.gmail.com>
Subject: Re: coreutils Digest, Vol 16, Issue 10
From: e-letter <inpost@gmail.com>
To: coreutils@gnu.org
Content-Type: text/plain; charset=UTF-8
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.220.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, 17 Jun 2011 20:27:16 -0000

On 17/06/2011, coreutils-request@gnu.org <coreutils-request@gnu.org> wrote:
>
> But standard input doesn't mean that you can simply pass it the text on the
> command line! That means that you pipe the text as Bob showed you.
>
Apologies that did not realise!


From MAILER-DAEMON Sat Jun 18 15:23:58 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QY17d-0008RU-RD
	for mharc-coreutils@gnu.org; Sat, 18 Jun 2011 15:23:57 -0400
Received: from eggs.gnu.org ([140.186.70.92]:48647)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <stefano.lattarini@gmail.com>) id 1QY09a-0000MA-3C
	for coreutils@gnu.org; Sat, 18 Jun 2011 14:21:55 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <stefano.lattarini@gmail.com>) id 1QY09Y-0007X8-7W
	for coreutils@gnu.org; Sat, 18 Jun 2011 14:21:53 -0400
Received: from mail-wy0-f169.google.com ([74.125.82.169]:57899)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <stefano.lattarini@gmail.com>) id 1QY09X-0007Wz-R3
	for coreutils@gnu.org; Sat, 18 Jun 2011 14:21:52 -0400
Received: by wyf19 with SMTP id 19so2900564wyf.0
	for <coreutils@gnu.org>; Sat, 18 Jun 2011 11:21:51 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:from:to:subject:date:user-agent:cc:references
	:in-reply-to:mime-version:content-type:content-transfer-encoding
	:message-id; bh=VAdUVPuyeZb/oYFzhyrK8WNRCKjZJxZumQjDsJMUslg=;
	b=aPKNsRqavPqAmCsPvzf8vUXGbN7pTYiqcShKZ5xJ3xgUJ0YlOKc5YdS12o2En72I+Z
	bRlTsDHfqB8nyKWH+VTEr7CXyrpDCnx0rKHm0ivCE3HuT6t0av74f+ZYNr/nKQsFnx49
	gJY5E9KuveCRWZYs86z6L0FPsFZR+Q+mhSG7s=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=from:to:subject:date:user-agent:cc:references:in-reply-to
	:mime-version:content-type:content-transfer-encoding:message-id;
	b=NxqP5aD6zg+EHFTDIOZO7EQYiES+yJRtNmVpWB8+22Miir/xll7umSW4rsirR7J1qQ
	Wg52J/I5xGSCBAyPMNmqkWTspr2OcYJndin7gfmIthjt/aLL+xS7xQ5jHmdgGfBByeG4
	vzNhh5Kme63iAbBzMfu2xNHwUptapMM55P7Xg=
Received: by 10.227.164.129 with SMTP id e1mr3380972wby.67.1308421310626;
	Sat, 18 Jun 2011 11:21:50 -0700 (PDT)
Received: from bigio.localnet
	(host49-96-dynamic.4-87-r.retail.telecomitalia.it [87.4.96.49])
	by mx.google.com with ESMTPS id ge4sm1861219wbb.64.2011.06.18.11.21.48
	(version=TLSv1/SSLv3 cipher=OTHER);
	Sat, 18 Jun 2011 11:21:49 -0700 (PDT)
From: Stefano Lattarini <stefano.lattarini@gmail.com>
To: Jim Meyering <jim@meyering.net>
Subject: Best list where to post coreutils patches
Date: Sat, 18 Jun 2011 20:21:34 +0200
User-Agent: KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; )
References: <201106181326.13783.stefano.lattarini@gmail.com>
	<201106181945.27281.stefano.lattarini@gmail.com>
	<87liwzc8mn.fsf@rho.meyering.net>
In-Reply-To: <87liwzc8mn.fsf@rho.meyering.net>
MIME-Version: 1.0
Content-Type: Text/Plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Message-Id: <201106182021.34881.stefano.lattarini@gmail.com>
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 74.125.82.169
X-Mailman-Approved-At: Sat, 18 Jun 2011 15:23:56 -0400
Cc: coreutils@gnu.org
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Sat, 18 Jun 2011 18:21:55 -0000

[re-adding coreutils list]

On Saturday 18 June 2011, Jim Meyering wrote:
> Stefano Lattarini wrote:
> 
> > [off-list]
> >
> > On Saturday 18 June 2011, Jim Meyering wrote:
> >> Stefano Lattarini wrote:
> >> > A tiny silly cosmetic patch.
> >> >
> >> > I post it here because I couldn't find a "coreutils-patches" list; I
> >> > hope it's ok, and if not, sorry in advance.
> >>
> >> Thanks.
> >>
> >> coreutils@ is better for something trivial like this.
> >> Then we don't get an "issue" number in debbugs and
> >> we don't have to bother marking it as "done".
> >>
> > OK, I'll bear that in mind, thank you.
> >
> > BTW, is there any plan about introducing a 'coreutils-patches' list?
> 
> No.
> You're also welcome to send patches to the bug-coreutils list,
> as documented in README-hacking:
> 
>     * Submitting patches
> 
>     If you develop a fix or a new feature, please send it to the
>     appropriate bug-reporting address as reported by the --help option of
>     each program.
> 
> Questions like this are better posted to the mailing list.
>
OK, let's then make the answer public, at least :-)

> If you're asking it, odds are that you're not the only person
> who would benefit from a response.
> 
> Keeping as much as possible in the open (i.e., on public mailing lists)
> is better for "community spirit", too:
> 
>     http://producingoss.com/en/setting-tone.html#avoid-private-discussions
> 
Thanks, and sorry for the confusion.
  Stefano


From MAILER-DAEMON Sat Jun 18 17:40:15 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QY3FX-0006AQ-I1
	for mharc-coreutils@gnu.org; Sat, 18 Jun 2011 17:40:15 -0400
Received: from eggs.gnu.org ([140.186.70.92]:46135)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <james@youngman.org>) id 1QY3FV-0006AK-6t
	for coreutils@gnu.org; Sat, 18 Jun 2011 17:40:14 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <james@youngman.org>) id 1QY3FU-0005HR-67
	for coreutils@gnu.org; Sat, 18 Jun 2011 17:40:13 -0400
Received: from mail-vw0-f41.google.com ([209.85.212.41]:40463)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <james@youngman.org>) id 1QY3FU-0005HN-3m
	for coreutils@gnu.org; Sat, 18 Jun 2011 17:40:12 -0400
Received: by vws4 with SMTP id 4so3401236vws.0
	for <coreutils@gnu.org>; Sat, 18 Jun 2011 14:40:11 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.52.25.203 with SMTP id e11mr1592888vdg.201.1308433210408; Sat,
	18 Jun 2011 14:40:10 -0700 (PDT)
Sender: james@youngman.org
Received: by 10.52.168.132 with HTTP; Sat, 18 Jun 2011 14:40:10 -0700 (PDT)
In-Reply-To: <87boxwkc4i.fsf@rho.meyering.net>
References: <87boxwkc4i.fsf@rho.meyering.net>
Date: Sat, 18 Jun 2011 22:40:10 +0100
X-Google-Sender-Auth: EGcK2LvvEbQA8S_wrnMG2jwrNAE
Message-ID: <BANLkTimh=f=eURYAXOj3Z2kkDu0Q8L6ONQ@mail.gmail.com>
Subject: Re: [PATCH] tests: avoid sort-spinlock-abuse false positive under
	heavy load
From: James Youngman <jay@gnu.org>
To: Jim Meyering <jim@meyering.net>
Content-Type: text/plain; charset=UTF-8
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.212.41
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: Sat, 18 Jun 2011 21:40:14 -0000

On Fri, Jun 17, 2011 at 11:04 AM, Jim Meyering <jim@meyering.net> wrote:
> +# This isn't terribly expensive, but it must not be run under heavy load.
> +# Since the "very expensive" are already run only with -j1, adding this

"very expensive" tests

> +# test to the list ensures it still gets _some_ (albeit minimal) coverage
> +# while not causing false-positive failures in day to day runs.
> +very_expensive_


From MAILER-DAEMON Sun Jun 19 03:17:43 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QYCGN-0001cs-92
	for mharc-coreutils@gnu.org; Sun, 19 Jun 2011 03:17:43 -0400
Received: from eggs.gnu.org ([140.186.70.92]:46407)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QYCGK-0001cX-9z
	for coreutils@gnu.org; Sun, 19 Jun 2011 03:17:41 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QYCGI-0006P1-IZ
	for coreutils@gnu.org; Sun, 19 Jun 2011 03:17:40 -0400
Received: from mx.meyering.net ([82.230.74.64]:54250)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>)
	id 1QYCGH-0006Oj-Nd; Sun, 19 Jun 2011 03:17:38 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id A8E2D604A2; Sun, 19 Jun 2011 09:17:36 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: James Youngman <jay@gnu.org>
Subject: Re: [PATCH] tests: avoid sort-spinlock-abuse false positive under
	heavy load
In-Reply-To: <BANLkTimh=f=eURYAXOj3Z2kkDu0Q8L6ONQ@mail.gmail.com> (James
	Youngman's message of "Sat, 18 Jun 2011 22:40:10 +0100")
References: <87boxwkc4i.fsf@rho.meyering.net>
	<BANLkTimh=f=eURYAXOj3Z2kkDu0Q8L6ONQ@mail.gmail.com>
Date: Sun, 19 Jun 2011 09:17:36 +0200
Message-ID: <874o3mcmsv.fsf@rho.meyering.net>
Lines: 45
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: 82.230.74.64
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, 19 Jun 2011 07:17:41 -0000

James Youngman wrote:

> On Fri, Jun 17, 2011 at 11:04 AM, Jim Meyering <jim@meyering.net> wrote:
>> +# This isn't terribly expensive, but it must not be run under heavy load.
>> +# Since the "very expensive" are already run only with -j1, adding this
>
> "very expensive" tests
>
>> +# test to the list ensures it still gets _some_ (albeit minimal) coverage
>> +# while not causing false-positive failures in day to day runs.
>> +very_expensive_

Thanks.
I've pushed this fix:

>From c8392b368e33ed286dd00bf0c66bbae462513d61 Mon Sep 17 00:00:00 2001
From: James Youngman <jay@gnu.org>
Date: Sun, 19 Jun 2011 09:15:06 +0200
Subject: [PATCH] maint: typo: insert omitted word in test comment

* tests/misc/sort-spinlock-abuse: Fix typo:
s/"very expensive" are/"very expensive" tests are/
---
 tests/misc/sort-spinlock-abuse |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/misc/sort-spinlock-abuse b/tests/misc/sort-spinlock-abuse
index 0e1c86b..0894ec9 100755
--- a/tests/misc/sort-spinlock-abuse
+++ b/tests/misc/sort-spinlock-abuse
@@ -21,9 +21,9 @@
 print_ver_ sort

 # This isn't terribly expensive, but it must not be run under heavy load.
-# Since the "very expensive" are already run only with -j1, adding this
-# test to the list ensures it still gets _some_ (albeit minimal) coverage
-# while not causing false-positive failures in day to day runs.
+# Since the "very expensive" tests are already run only with -j1, adding
+# this test to the list ensures it still gets _some_ (albeit minimal)
+# coverage while not causing false-positive failures in day to day runs.
 very_expensive_

 grep '^#define HAVE_PTHREAD_T 1' "$CONFIG_HEADER" > /dev/null ||
--
1.7.6.rc2.4.g36bfb.dirty


From MAILER-DAEMON Sun Jun 19 06:52:43 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QYFcR-0002h3-8O
	for mharc-coreutils@gnu.org; Sun, 19 Jun 2011 06:52:43 -0400
Received: from eggs.gnu.org ([140.186.70.92]:51815)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QYFcP-0002gw-5z
	for coreutils@gnu.org; Sun, 19 Jun 2011 06:52:42 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QYFcO-0002hI-6F
	for coreutils@gnu.org; Sun, 19 Jun 2011 06:52:41 -0400
Received: from mx.meyering.net ([82.230.74.64]:53981)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QYFcN-0002hE-Vu
	for coreutils@gnu.org; Sun, 19 Jun 2011 06:52:40 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 3DB18600E0; Sun, 19 Jun 2011 12:52:39 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: pkglib_PROGRAMS is now rejected
Date: Sun, 19 Jun 2011 12:52:39 +0200
Message-ID: <87mxheaya0.fsf@rho.meyering.net>
Lines: 31
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: 82.230.74.64
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, 19 Jun 2011 10:52:42 -0000

I normally use automake built from the head of "master",
but not long ago, it started failing like this:

    src/Makefile.am:141: error: `pkglibdir' is not a legitimate directory \
      for `PROGRAMS'

That variable determines where we install libstdbuf.so.

One possibility is to change src/Makefile.am as below,
but that would mean moving libstdbuf.so from
$prefix/lib/coreutils/ to
$prefix/libexec/coreutils/
and adjusting stdbuf.c, and causing distros to adjust.

There's probably a less invasive change...

diff --git a/src/Makefile.am b/src/Makefile.am
index 516e1e5..ef0e7a4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -138,7 +138,7 @@ bin_PROGRAMS = $(OPTIONAL_BIN_PROGS)

 noinst_PROGRAMS = setuidgid getlimits

-pkglib_PROGRAMS = $(OPTIONAL_PKGLIB_PROGS)
+pkglibexec_PROGRAMS = $(OPTIONAL_PKGLIB_PROGS)

 noinst_HEADERS =	\
   chown-core.h		\
--
1.7.6.rc2.4.g36bfb.dirty


From MAILER-DAEMON Sun Jun 19 07:37:44 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QYGK0-0006f1-JH
	for mharc-coreutils@gnu.org; Sun, 19 Jun 2011 07:37:44 -0400
Received: from eggs.gnu.org ([140.186.70.92]:41291)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1QYGJx-0006ec-V1
	for coreutils@gnu.org; Sun, 19 Jun 2011 07:37:42 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1QYGJv-0008Bw-LG
	for coreutils@gnu.org; Sun, 19 Jun 2011 07:37:41 -0400
Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]:10869)
	by eggs.gnu.org with smtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1QYGJv-0008Bm-1e
	for coreutils@gnu.org; Sun, 19 Jun 2011 07:37:39 -0400
Received: (qmail 92497 invoked from network); 19 Jun 2011 11:37:36 -0000
Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218)
	by mail1.slb.deg.dub.stisp.net with SMTP; 19 Jun 2011 11:37:36 -0000
Message-ID: <4DFDDE8A.9090906@draigBrady.com>
Date: Sun, 19 Jun 2011 12:33:30 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US;
	rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
Subject: Re: pkglib_PROGRAMS is now rejected
References: <87mxheaya0.fsf@rho.meyering.net>
In-Reply-To: <87mxheaya0.fsf@rho.meyering.net>
X-Enigmail-Version: 1.0.1
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9
X-Received-From: 84.203.253.98
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, 19 Jun 2011 11:37:43 -0000

On 19/06/11 11:52, Jim Meyering wrote:
> I normally use automake built from the head of "master",
> but not long ago, it started failing like this:
> 
>     src/Makefile.am:141: error: `pkglibdir' is not a legitimate directory \
>       for `PROGRAMS'
> 
> That variable determines where we install libstdbuf.so.
> 
> One possibility is to change src/Makefile.am as below,
> but that would mean moving libstdbuf.so from
> $prefix/lib/coreutils/ to
> $prefix/libexec/coreutils/
> and adjusting stdbuf.c, and causing distros to adjust.
> 
> There's probably a less invasive change...
> 
> diff --git a/src/Makefile.am b/src/Makefile.am
> index 516e1e5..ef0e7a4 100644
> --- a/src/Makefile.am
> +++ b/src/Makefile.am
> @@ -138,7 +138,7 @@ bin_PROGRAMS = $(OPTIONAL_BIN_PROGS)
> 
>  noinst_PROGRAMS = setuidgid getlimits
> 
> -pkglib_PROGRAMS = $(OPTIONAL_PKGLIB_PROGS)
> +pkglibexec_PROGRAMS = $(OPTIONAL_PKGLIB_PROGS)
> 
>  noinst_HEADERS =	\
>    chown-core.h		\
> --
> 1.7.6.rc2.4.g36bfb.dirty

Well I used lib/ rather that libexec/ because
we don't actually dlload and link against the lib, and
also if it was in /usr/lib/ then one can specify
the lib without full path to LD_PRELOAD.
Though I notice that on Fedora 15 this lib is
in /usr/lib64/coreutils so the latter point is moot.

The above change might not cause much issues for
distros at all?

cheers,
Pádraig.


From MAILER-DAEMON Sun Jun 19 09:31:48 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QYI6N-00018i-E7
	for mharc-coreutils@gnu.org; Sun, 19 Jun 2011 09:31:47 -0400
Received: from eggs.gnu.org ([140.186.70.92]:42831)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QYI6K-00018G-QQ
	for coreutils@gnu.org; Sun, 19 Jun 2011 09:31:46 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QYI6J-0000uA-5S
	for coreutils@gnu.org; Sun, 19 Jun 2011 09:31:44 -0400
Received: from mx.meyering.net ([82.230.74.64]:51246)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QYI6I-0000u4-H6
	for coreutils@gnu.org; Sun, 19 Jun 2011 09:31:42 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 7AD086014F; Sun, 19 Jun 2011 15:31:41 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Subject: Re: pkglib_PROGRAMS is now rejected
In-Reply-To: <4DFDDE8A.9090906@draigBrady.com> (=?iso-8859-1?Q?=22P=E1drai?=
	=?iso-8859-1?Q?g?= Brady"'s message of
	"Sun, 19 Jun 2011 12:33:30 +0100")
References: <87mxheaya0.fsf@rho.meyering.net> <4DFDDE8A.9090906@draigBrady.com>
Date: Sun, 19 Jun 2011 15:31:41 +0200
Message-ID: <871uyqaqwy.fsf@rho.meyering.net>
Lines: 108
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: 82.230.74.64
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, 19 Jun 2011 13:31:46 -0000

P=E1draig Brady wrote:

> On 19/06/11 11:52, Jim Meyering wrote:
>> I normally use automake built from the head of "master",
>> but not long ago, it started failing like this:
>>
>>     src/Makefile.am:141: error: `pkglibdir' is not a legitimate director=
y \
>>       for `PROGRAMS'
>>
>> That variable determines where we install libstdbuf.so.
>>
>> One possibility is to change src/Makefile.am as below,
>> but that would mean moving libstdbuf.so from
>> $prefix/lib/coreutils/ to
>> $prefix/libexec/coreutils/
>> and adjusting stdbuf.c, and causing distros to adjust.
>>
>> There's probably a less invasive change...
>>
>> diff --git a/src/Makefile.am b/src/Makefile.am
>> index 516e1e5..ef0e7a4 100644
>> --- a/src/Makefile.am
>> +++ b/src/Makefile.am
>> @@ -138,7 +138,7 @@ bin_PROGRAMS =3D $(OPTIONAL_BIN_PROGS)
>>
>>  noinst_PROGRAMS =3D setuidgid getlimits
>>
>> -pkglib_PROGRAMS =3D $(OPTIONAL_PKGLIB_PROGS)
>> +pkglibexec_PROGRAMS =3D $(OPTIONAL_PKGLIB_PROGS)
>>
>>  noinst_HEADERS =3D	\
>>    chown-core.h		\
>> --
>> 1.7.6.rc2.4.g36bfb.dirty
>
> Well I used lib/ rather that libexec/ because
> we don't actually dlload and link against the lib, and
> also if it was in /usr/lib/ then one can specify
> the lib without full path to LD_PRELOAD.
> Though I notice that on Fedora 15 this lib is
> in /usr/lib64/coreutils so the latter point is moot.
>
> The above change might not cause much issues for
> distros at all?

Thanks for the quick feedback.
In that case, what do you think of this?

>From 0f14e7aa28bfc7b385f75ccd1b7d23e194462074 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Sun, 19 Jun 2011 11:41:24 +0200
Subject: [PATCH] build: fix automake variable name to work with cutting edge
 automake

* src/Makefile.am (pkglibexec_PROGRAMS): Rename from pkglib_PROGRAMS.
The latter is invalid.  Without this change, automake
v1.11-373-g9ca6326 and newer (on master) would fail with this:
`pkglibdir' is not a legitimate directory for `PROGRAMS'
This changes the default installation directory of libstdbuf.so from
$prefix/lib/coreutils/ to
$prefix/libexec/coreutils/
* src/stdbuf.c (set_LD_PRELOAD): Search in PKGLIBEXECDIR, not PKGLIBDIR,
since that's where we install libstdbuf.so.
Do not search in "", the system default directory.
---
 src/Makefile.am |    2 +-
 src/stdbuf.c    |    9 ++++-----
 2 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 516e1e5..ef0e7a4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -138,7 +138,7 @@ bin_PROGRAMS =3D $(OPTIONAL_BIN_PROGS)

 noinst_PROGRAMS =3D setuidgid getlimits

-pkglib_PROGRAMS =3D $(OPTIONAL_PKGLIB_PROGS)
+pkglibexec_PROGRAMS =3D $(OPTIONAL_PKGLIB_PROGS)

 noinst_HEADERS =3D	\
   chown-core.h		\
diff --git a/src/stdbuf.c b/src/stdbuf.c
index f51dc6a..6fd803c 100644
--- a/src/stdbuf.c
+++ b/src/stdbuf.c
@@ -193,15 +193,14 @@ set_LD_PRELOAD (void)
   char *LD_PRELOAD;

   /* Note this would auto add the appropriate search path for "libstdbuf.s=
o":
-     gcc stdbuf.c -Wl,-rpath,'$ORIGIN' -Wl,-rpath,$PKGLIBDIR
+     gcc stdbuf.c -Wl,-rpath,'$ORIGIN' -Wl,-rpath,$PKGLIBEXECDIR
      However we want the lookup done for the exec'd command not stdbuf.

-     Since we don't link against libstdbuf.so add it to LIBDIR rather than
-     LIBEXECDIR, as we'll search for it in the "sys default" case below.  =
*/
+     Since we don't link against libstdbuf.so add it to PKGLIBEXECDIR
+     rather than to LIBDIR.  */
   char const *const search_path[] =3D {
     program_path,
-    PKGLIBDIR,
-    "",                         /* sys default */
+    PKGLIBEXECDIR,
     NULL
   };

--
1.7.6.rc2.4.g36bfb.dirty


From MAILER-DAEMON Sun Jun 19 15:31:48 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QYNim-0000mO-4u
	for mharc-coreutils@gnu.org; Sun, 19 Jun 2011 15:31:48 -0400
Received: from eggs.gnu.org ([140.186.70.92]:40127)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1QYNij-0000mD-KC
	for coreutils@gnu.org; Sun, 19 Jun 2011 15:31:46 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1QYNii-0003la-Vy
	for coreutils@gnu.org; Sun, 19 Jun 2011 15:31:45 -0400
Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]:4291)
	by eggs.gnu.org with smtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1QYNii-0003lV-QH
	for coreutils@gnu.org; Sun, 19 Jun 2011 15:31:44 -0400
Received: (qmail 40569 invoked from network); 19 Jun 2011 19:31:43 -0000
Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218)
	by mail1.slb.deg.dub.stisp.net with SMTP; 19 Jun 2011 19:31:43 -0000
Message-ID: <4DFE4DA8.6060303@draigBrady.com>
Date: Sun, 19 Jun 2011 20:27:36 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US;
	rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
Subject: Re: pkglib_PROGRAMS is now rejected
References: <87mxheaya0.fsf@rho.meyering.net>	<4DFDDE8A.9090906@draigBrady.com>
	<871uyqaqwy.fsf@rho.meyering.net>
In-Reply-To: <871uyqaqwy.fsf@rho.meyering.net>
X-Enigmail-Version: 1.0.1
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9
X-Received-From: 84.203.253.98
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, 19 Jun 2011 19:31:46 -0000

On 19/06/11 14:31, Jim Meyering wrote:
> Do not search in "", the system default directory.

s/directory/search path/

Otherwise looks good.

thanks,
Pádraig.


From MAILER-DAEMON Mon Jun 20 01:44:13 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QYXHR-0007PS-5p
	for mharc-coreutils@gnu.org; Mon, 20 Jun 2011 01:44:13 -0400
Received: from eggs.gnu.org ([140.186.70.92]:39096)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QYXHO-0007Or-5Q
	for coreutils@gnu.org; Mon, 20 Jun 2011 01:44:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QYXHM-00016G-RX
	for coreutils@gnu.org; Mon, 20 Jun 2011 01:44:09 -0400
Received: from mx.meyering.net ([82.230.74.64]:40517)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QYXHM-00016A-Hp
	for coreutils@gnu.org; Mon, 20 Jun 2011 01:44:08 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 9EC91600D4; Mon, 20 Jun 2011 07:44:05 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Subject: Re: pkglib_PROGRAMS is now rejected
In-Reply-To: <4DFE4DA8.6060303@draigBrady.com> (=?iso-8859-1?Q?=22P=E1drai?=
	=?iso-8859-1?Q?g?= Brady"'s message of
	"Sun, 19 Jun 2011 20:27:36 +0100")
References: <87mxheaya0.fsf@rho.meyering.net>
	<4DFDDE8A.9090906@draigBrady.com> <871uyqaqwy.fsf@rho.meyering.net>
	<4DFE4DA8.6060303@draigBrady.com>
Date: Mon, 20 Jun 2011 07:44:05 +0200
Message-ID: <87zkld6ore.fsf@rho.meyering.net>
Lines: 10
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: 82.230.74.64
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, 20 Jun 2011 05:44:11 -0000

P=E1draig Brady wrote:

> On 19/06/11 14:31, Jim Meyering wrote:
>> Do not search in "", the system default directory.
>
> s/directory/search path/
>
> Otherwise looks good.

Thanks.  Pushed with that correction.


From MAILER-DAEMON Mon Jun 20 03:26:11 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QYYs6-0002E6-FK
	for mharc-coreutils@gnu.org; Mon, 20 Jun 2011 03:26:10 -0400
Received: from eggs.gnu.org ([140.186.70.92]:34276)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bernhard.voelker@siemens-enterprise.com>)
	id 1QYYs3-0002Dp-24
	for coreutils@gnu.org; Mon, 20 Jun 2011 03:26:08 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bernhard.voelker@siemens-enterprise.com>)
	id 1QYYs1-00074R-GY
	for coreutils@gnu.org; Mon, 20 Jun 2011 03:26:06 -0400
Received: from mail27.messagelabs.com ([193.109.254.147]:2205)
	by eggs.gnu.org with smtp (Exim 4.71)
	(envelope-from <bernhard.voelker@siemens-enterprise.com>)
	id 1QYYs1-000743-91; Mon, 20 Jun 2011 03:26:05 -0400
X-VirusChecked: Checked
X-Env-Sender: bernhard.voelker@siemens-enterprise.com
X-Msg-Ref: server-6.tower-27.messagelabs.com!1308554753!41126806!1
X-StarScan-Version: 6.2.17; banners=-,-,-
X-Originating-IP: [62.134.46.10]
Received: (qmail 8175 invoked from network); 20 Jun 2011 07:25:53 -0000
Received: from unknown (HELO senmx12-mx) (62.134.46.10)
	by server-6.tower-27.messagelabs.com with SMTP;
	20 Jun 2011 07:25:53 -0000
Received: from MCHP063A.global-ad.net (unknown [172.29.37.61])
	by senmx12-mx (Server) with ESMTP id B250123F03E2;
	Mon, 20 Jun 2011 09:26:02 +0200 (CEST)
Received: from MCHP058A.global-ad.net ([172.29.37.57]) by
	MCHP063A.global-ad.net ([172.29.37.61]) with mapi;
	Mon, 20 Jun 2011 09:26:02 +0200
From: "Voelker, Bernhard" <bernhard.voelker@siemens-enterprise.com>
To: Jim Meyering <jim@meyering.net>, James Youngman <jay@gnu.org>
Date: Mon, 20 Jun 2011 09:25:49 +0200
Subject: RE: [PATCH] tests: use printf, not echo in init.sh's warn_ function
Thread-Topic: [PATCH] tests: use printf, not echo in init.sh's warn_ function
Thread-Index: AcwtCyg+u9WINxrTQzmP87d93YB5jACD6qyA
Message-ID: <7856072A9D04C24B82DFE2B1112FE38A088084843B@MCHP058A.global-ad.net>
References: <874o3s8ppn.fsf@rho.meyering.net> <4DF76F84.8020201@redhat.com>
	<BANLkTimC0=+MV96gUhmLvYPpfYPGMyaZPg@mail.gmail.com>
	<87zkliyhp4.fsf@rho.meyering.net> <87fwn8lxvo.fsf@rho.meyering.net>
In-Reply-To: <87fwn8lxvo.fsf@rho.meyering.net>
Accept-Language: de-DE, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: de-DE, en-US
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6
X-Received-From: 193.109.254.147
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, 20 Jun 2011 07:26:08 -0000

Jim Meyering wrote:

> From 7f8d9892fb4ce29821fc824defaa6e0d32740feb Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering@redhat.com>
> Date: Tue, 14 Jun 2011 15:37:48 +0200
> Subject: [PATCH 1/3] tests: use printf, not echo in init.sh's warn_ funct=
ion
>=20
> * tests/init.sh (warn_): Use printf, not echo.  The latter would
> misbehave when given strings containing a backslash or starting
> with e.g., -n.  James Youngman suggested setting IFS.
> ---
>  tests/init.sh |   12 +++++++++++-
>  1 files changed, 11 insertions(+), 1 deletions(-)
>=20
> diff --git a/tests/init.sh b/tests/init.sh
> index 4a52626..5f06b5e 100644
> --- a/tests/init.sh
> +++ b/tests/init.sh
> @@ -74,7 +74,17 @@ Exit () { set +e; (exit $1); exit $1; }
>  # the reason for skip/failure to console, rather than to the .log files.
>  : ${stderr_fileno_=3D2}
>=20
> -warn_ () { echo "$@" 1>&$stderr_fileno_; }
> +# Call w2_ only via warn_, since correct expansion of "$*" depends on
> +# IFS starting with ' '.
> +w2_ () { printf '%s\n' "$*" 1>&$stderr_fileno_ ; }
> +warn_ ()
> +{
> +  # If IFS does not start with ' ', set it and emit the warning in a sub=
shell.
> +  case $IFS in
> +    ' '*) w2_ "$@";;
> +    *) (IFS=3D' '; w2_ "$@");;
> +  esac
> +}
>  fail_ () { warn_ "$ME_: failed test: $@"; Exit 1; }
>  skip_ () { warn_ "$ME_: skipped test: $@"; Exit 77; }
>  fatal_ () { warn_ "$ME_: hard error: $@"; Exit 99; }
> --
> 1.7.6.rc0.293.g40857
>=20
>=20
> From 13672ec3211a5a77caf16dc24b83100d57e2a2ec Mon Sep 17 00:00:00 2001
> From: Jim Meyering <meyering@redhat.com>
> Date: Fri, 17 Jun 2011 09:02:09 +0200
> Subject: [PATCH 2/3] tests: make init.sh's warn_ emit to both the tty and=
 the
>  log file
>=20
> * tests/init.sh (warn_): When $stderr_fileno_ !=3D 2,
> emit the diagnostic to both the tty and the log file.
> ---
>  tests/init.sh |    8 ++++++--
>  1 files changed, 6 insertions(+), 2 deletions(-)
>=20
> diff --git a/tests/init.sh b/tests/init.sh
> index 5f06b5e..d7a5d83 100644
> --- a/tests/init.sh
> +++ b/tests/init.sh
> @@ -75,8 +75,12 @@ Exit () { set +e; (exit $1); exit $1; }
>  : ${stderr_fileno_=3D2}
>=20
>  # Call w2_ only via warn_, since correct expansion of "$*" depends on
> -# IFS starting with ' '.
> -w2_ () { printf '%s\n' "$*" 1>&$stderr_fileno_ ; }
> +# IFS starting with ' '.  Always write the full diagnostic to stderr.
> +# When stderr_fileno_ is not 2, also emit the first line of the
> +# diagnostic to that file descriptor.
> +w2_ () { printf '%s\n' "$*" >&2
> +         test $stderr_fileno_ =3D 2 \
> +           || { printf '%s\n' "$*" | head -1 >&$stderr_fileno_ ; } ; }
>  warn_ ()
>  {
>    # If IFS does not start with ' ', set it and emit the warning in a sub=
shell.
> --
> 1.7.6.rc0.293.g40857

why not re-using the same function, i.e. why not retire w2_?
btw: isn't head -1 deprecated use?

warn_ ()
{
  # If IFS does not start with ' ', set it and emit the warning in a subshe=
ll.
  case $IFS in
    ' '*) printf '%s\n' "$*" >&2
          test $stderr_fileno_ =3D 2 \
            || { printf '%s\n' "$*" | head -n 1 >&$stderr_fileno_ ; } ;;
    *) (IFS=3D' '; warn_ "$@");;
  esac
}

Have a nice day,
Berny=


From MAILER-DAEMON Mon Jun 20 04:03:26 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QYZSA-0006L7-DL
	for mharc-coreutils@gnu.org; Mon, 20 Jun 2011 04:03:26 -0400
Received: from eggs.gnu.org ([140.186.70.92]:34371)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QYZS7-0006L1-4C
	for coreutils@gnu.org; Mon, 20 Jun 2011 04:03:24 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QYZS5-0004o1-Ig
	for coreutils@gnu.org; Mon, 20 Jun 2011 04:03:23 -0400
Received: from mx.meyering.net ([82.230.74.64]:38471)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>)
	id 1QYZS5-0004nv-57; Mon, 20 Jun 2011 04:03:21 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 5A6C760107; Mon, 20 Jun 2011 10:03:20 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: "Voelker\, Bernhard" <bernhard.voelker@siemens-enterprise.com>
Subject: Re: [PATCH] tests: use printf, not echo in init.sh's warn_ function
In-Reply-To: <7856072A9D04C24B82DFE2B1112FE38A088084843B@MCHP058A.global-ad.net>
	(Bernhard Voelker's message of "Mon, 20 Jun 2011 09:25:49 +0200")
References: <874o3s8ppn.fsf@rho.meyering.net> <4DF76F84.8020201@redhat.com>
	<BANLkTimC0=+MV96gUhmLvYPpfYPGMyaZPg@mail.gmail.com>
	<87zkliyhp4.fsf@rho.meyering.net> <87fwn8lxvo.fsf@rho.meyering.net>
	<7856072A9D04C24B82DFE2B1112FE38A088084843B@MCHP058A.global-ad.net>
Date: Mon, 20 Jun 2011 10:03:20 +0200
Message-ID: <87hb7l6ibb.fsf@rho.meyering.net>
Lines: 96
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: 82.230.74.64
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, 20 Jun 2011 08:03:24 -0000

Voelker, Bernhard wrote:
> why not re-using the same function, i.e. why not retire w2_?
> btw: isn't head -1 deprecated use?

Thanks for mentioning it.  That usage is actually officially obsolete, now.
The trouble is that "head -1" is more portable than "head -n1", so
I'll replace it with sed 1q.  See below.

> warn_ ()
> {
>   # If IFS does not start with ' ', set it and emit the warning in a subshell.
>   case $IFS in
>     ' '*) printf '%s\n' "$*" >&2
>           test $stderr_fileno_ = 2 \
>             || { printf '%s\n' "$*" | head -n 1 >&$stderr_fileno_ ; } ;;
>     *) (IFS=' '; warn_ "$@");;
>   esac
> }

Good idea.  Thanks!
Your name is on the following, so I'll wait for your ACK.
I used your email address from THANKS.
Let me know if you'd prefer a different one.

>From b970f0a50546e7cc062b0f76df45ae69661b2846 Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <mail@bernhard-voelker.de>
Date: Mon, 20 Jun 2011 09:46:06 +0200
Subject: [PATCH] tests: improve init.sh by removing w2_

* tests/init.sh (w2_): Remove, moving contents into...
(warn_): ...here.  Call self from subshell when IFS must be changed.
---
 tests/init.sh |   13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/tests/init.sh b/tests/init.sh
index b857730..5878179 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -74,19 +74,18 @@ Exit () { set +e; (exit $1); exit $1; }
 # the reason for skip/failure to console, rather than to the .log files.
 : ${stderr_fileno_=2}

-# Call w2_ only via warn_, since correct expansion of "$*" depends on
-# IFS starting with ' '.  Always write the full diagnostic to stderr.
+# Note that correct expansion of "$*" depends on IFS starting with ' '.
+# Always write the full diagnostic to stderr.
 # When stderr_fileno_ is not 2, also emit the first line of the
 # diagnostic to that file descriptor.
-w2_ () { printf '%s\n' "$*" >&2
-         test $stderr_fileno_ = 2 \
-           || { printf '%s\n' "$*" | head -1 >&$stderr_fileno_ ; } ; }
 warn_ ()
 {
   # If IFS does not start with ' ', set it and emit the warning in a subshell.
   case $IFS in
-    ' '*) w2_ "$@";;
-    *) (IFS=' '; w2_ "$@");;
+    ' '*) printf '%s\n' "$*" >&2
+          test $stderr_fileno_ = 2 \
+            || { printf '%s\n' "$*" | head -1 >&$stderr_fileno_ ; } ;;
+    *) (IFS=' '; warn_ "$@");;
   esac
 }
 fail_ () { warn_ "$ME_: failed test: $@"; Exit 1; }
--
1.7.6.rc2.9.g58b6a


>From 1d919fbb7fc5e75e3bf2835f9e2fccbe179b7d69 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Mon, 20 Jun 2011 10:01:43 +0200
Subject: [PATCH] tests: init.sh: use "sed 1q" in place of "head -1"

* tests/init.sh (warn_): Use "sed 1q" in place of "head -1".
The latter is officially obsolete but more portable than "head -n1".
Reported by Bernhard Voelker.
---
 tests/init.sh |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tests/init.sh b/tests/init.sh
index 5878179..460937d 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -84,7 +84,7 @@ warn_ ()
   case $IFS in
     ' '*) printf '%s\n' "$*" >&2
           test $stderr_fileno_ = 2 \
-            || { printf '%s\n' "$*" | head -1 >&$stderr_fileno_ ; } ;;
+            || { printf '%s\n' "$*" | sed 1q >&$stderr_fileno_ ; } ;;
     *) (IFS=' '; warn_ "$@");;
   esac
 }
--
1.7.6.rc2.9.g58b6a


From MAILER-DAEMON Mon Jun 20 04:35:43 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QYZxO-0002co-HW
	for mharc-coreutils@gnu.org; Mon, 20 Jun 2011 04:35:42 -0400
Received: from eggs.gnu.org ([140.186.70.92]:38522)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bernhard.voelker@siemens-enterprise.com>)
	id 1QYZxI-0002cN-Tj
	for coreutils@gnu.org; Mon, 20 Jun 2011 04:35:37 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bernhard.voelker@siemens-enterprise.com>)
	id 1QYZxH-00017L-Qx
	for coreutils@gnu.org; Mon, 20 Jun 2011 04:35:36 -0400
Received: from mail216.messagelabs.com ([85.158.143.99]:42609)
	by eggs.gnu.org with smtp (Exim 4.71)
	(envelope-from <bernhard.voelker@siemens-enterprise.com>)
	id 1QYZxH-00017D-Hh; Mon, 20 Jun 2011 04:35:35 -0400
X-VirusChecked: Checked
X-Env-Sender: bernhard.voelker@siemens-enterprise.com
X-Msg-Ref: server-14.tower-216.messagelabs.com!1308558933!8817204!1
X-StarScan-Version: 6.2.17; banners=-,-,-
X-Originating-IP: [62.134.46.10]
Received: (qmail 22858 invoked from network); 20 Jun 2011 08:35:33 -0000
Received: from unknown (HELO senmx12-mx) (62.134.46.10)
	by server-14.tower-216.messagelabs.com with SMTP;
	20 Jun 2011 08:35:33 -0000
Received: from MCHP063A.global-ad.net (unknown [172.29.37.61])
	by senmx12-mx (Server) with ESMTP id 50DA823F03E6;
	Mon, 20 Jun 2011 10:35:33 +0200 (CEST)
Received: from MCHP058A.global-ad.net ([172.29.37.57]) by
	MCHP063A.global-ad.net ([172.29.37.61]) with mapi;
	Mon, 20 Jun 2011 10:35:33 +0200
From: "Voelker, Bernhard" <bernhard.voelker@siemens-enterprise.com>
To: Jim Meyering <jim@meyering.net>
Date: Mon, 20 Jun 2011 10:35:16 +0200
Subject: RE: [PATCH] tests: use printf, not echo in init.sh's warn_ function
Thread-Topic: [PATCH] tests: use printf, not echo in init.sh's warn_ function
Thread-Index: AcwvIIXb0i7FkIrOSY6E9fmcxRiyIQABDvZg
Message-ID: <7856072A9D04C24B82DFE2B1112FE38A08808484B6@MCHP058A.global-ad.net>
References: <874o3s8ppn.fsf@rho.meyering.net> <4DF76F84.8020201@redhat.com>
	<BANLkTimC0=+MV96gUhmLvYPpfYPGMyaZPg@mail.gmail.com>
	<87zkliyhp4.fsf@rho.meyering.net> <87fwn8lxvo.fsf@rho.meyering.net>
	<7856072A9D04C24B82DFE2B1112FE38A088084843B@MCHP058A.global-ad.net>
	<87hb7l6ibb.fsf@rho.meyering.net>
In-Reply-To: <87hb7l6ibb.fsf@rho.meyering.net>
Accept-Language: de-DE, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: de-DE, en-US
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6
X-Received-From: 85.158.143.99
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, 20 Jun 2011 08:35:38 -0000

Jim Meyering wrote:

> Your name is on the following, so I'll wait for your ACK.
> I used your email address from THANKS.
> Let me know if you'd prefer a different one.

that's fine, thanks.

Have a nice day,
Berny=


From MAILER-DAEMON Mon Jun 20 06:47:34 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QYc10-0000Nt-Ks
	for mharc-coreutils@gnu.org; Mon, 20 Jun 2011 06:47:34 -0400
Received: from eggs.gnu.org ([140.186.70.92]:38030)
	by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <pth@suse.de>)
	id 1QYc0y-0000Mw-3J
	for coreutils@gnu.org; Mon, 20 Jun 2011 06:47:33 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <pth@suse.de>) id 1QYc0w-00082S-Ny
	for coreutils@gnu.org; Mon, 20 Jun 2011 06:47:31 -0400
Received: from cantor.suse.de ([195.135.220.2]:48562 helo=mx1.suse.de)
	by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <pth@suse.de>)
	id 1QYc0w-000821-CG
	for coreutils@gnu.org; Mon, 20 Jun 2011 06:47:30 -0400
Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.221.2])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.suse.de (Postfix) with ESMTP id 9592C93F19;
	Mon, 20 Jun 2011 12:47:27 +0200 (CEST)
Date: Mon, 20 Jun 2011 12:47:26 +0200
From: Philipp Thomas <pth@suse.de>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Subject: Re: Supporting reflinked/cow files in coreutils
Message-ID: <20110620104726.GB18107@paradies.suse.de>
References: <20110414143352.GC5231@paradies.suse.de>
	<4DA71296.8040000@draigBrady.com>
	<20110616124842.GG11744@paradies.suse.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
In-Reply-To: <20110616124842.GG11744@paradies.suse.de>
X-Operating-System: openSUSE - Kernel Linux 3.0.0-rc2-1-desktop x86_64
Organization: SUSE LINUX Products GmbH, =?iso-8859-1?Q?G?=
	=?iso-8859-1?Q?F=3A_Jeff_Hawn=2C_Jennifer_Guild=2C_Felix_Imend=F6rffer=2C?=
	=?iso-8859-1?Q?_HRB_21284_=28AG_N=FCrnberg=29?=
User-Agent: Mutt/1.5.21 (2010-09-15)
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6
X-Received-From: 195.135.220.2
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, 20 Jun 2011 10:47:33 -0000

P=E1draig, Jeff,

[forget Jeff in the initial reply, thus the full quote]

* Philipp Thomas (pth@suse.de) [20110616 15:32]:

> I finally got the time to look into copy.c and found the code you're
> speaking of. Looking at the ocfs2 code it seems to me that OCFS2_IOC_RE=
FLINK
> is what is needed for but that is where my knowledge ends. Jeff could y=
ou
> fill in the pieces needed to make clone_file also work on ocfs2?

Philipp


From MAILER-DAEMON Mon Jun 20 10:25:27 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QYfPq-0004bN-SM
	for mharc-coreutils@gnu.org; Mon, 20 Jun 2011 10:25:27 -0400
Received: from eggs.gnu.org ([140.186.70.92]:42931)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <susanto.huang@gmail.com>) id 1QYfMY-0003h4-FM
	for coreutils@gnu.org; Mon, 20 Jun 2011 10:22:04 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <susanto.huang@gmail.com>) id 1QYfMW-0001lF-Eb
	for coreutils@gnu.org; Mon, 20 Jun 2011 10:22:02 -0400
Received: from mail-ww0-f41.google.com ([74.125.82.41]:39494)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <susanto.huang@gmail.com>) id 1QYfMW-0001l4-0a
	for coreutils@gnu.org; Mon, 20 Jun 2011 10:22:00 -0400
Received: by wwi18 with SMTP id 18so2654754wwi.0
	for <coreutils@gnu.org>; Mon, 20 Jun 2011 07:21:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:date:message-id:subject:from:to
	:content-type; bh=Jh4uQ2O8Kekiv8q+I5YhekRopTE0v2KXCDMI2BvSajU=;
	b=x2cfk02QOSYjAP0elSLJgjEZwNxXKkjiUGr54N0zZfiZwqk9mbPl3Qt4orrIdcI3TC
	TfwzYp6ZUmhwRKp00HOaaGYxr3IvhxTsAdgfiG0ByMSXWa+yiHUGvg5J4OLbqohkK/XV
	iZn8wlLPOjc1UTRgX71cK112WTa2Bq4aX4F6A=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	b=pYWX9MxHkrkJO/yudry6CjxYl/7F/9eHtgaUcKUYw25WIY3R/aodZnAcUJFT2qX3E8
	q1vbfqsPswNp0mDxfuobnxpmMeyDgZRQm7JMUSqyTHOLwvW948N1eR8J9sx53pxJCrI6
	LWUaW4quwbM/hqKPSwRsiXt72wRUC8dqzrJlQ=
MIME-Version: 1.0
Received: by 10.216.23.202 with SMTP id v52mr2736566wev.103.1308579717912;
	Mon, 20 Jun 2011 07:21:57 -0700 (PDT)
Received: by 10.216.190.168 with HTTP; Mon, 20 Jun 2011 07:21:57 -0700 (PDT)
Date: Mon, 20 Jun 2011 22:21:57 +0800
Message-ID: <BANLkTinNFApdJXs5sUhGecC4L4pGO5u5ag@mail.gmail.com>
Subject: mv * command
From: Susanto Wijaya <susanto.huang@gmail.com>
To: coreutils@gnu.org
Content-Type: multipart/alternative; boundary=0016367f98383f189204a6257583
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 74.125.82.41
X-Mailman-Approved-At: Mon, 20 Jun 2011 10:25:24 -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: Mon, 20 Jun 2011 14:22:04 -0000

--0016367f98383f189204a6257583
Content-Type: text/plain; charset=ISO-8859-1

Hello Everyone,


A very good day to you

May I ask question about mv * command?


The question is when I use mv filename command using normal user login, the
result is all files and directory will lost except might be 1 folder

If I use mv * command using root user in root directory "/", the result is
all files and directory in / root directory will gone.

Is all directory and files move to /dev/null ?

Now all my files in home directory is lost after run the mv * command

Your answer is really appreciated



Regards,

Susanto

--0016367f98383f189204a6257583
Content-Type: text/html; charset=ISO-8859-1

Hello Everyone,<br><br><br>A very good day to you<br>
<br>May I ask question about mv * command?<br>
<br>
<br>The question is when I use mv filename command using normal user login, the result is all files and directory will lost except might be 1 folder<br>
<br>If I use mv * command using root user in root directory &quot;/&quot;, the result is all files and directory in / root directory will gone.<br>
<br>Is all directory and files move to /dev/null ?<br><br>Now all my files in home directory is lost after run the mv * command <br><br>Your answer is really appreciated<br><br><br><br>Regards,<br><br>Susanto<br>

--0016367f98383f189204a6257583--


From MAILER-DAEMON Mon Jun 20 12:15:52 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QYh8h-0001ou-Tf
	for mharc-coreutils@gnu.org; Mon, 20 Jun 2011 12:15:51 -0400
Received: from eggs.gnu.org ([140.186.70.92]:39899)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mihamina@bbs.mg>) id 1QYgpd-0005Ad-El
	for coreutils@gnu.org; Mon, 20 Jun 2011 11:56:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mihamina@bbs.mg>) id 1QYgpc-0002Y2-18
	for coreutils@gnu.org; Mon, 20 Jun 2011 11:56:09 -0400
Received: from smtp-out.malagasy.com ([41.204.104.33]:45586)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mihamina@bbs.mg>) id 1QYgpb-0002WK-GG
	for coreutils@gnu.org; Mon, 20 Jun 2011 11:56:07 -0400
Received: from smtp-2.blueline.mg (unknown [41.204.104.56])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by smtp-out.malagasy.com (Postfix) with ESMTPS id 5585D8DC71
	for <coreutils@gnu.org>; Mon, 20 Jun 2011 18:55:58 +0300 (EAT)
Received: from localhost (static-104-53.blueline.mg [41.204.104.53])
	by smtp-2.blueline.mg (Postfix) with ESMTP id 4CBA56008A
	for <coreutils@gnu.org>; Mon, 20 Jun 2011 18:55:58 +0300 (EAT)
X-Virus-Scanned: par antivirus2.malagasy.com
Received: from smtp-2.blueline.mg ([41.204.104.56])
	by localhost (antivirus2.malagasy.com [41.204.104.53]) (amavisd-new,
	port 10024) with ESMTP id UVnMHSdgURsM for <coreutils@gnu.org>;
	Mon, 20 Jun 2011 18:55:53 +0300 (EAT)
Received: from packard.rktmb.org (staff-104-10.malagasy.com [41.204.104.10])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	(Authenticated sender: mihamina@bbs.mg)
	by smtp-2.blueline.mg (Postfix) with ESMTPSA id 858876007E
	for <coreutils@gnu.org>; Mon, 20 Jun 2011 18:55:52 +0300 (EAT)
Date: Mon, 20 Jun 2011 18:55:49 +0300
From: Mihamina Rakotomandimby <mihamina@bbs.mg>
To: coreutils@gnu.org
Subject: Re: mv * command
Message-Id: <20110620185549.679673da.mihamina@bbs.mg>
In-Reply-To: <BANLkTinNFApdJXs5sUhGecC4L4pGO5u5ag@mail.gmail.com>
References: <BANLkTinNFApdJXs5sUhGecC4L4pGO5u5ag@mail.gmail.com>
X-Mailer: Sylpheed 3.1.0beta2 (GTK+ 2.22.0; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 41.204.104.33
X-Mailman-Approved-At: Mon, 20 Jun 2011 12:15:50 -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: Mon, 20 Jun 2011 15:56:11 -0000

> On Mon, 20 Jun 2011 22:21:57 +0800
> Susanto Wijaya <susanto.huang@gmail.com> wrote:
> May I ask question about mv * command?

I dont understand your set of questions.
I think you try to experiment the expansion of "*", but I cant assume.

Could you be more precise?

-- 
RMA.


From MAILER-DAEMON Mon Jun 20 12:28:24 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QYhKq-0005Wa-7a
	for mharc-coreutils@gnu.org; Mon, 20 Jun 2011 12:28:24 -0400
Received: from eggs.gnu.org ([140.186.70.92]:43752)
	by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <pth@suse.de>)
	id 1QYhKm-0005Vd-QL
	for coreutils@gnu.org; Mon, 20 Jun 2011 12:28:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <pth@suse.de>) id 1QYhKl-0001wj-Jf
	for coreutils@gnu.org; Mon, 20 Jun 2011 12:28:20 -0400
Received: from cantor2.suse.de ([195.135.220.15]:51513 helo=mx2.suse.de)
	by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <pth@suse.de>)
	id 1QYhKl-0001wY-5n
	for coreutils@gnu.org; Mon, 20 Jun 2011 12:28:19 -0400
Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.221.2])
	by mx2.suse.de (Postfix) with ESMTP id E25968765C
	for <coreutils@gnu.org>; Mon, 20 Jun 2011 18:28:17 +0200 (CEST)
Date: Mon, 20 Jun 2011 18:28:17 +0200
From: Philipp Thomas <pth@suse.de>
To: coreutils@gnu.org
Subject: Re: mv * command
Message-ID: <20110620162817.GD18107@paradies.suse.de>
References: <BANLkTinNFApdJXs5sUhGecC4L4pGO5u5ag@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <BANLkTinNFApdJXs5sUhGecC4L4pGO5u5ag@mail.gmail.com>
X-Operating-System: openSUSE - Kernel Linux 3.0.0-rc2-1-desktop x86_64
Organization: SUSE LINUX Products GmbH, =?iso-8859-1?Q?G?=
	=?iso-8859-1?Q?F=3A_Jeff_Hawn=2C_Jennifer_Guild=2C_Felix_Imend=F6rffer=2C?=
	=?iso-8859-1?Q?_HRB_21284_=28AG_N=FCrnberg=29?=
User-Agent: Mutt/1.5.21 (2010-09-15)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6
X-Received-From: 195.135.220.15
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, 20 Jun 2011 16:28:22 -0000

* Susanto Wijaya (susanto.huang@gmail.com) [20110620 16:25]:

> If I use mv * command using root user in root directory "/", the result is
> all files and directory in / root directory will gone.

I think most if not all won't understand what you're asking for, so could
you give precise examples of what you are trying to do?

Philipp


From MAILER-DAEMON Mon Jun 20 12:58:51 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QYhoI-0005VE-DA
	for mharc-coreutils@gnu.org; Mon, 20 Jun 2011 12:58:50 -0400
Received: from eggs.gnu.org ([140.186.70.92]:39941)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QYhoF-0005UT-Uu
	for coreutils@gnu.org; Mon, 20 Jun 2011 12:58:49 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QYhoE-0001V9-1W
	for coreutils@gnu.org; Mon, 20 Jun 2011 12:58:47 -0400
Received: from mx1.redhat.com ([209.132.183.28]:20584)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QYhoD-0001Us-K2
	for coreutils@gnu.org; Mon, 20 Jun 2011 12:58:45 -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 p5KGwhn8026643
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 20 Jun 2011 12:58:43 -0400
Received: from [10.3.113.98] (ovpn-113-98.phx2.redhat.com [10.3.113.98])
	by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id p5KGwh90003228; Mon, 20 Jun 2011 12:58:43 -0400
Message-ID: <4DFF7C42.7000007@redhat.com>
Date: Mon, 20 Jun 2011 10:58:42 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14
	Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10
MIME-Version: 1.0
To: Susanto Wijaya <susanto.huang@gmail.com>
Subject: Re: mv * command
References: <BANLkTinNFApdJXs5sUhGecC4L4pGO5u5ag@mail.gmail.com>
In-Reply-To: <BANLkTinNFApdJXs5sUhGecC4L4pGO5u5ag@mail.gmail.com>
X-Enigmail-Version: 1.1.2
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="------------enig4D1AE3240528AF298E423258"
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
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, 20 Jun 2011 16:58:49 -0000

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

On 06/20/2011 08:21 AM, Susanto Wijaya wrote:
> May I ask question about mv * command?

Are you talking about a literal:

$ mv *

typed on the command line?  To see what this really did, try:

$ echo mv *

and notice how the shell expands every existing file name in the current
directory before ever calling mv.  Therefore, mv sees the last expanded
argument as the name of the directory to move files into (assuming the
last file named happens to be a directory)...

>=20
>=20
> The question is when I use mv filename command using normal user login,=
 the
> result is all files and directory will lost except might be 1 folder

which explains why doing this in your home directory moves all other
files into the last-named directory, per the 'mv [OPTION]... SOURCE...
DIRECTORY' synopsis form.

>=20
> If I use mv * command using root user in root directory "/", the result=
 is
> all files and directory in / root directory will gone.

Well, yeah, insofar as possible (the operation may abort a bit early
depending on whether you moved something critical to the success of the
continued operation of mv).  But this is not a bug in mv, so much as the
power of Unix to let you shoot yourself in the foot if you type a stupid
command as root.

>=20
> Is all directory and files move to /dev/null ?

No, they are all moved to the last directory specified by your command li=
ne.

>=20
> Now all my files in home directory is lost after run the mv * command

Not lost, but moved.

--=20
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


--------------enig4D1AE3240528AF298E423258
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.11 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJN/3xCAAoJEKeha0olJ0NqM/MH/3wfHTtwgOdQck+dgx3H8Gm0
m6Ved7VM9sTXqsouFWlPmCzLWY2aTQ/TEFnvbF0bcPilG6UZvjEiYMECI1vOUqy/
HlT1s1aaYLwENz8X4iwL2Ii/PJNuFLB3LvRqYMuNg8vry8eUnHjcaTQUZvf6Vh6e
U8WcAUTmBhFt6Rf6OEPiOJt5rxVgfOOZcPqadOo58RUa4PLbmkBhWHxpz/ccUXTf
Sg4kM9JqwBKEF0QFpSq9gMzsRKo/CSuj9P5G/Jhf3Sqh/KkFdQp1sloRGdUxBXZS
tPyVmIeAnzcwMvHeShp1d5IuA9WsW41fAdfhT6aTjjobxKfy3WteqZCFO0CJfk4=
=QJhb
-----END PGP SIGNATURE-----

--------------enig4D1AE3240528AF298E423258--


From MAILER-DAEMON Mon Jun 20 13:21:45 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QYiAT-0004Ib-86
	for mharc-coreutils@gnu.org; Mon, 20 Jun 2011 13:21:45 -0400
Received: from eggs.gnu.org ([140.186.70.92]:41629)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <susanto.huang@gmail.com>) id 1QYiAQ-0004Hy-Pz
	for coreutils@gnu.org; Mon, 20 Jun 2011 13:21:44 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <susanto.huang@gmail.com>) id 1QYiAO-000667-Sj
	for coreutils@gnu.org; Mon, 20 Jun 2011 13:21:42 -0400
Received: from mail-ww0-f49.google.com ([74.125.82.49]:51073)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <susanto.huang@gmail.com>) id 1QYiAO-00065s-Dd
	for coreutils@gnu.org; Mon, 20 Jun 2011 13:21:40 -0400
Received: by wwf22 with SMTP id 22so1677704wwf.30
	for <coreutils@gnu.org>; Mon, 20 Jun 2011 10:21:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:in-reply-to:references:date
	:message-id:subject:from:to:cc:content-type;
	bh=2Sns7eE+e53Od+aA8+F6Jo8SmhE+eHlcqWnvihT048Y=;
	b=C6JZYH7wiIRS3+iYWebGSI5HmweTj186Lf1xVSqMslVqYEZL93teoVWj7Gs3DD+aPs
	+bfHBAhQpmF0jdlIshIEcu+0y+3oxneypvFIK/yfANYyogQqvX73Fab00fUYTXwYUUNL
	yNjVPaE8S98hu4RRmdDAeAQjDNNxC6gNGCPgQ=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	b=hiNHK7pkE4knsNVUZYuxfcECJHSNtHGJuqTu4urfGhVnYegljYh9AYhFk2dLxLZ1D1
	tLVm3icVMszFKkIIe4h/biQKocrOnDeuzWAJCMrr7TLXwNkvy1vr79Qu09Snc5YqIhVU
	S5H/dKbLjuvyATTPHnrIA3IdXznHCKE7wlKV0=
MIME-Version: 1.0
Received: by 10.216.139.209 with SMTP id c59mr5053037wej.88.1308590499379;
	Mon, 20 Jun 2011 10:21:39 -0700 (PDT)
Received: by 10.216.190.168 with HTTP; Mon, 20 Jun 2011 10:21:39 -0700 (PDT)
In-Reply-To: <4DFF7C42.7000007@redhat.com>
References: <BANLkTinNFApdJXs5sUhGecC4L4pGO5u5ag@mail.gmail.com>
	<4DFF7C42.7000007@redhat.com>
Date: Tue, 21 Jun 2011 01:21:39 +0800
Message-ID: <BANLkTik9id6Y9wP645xCmzGxNhaYeifHiQ@mail.gmail.com>
Subject: Re: mv * command
From: Susanto Wijaya <susanto.huang@gmail.com>
To: Eric Blake <eblake@redhat.com>
Content-Type: multipart/alternative; boundary=0016e6d99fc0df3a1604a627f795
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 74.125.82.49
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, 20 Jun 2011 17:21:44 -0000

--0016e6d99fc0df3a1604a627f795
Content-Type: text/plain; charset=ISO-8859-1

Hi Eric,

Thanks a lot for your detail explanation, I really appreciated that since I
know you all is very busy people :-)

I understand now how it's works


Cheers,

Susanto

On Tue, Jun 21, 2011 at 12:58 AM, Eric Blake <eblake@redhat.com> wrote:

> On 06/20/2011 08:21 AM, Susanto Wijaya wrote:
> > May I ask question about mv * command?
>
> Are you talking about a literal:
>
> $ mv *
>
> typed on the command line?  To see what this really did, try:
>
> $ echo mv *
>
> and notice how the shell expands every existing file name in the current
> directory before ever calling mv.  Therefore, mv sees the last expanded
> argument as the name of the directory to move files into (assuming the
> last file named happens to be a directory)...
>
> >
> >
> > The question is when I use mv filename command using normal user login,
> the
> > result is all files and directory will lost except might be 1 folder
>
> which explains why doing this in your home directory moves all other
> files into the last-named directory, per the 'mv [OPTION]... SOURCE...
> DIRECTORY' synopsis form.
>
> >
> > If I use mv * command using root user in root directory "/", the result
> is
> > all files and directory in / root directory will gone.
>
> Well, yeah, insofar as possible (the operation may abort a bit early
> depending on whether you moved something critical to the success of the
> continued operation of mv).  But this is not a bug in mv, so much as the
> power of Unix to let you shoot yourself in the foot if you type a stupid
> command as root.
>
> >
> > Is all directory and files move to /dev/null ?
>
> No, they are all moved to the last directory specified by your command
> line.
>
> >
> > Now all my files in home directory is lost after run the mv * command
>
> Not lost, but moved.
>
> --
> Eric Blake   eblake@redhat.com    +1-801-349-2682
> Libvirt virtualization library http://libvirt.org
>
>

--0016e6d99fc0df3a1604a627f795
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi Eric,<br><br>Thanks a lot for your detail explanation, I really apprecia=
ted that since I know you all is very busy people :-)<br><br>I understand n=
ow how it&#39;s works<br><br><br>Cheers,<br><br>Susanto<br><br><div class=
=3D"gmail_quote">
On Tue, Jun 21, 2011 at 12:58 AM, Eric Blake <span dir=3D"ltr">&lt;<a href=
=3D"mailto:eblake@redhat.com">eblake@redhat.com</a>&gt;</span> wrote:<br><b=
lockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px =
#ccc solid;padding-left:1ex;">
<div class=3D"im">On 06/20/2011 08:21 AM, Susanto Wijaya wrote:<br>
&gt; May I ask question about mv * command?<br>
<br>
</div>Are you talking about a literal:<br>
<br>
$ mv *<br>
<br>
typed on the command line? =A0To see what this really did, try:<br>
<br>
$ echo mv *<br>
<br>
and notice how the shell expands every existing file name in the current<br=
>
directory before ever calling mv. =A0Therefore, mv sees the last expanded<b=
r>
argument as the name of the directory to move files into (assuming the<br>
last file named happens to be a directory)...<br>
<div class=3D"im"><br>
&gt;<br>
&gt;<br>
&gt; The question is when I use mv filename command using normal user login=
, the<br>
&gt; result is all files and directory will lost except might be 1 folder<b=
r>
<br>
</div>which explains why doing this in your home directory moves all other<=
br>
files into the last-named directory, per the &#39;mv [OPTION]... SOURCE...<=
br>
DIRECTORY&#39; synopsis form.<br>
<div class=3D"im"><br>
&gt;<br>
&gt; If I use mv * command using root user in root directory &quot;/&quot;,=
 the result is<br>
&gt; all files and directory in / root directory will gone.<br>
<br>
</div>Well, yeah, insofar as possible (the operation may abort a bit early<=
br>
depending on whether you moved something critical to the success of the<br>
continued operation of mv). =A0But this is not a bug in mv, so much as the<=
br>
power of Unix to let you shoot yourself in the foot if you type a stupid<br=
>
command as root.<br>
<div class=3D"im"><br>
&gt;<br>
&gt; Is all directory and files move to /dev/null ?<br>
<br>
</div>No, they are all moved to the last directory specified by your comman=
d line.<br>
<div class=3D"im"><br>
&gt;<br>
&gt; Now all my files in home directory is lost after run the mv * command<=
br>
<br>
</div>Not lost, but moved.<br>
<font color=3D"#888888"><br>
--<br>
Eric Blake =A0 <a href=3D"mailto:eblake@redhat.com">eblake@redhat.com</a> =
=A0 =A0<a href=3D"tel:%2B1-801-349-2682" value=3D"+18013492682">+1-801-349-=
2682</a><br>
Libvirt virtualization library <a href=3D"http://libvirt.org" target=3D"_bl=
ank">http://libvirt.org</a><br>
<br>
</font></blockquote></div><br><br clear=3D"all"><br><br>

--0016e6d99fc0df3a1604a627f795--


From MAILER-DAEMON Tue Jun 21 04:24:54 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QYwGT-0007My-I1
	for mharc-coreutils@gnu.org; Tue, 21 Jun 2011 04:24:53 -0400
Received: from eggs.gnu.org ([140.186.70.92]:38721)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1QYwGP-0007Lf-EG
	for coreutils@gnu.org; Tue, 21 Jun 2011 04:24:51 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1QYwGO-00028a-98
	for coreutils@gnu.org; Tue, 21 Jun 2011 04:24:49 -0400
Received: from moutng.kundenserver.de ([212.227.17.10]:58055)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1QYwGN-00028R-LV
	for coreutils@gnu.org; Tue, 21 Jun 2011 04:24:48 -0400
Received: from [192.168.2.108] (p57B26E51.dip.t-dialin.net [87.178.110.81])
	by mrelayeu.kundenserver.de (node=mreu1) with ESMTP (Nemesis)
	id 0Lxbix-1Rg3Ud1Xpb-017C5I; Tue, 21 Jun 2011 10:24:45 +0200
Message-ID: <4E00554B.5020306@bernhard-voelker.de>
Date: Tue, 21 Jun 2011 10:24:43 +0200
From: Bernhard Voelker <mail@bernhard-voelker.de>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.17) Gecko/20110414 SUSE/3.1.10 Thunderbird/3.1.10
MIME-Version: 1.0
To: coreutils@gnu.org
Subject: [PATCH] tests: cp/sparse-fiemap: use "seq 99q" in place of "head -99"
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V02:K0:iXhIsK8dyWI5esDZ/gu9wj5dS4Z6a+8tt0NXhLkPZew
	H2a16dJ9ij5es8dbFnU8ZqetohSz927SF1WABL1U5VAneKSZHs
	AhNY2v9t4MNccuGlKNdEoGgSnC9ckqGIr9xtN1HJnO0HXKkmaG
	KzFR67VPdxkfUOHErMWTPgs7C1v+T6e04Nv2s9FKf7DwsYU8Y1
	Ky2cLdUeTqzJ/Hc5bu91eaf5hzaUyPgS0ijtqp6nJM=
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 212.227.17.10
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, 21 Jun 2011 08:24:52 -0000

There was still an obsolete use of "head -[1-9]" in tests.
The following patch replaces it.


 From 8246020de1c8bbf24db2cc98a0df096f2e799452 Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <mail@bernhard-voelker.de>
Date: Tue, 21 Jun 2011 10:10:39 +0200
Subject: [PATCH] tests: cp/sparse-fiemap: use "seq 99q" in place of 
"head -99"

* tests/cp/sparse-fiemap: Use "seq 99q" in place of "head -99".
The latter is officially obsolete but more portable than "head -n99".
---
  tests/cp/sparse-fiemap |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tests/cp/sparse-fiemap b/tests/cp/sparse-fiemap
index 3d34077..229ad78 100755
--- a/tests/cp/sparse-fiemap
+++ b/tests/cp/sparse-fiemap
@@ -106,7 +106,7 @@ for i in $(seq 1 2 21); do
          || {
               warn_ ignoring filefrag-reported extent map differences
               # Show the differing extent maps.
-             head -99 ff1 ff2
+             sed 99q ff1 ff2
             }
      fi
      test $fail = 1 && break 2
-- 
1.7.3.4


Have a nice day,
Berny


From MAILER-DAEMON Tue Jun 21 05:03:10 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QYwrW-0006IZ-0r
	for mharc-coreutils@gnu.org; Tue, 21 Jun 2011 05:03:10 -0400
Received: from eggs.gnu.org ([140.186.70.92]:36680)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QYwrP-0006H9-SW
	for coreutils@gnu.org; Tue, 21 Jun 2011 05:03:08 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QYwrN-0000ij-28
	for coreutils@gnu.org; Tue, 21 Jun 2011 05:03:03 -0400
Received: from mx.meyering.net ([82.230.74.64]:36656)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QYwrM-0000i5-Hs
	for coreutils@gnu.org; Tue, 21 Jun 2011 05:03:00 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 55648600E1; Tue, 21 Jun 2011 11:02:58 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Bernhard Voelker <mail@bernhard-voelker.de>
Subject: Re: [PATCH] tests: cp/sparse-fiemap: use "seq 99q" in place of "head
	-99"
In-Reply-To: <4E00554B.5020306@bernhard-voelker.de> (Bernhard Voelker's
	message of "Tue, 21 Jun 2011 10:24:43 +0200")
References: <4E00554B.5020306@bernhard-voelker.de>
Date: Tue, 21 Jun 2011 11:02:58 +0200
Message-ID: <87zklb1rr1.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: 82.230.74.64
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, 21 Jun 2011 09:03:08 -0000

Bernhard Voelker wrote:
> There was still an obsolete use of "head -[1-9]" in tests.
> The following patch replaces it.

Thanks, but actually no change is required there, since when running the
tests, we're guaranteed to be using coreutils' own version of "head".
By contrast, the just-fixed use in init.sh had no such protection, since
init.sh is used in other projects.

However, if you'd like to adjust your patch to make the test
use head -n99 instead (more readable than sed 99q and more future-proof
than "head -99", in case we stop supporting head -N), I'll apply it.

> From 8246020de1c8bbf24db2cc98a0df096f2e799452 Mon Sep 17 00:00:00 2001
> From: Bernhard Voelker <mail@bernhard-voelker.de>
> Date: Tue, 21 Jun 2011 10:10:39 +0200
> Subject: [PATCH] tests: cp/sparse-fiemap: use "seq 99q" in place of
> "head -99"
>
> * tests/cp/sparse-fiemap: Use "seq 99q" in place of "head -99".
> The latter is officially obsolete but more portable than "head -n99".
> ---
>  tests/cp/sparse-fiemap |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/tests/cp/sparse-fiemap b/tests/cp/sparse-fiemap
> index 3d34077..229ad78 100755
> --- a/tests/cp/sparse-fiemap
> +++ b/tests/cp/sparse-fiemap
> @@ -106,7 +106,7 @@ for i in $(seq 1 2 21); do
>          || {
>               warn_ ignoring filefrag-reported extent map differences
>               # Show the differing extent maps.
> -             head -99 ff1 ff2
> +             sed 99q ff1 ff2
>             }
>      fi
>      test $fail = 1 && break 2


From MAILER-DAEMON Tue Jun 21 05:10:04 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QYwyB-0007k5-G9
	for mharc-coreutils@gnu.org; Tue, 21 Jun 2011 05:10:03 -0400
Received: from eggs.gnu.org ([140.186.70.92]:48975)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1QYwy4-0007is-30
	for coreutils@gnu.org; Tue, 21 Jun 2011 05:10:00 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1QYwy2-0001xP-OE
	for coreutils@gnu.org; Tue, 21 Jun 2011 05:09:55 -0400
Received: from moutng.kundenserver.de ([212.227.17.9]:59382)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <mail@bernhard-voelker.de>) id 1QYwy2-0001x7-Ae
	for coreutils@gnu.org; Tue, 21 Jun 2011 05:09:54 -0400
Received: from [192.168.2.108] (p57B26E51.dip.t-dialin.net [87.178.110.81])
	by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis)
	id 0Lpijq-1REJKB2CIQ-00fV2j; Tue, 21 Jun 2011 11:09:45 +0200
Message-ID: <4E005FD8.90900@bernhard-voelker.de>
Date: Tue, 21 Jun 2011 11:09:44 +0200
From: Bernhard Voelker <mail@bernhard-voelker.de>
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.17) Gecko/20110414 SUSE/3.1.10 Thunderbird/3.1.10
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
Subject: Re: [PATCH] tests: cp/sparse-fiemap: use "seq 99q" in place of "head
	-99"
References: <4E00554B.5020306@bernhard-voelker.de>
	<87zklb1rr1.fsf@rho.meyering.net>
In-Reply-To: <87zklb1rr1.fsf@rho.meyering.net>
Content-Type: multipart/mixed; boundary="------------030900090400000201000502"
X-Provags-ID: V02:K0:yFzP9eTiMPwFytcOzc+A73HyjMD/B6L6gWY9NAZmt16
	/RB3fOUx3THw7XbPDpnqLQIf+NxBDuONgZrAScc02K7XnqvzVf
	+V9v8i6DxUmzBZSbl2QYnjrHj3wUWf5fmFdmLy5KzPt1AZ9RyX
	6iEX128cNhhBVOHh1a3zpdqBpAlcBJUsz+qtcMi2qr1suDskKQ
	l/D7Gf+ighahgtETcrxDfWSrpYdAyFgk9Dm71Yj0/M=
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-Received-From: 212.227.17.9
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, 21 Jun 2011 09:10:01 -0000

This is a multi-part message in MIME format.
--------------030900090400000201000502
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

On 06/21/2011 11:02 AM, Jim Meyering wrote:
> Bernhard Voelker wrote:
>> There was still an obsolete use of "head -[1-9]" in tests.
>> The following patch replaces it.
>
> Thanks, but actually no change is required there, since when running the
> tests, we're guaranteed to be using coreutils' own version of "head".
> By contrast, the just-fixed use in init.sh had no such protection, since
> init.sh is used in other projects.
>
> However, if you'd like to adjust your patch to make the test
> use head -n99 instead (more readable than sed 99q and more future-proof
> than "head -99", in case we stop supporting head -N), I'll apply it.
>

Thanks. The new patch is attached.

Have a nice day,
Berny

--------------030900090400000201000502
Content-Type: text/x-patch;
 name="head-n.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="head-n.diff"

>From 7f7abf823fe8341a13b016532e1e4819c6cf1b93 Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <mail@bernhard-voelker.de>
Date: Tue, 21 Jun 2011 10:10:39 +0200
Subject: [PATCH] tests: cp/sparse-fiemap: use "head -n99" in place of "head -99"

* tests/cp/sparse-fiemap: Use "head -n99" in place of "head -99".
The latter is officially obsolete.
---
 tests/cp/sparse-fiemap |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tests/cp/sparse-fiemap b/tests/cp/sparse-fiemap
index 3d34077..37d8ea7 100755
--- a/tests/cp/sparse-fiemap
+++ b/tests/cp/sparse-fiemap
@@ -106,7 +106,7 @@ for i in $(seq 1 2 21); do
         || {
              warn_ ignoring filefrag-reported extent map differences
              # Show the differing extent maps.
-             head -99 ff1 ff2
+             head -n99 ff1 ff2
            }
     fi
     test $fail = 1 && break 2
-- 
1.7.3.4


--------------030900090400000201000502--


From MAILER-DAEMON Tue Jun 21 08:38:43 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QZ0E7-0003s2-CK
	for mharc-coreutils@gnu.org; Tue, 21 Jun 2011 08:38:43 -0400
Received: from eggs.gnu.org ([140.186.70.92]:50057)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QZ0E3-0003rI-Gn
	for coreutils@gnu.org; Tue, 21 Jun 2011 08:38:40 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QZ0E1-0008RC-OH
	for coreutils@gnu.org; Tue, 21 Jun 2011 08:38:38 -0400
Received: from mx.meyering.net ([82.230.74.64]:36678)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QZ0E1-0008Qw-6G
	for coreutils@gnu.org; Tue, 21 Jun 2011 08:38:37 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 68E2B600E0; Tue, 21 Jun 2011 14:38:36 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Bernhard Voelker <mail@bernhard-voelker.de>
Subject: Re: [PATCH] tests: cp/sparse-fiemap: use "seq 99q" in place of "head
	-99"
In-Reply-To: <4E005FD8.90900@bernhard-voelker.de> (Bernhard Voelker's message
	of "Tue, 21 Jun 2011 11:09:44 +0200")
References: <4E00554B.5020306@bernhard-voelker.de>
	<87zklb1rr1.fsf@rho.meyering.net> <4E005FD8.90900@bernhard-voelker.de>
Date: Tue, 21 Jun 2011 14:38:36 +0200
Message-ID: <87fwn3z7eb.fsf@rho.meyering.net>
Lines: 23
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: 82.230.74.64
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, 21 Jun 2011 12:38:40 -0000

Bernhard Voelker wrote:
> Thanks. The new patch is attached.
...
> Subject: [PATCH] tests: cp/sparse-fiemap: use "head -n99" in place of "head -99"
>
> * tests/cp/sparse-fiemap: Use "head -n99" in place of "head -99".
> The latter is officially obsolete.
> ---
>  tests/cp/sparse-fiemap |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/tests/cp/sparse-fiemap b/tests/cp/sparse-fiemap
> index 3d34077..37d8ea7 100755
> --- a/tests/cp/sparse-fiemap
> +++ b/tests/cp/sparse-fiemap
> @@ -106,7 +106,7 @@ for i in $(seq 1 2 21); do
>          || {
>               warn_ ignoring filefrag-reported extent map differences
>               # Show the differing extent maps.
> -             head -99 ff1 ff2
> +             head -n99 ff1 ff2

Thanks.  Pushed.


From MAILER-DAEMON Tue Jun 21 08:51:33 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QZ0QW-0005vr-VF
	for mharc-coreutils@gnu.org; Tue, 21 Jun 2011 08:51:33 -0400
Received: from eggs.gnu.org ([140.186.70.92]:50311)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QZ0QU-0005v8-7I
	for coreutils@gnu.org; Tue, 21 Jun 2011 08:51:31 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QZ0QS-0002We-Lq
	for coreutils@gnu.org; Tue, 21 Jun 2011 08:51:29 -0400
Received: from mx1.redhat.com ([209.132.183.28]:49335)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>)
	id 1QZ0QO-0002P3-7k; Tue, 21 Jun 2011 08:51:24 -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 p5LCpKv0020403
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 21 Jun 2011 08:51:20 -0400
Received: from [10.3.113.98] (ovpn-113-98.phx2.redhat.com [10.3.113.98])
	by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id p5LCpJrC000877; Tue, 21 Jun 2011 08:51:19 -0400
Message-ID: <4E0093C7.90802@redhat.com>
Date: Tue, 21 Jun 2011 06:51:19 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14
	Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10
MIME-Version: 1.0
To: Jim Meyering <jim@meyering.net>
Subject: Re: PATH_MAX constant expression
References: <201106182222.52871.bruno@clisp.org>
	<4DFFBD2E.3040406@redhat.com>	<201106210034.52875.bruno@clisp.org>
	<4DFFD11A.4090508@redhat.com> <874o3j4wil.fsf@rho.meyering.net>
In-Reply-To: <874o3j4wil.fsf@rho.meyering.net>
X-Enigmail-Version: 1.1.2
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="------------enig797DE09D1E33F82B88BC860E"
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: bug-gnulib@gnu.org, Bruno Haible <bruno@clisp.org>,
	Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 21 Jun 2011 12:51:31 -0000

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

[adding coreutils]

On 06/20/2011 10:51 PM, Jim Meyering wrote:
>>> 2011-06-20  Bruno Haible  <bruno@clisp.org>
>>>
>>> 	pathmax: Never define PATH_MAX to a non-constant expression.
>>> 	* lib/pathmax.h (PATH_MAX): Don't define in terms of pathconf.
>>> 	* m4/pathmax.m4 (gl_PATHMAX): Don't test for pathconf.
>>
>> Looks okay to me, but let's wait to see if anyone else also has an
>> opinion.  Let's also enhance doc/posix-headers/limits.texi to mention
>> the pathmax module and its (new) semantics of not interfering with Hur=
d.
>=20
> coreutils has few remaining uses of PATH_MAX, but they do expect
> pathmax.h to define it unconditionally, and from what I recall,
> it has always worked that way.  Thus, changing it *not* to define
> PATH_MAX on the Hurd would cause trouble.

As is, coreutils' src/pathchk.c appears safe (it checks whether a value
is less than PATH_MAX), although see below.

sys/remove.c uses PATH_MAX safely, as a hint for an initial start size
via MIN (PATH_MAX, 8192).

src/pwd.c appears to have a bug: it tries to use PATH_MAX as a hint, via
MIN (2 * PATH_MAX, 32 * 1024), but if PATH_MAX is INT_MAX, then this
overflows, with awkward consequences.  Thankfully, PATH_MAX is never
INT_MAX in any known use of pathmax.h, but we ought to avoid even the
potential for that problem.

But none of these points use char foo[PATH_MAX]; so it does seem simple
enough to add a syntax check to ensure that PATH_MAX is never used as an
array bound.

>=20
> In any case, it looks like your patch is ok, since the combination
> of these two blocks ensures that PATH_MAX *is* always defined:
>=20
>   # ifndef _POSIX_PATH_MAX
>   #  define _POSIX_PATH_MAX 256
>   # endif
>=20
>   # ifndef PATH_MAX
>   #  define PATH_MAX _POSIX_PATH_MAX
>   # endif

On Hurd, if we are going to insist on a constant PATH_MAX definition for
use as a hint, then we probably ought to end up with a PATH_MAX value
more like 1024 or 4096 rather than a paltry 256, so that coreutils'
pathchk.c doesn't reject a 257-byte path as being smaller than PATH_MAX
(this would be a regression for pathchk without options).

--=20
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


--------------enig797DE09D1E33F82B88BC860E
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.11 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJOAJPHAAoJEKeha0olJ0NqkUsH/ijJy96cNZZr4VB99m4pVhaq
4lTKxV0FHtpWHPbrbHL6dyOg9Fln6cnI+EO/EP90o2g7A/1YXuursco+3/CO7ESE
TTC3oUYcIDaEawCHebtTLelfbqPkBP+1C5UGBWNM+jxuZ9QzcRp8kZCP2sKgf+o3
SScL5dFt57gzXx5vZI1gWd1cWpPgXm8WyBSBkTvIgaUDdEN0GSX1KG8y1onLTltD
nc0EsMiftYzR+dzPoQ73f/XORk+GM8ms7Z3DwiUCmEHm+Aq2td6eXggNRbE7JX2Q
Tn0WTzxYMtYfIe6F5kMrzR/ZUGnSotT40jIH2CqYUpbKtZQH7HHmindNRijrCx0=
=//9A
-----END PGP SIGNATURE-----

--------------enig797DE09D1E33F82B88BC860E--


From MAILER-DAEMON Tue Jun 21 08:57:52 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QZ0Wd-0007Hu-Rx
	for mharc-coreutils@gnu.org; Tue, 21 Jun 2011 08:57:51 -0400
Received: from eggs.gnu.org ([140.186.70.92]:40269)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QZ0Wb-0007HM-Bj
	for coreutils@gnu.org; Tue, 21 Jun 2011 08:57:50 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QZ0WZ-0003nC-Od
	for coreutils@gnu.org; Tue, 21 Jun 2011 08:57:49 -0400
Received: from mx.meyering.net ([82.230.74.64]:37055)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>)
	id 1QZ0WV-0003jf-9o; Tue, 21 Jun 2011 08:57:43 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 2A351600E1; Tue, 21 Jun 2011 14:57:42 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Eric Blake <eblake@redhat.com>
Subject: Re: PATH_MAX constant expression
In-Reply-To: <4E0093C7.90802@redhat.com> (Eric Blake's message of "Tue, 21 Jun
	2011 06:51:19 -0600")
References: <201106182222.52871.bruno@clisp.org> <4DFFBD2E.3040406@redhat.com>
	<201106210034.52875.bruno@clisp.org> <4DFFD11A.4090508@redhat.com>
	<874o3j4wil.fsf@rho.meyering.net> <4E0093C7.90802@redhat.com>
Date: Tue, 21 Jun 2011 14:57:42 +0200
Message-ID: <87aadbz6ih.fsf@rho.meyering.net>
Lines: 43
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: 82.230.74.64
Cc: bug-gnulib@gnu.org, Bruno Haible <bruno@clisp.org>,
	Coreutils <coreutils@gnu.org>
X-BeenThere: coreutils@gnu.org
X-Mailman-Version: 2.1.14
Precedence: list
List-Id: GNU coreutils General Discussion <coreutils.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/archive/html/coreutils>
List-Post: <mailto:coreutils@gnu.org>
List-Help: <mailto:coreutils-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/coreutils>,
	<mailto:coreutils-request@gnu.org?subject=subscribe>
X-List-Received-Date: Tue, 21 Jun 2011 12:57:50 -0000

Eric Blake wrote:

> [adding coreutils]
>
> On 06/20/2011 10:51 PM, Jim Meyering wrote:
>>>> 2011-06-20  Bruno Haible  <bruno@clisp.org>
>>>>
>>>> 	pathmax: Never define PATH_MAX to a non-constant expression.
>>>> 	* lib/pathmax.h (PATH_MAX): Don't define in terms of pathconf.
>>>> 	* m4/pathmax.m4 (gl_PATHMAX): Don't test for pathconf.
>>>
>>> Looks okay to me, but let's wait to see if anyone else also has an
>>> opinion.  Let's also enhance doc/posix-headers/limits.texi to mention
>>> the pathmax module and its (new) semantics of not interfering with Hurd.
>>
>> coreutils has few remaining uses of PATH_MAX, but they do expect
>> pathmax.h to define it unconditionally, and from what I recall,
>> it has always worked that way.  Thus, changing it *not* to define
>> PATH_MAX on the Hurd would cause trouble.
>
> As is, coreutils' src/pathchk.c appears safe (it checks whether a value
> is less than PATH_MAX), although see below.
>
> sys/remove.c uses PATH_MAX safely, as a hint for an initial start size
> via MIN (PATH_MAX, 8192).
>
> src/pwd.c appears to have a bug: it tries to use PATH_MAX as a hint, via
> MIN (2 * PATH_MAX, 32 * 1024), but if PATH_MAX is INT_MAX, then this
> overflows, with awkward consequences.  Thankfully, PATH_MAX is never
> INT_MAX in any known use of pathmax.h, but we ought to avoid even the
> potential for that problem.
>
> But none of these points use char foo[PATH_MAX]; so it does seem simple
> enough to add a syntax check to ensure that PATH_MAX is never used as an
> array bound.

Bruno's comment (in the text you elided) suggests intent to have
pathmax.h leave PATH_MAX undefined on the Hurd:

  >> I find it reasonable to use "#ifdef PATH_MAX" in front of every use of
  >> PATH_MAX, like POSIX requires.

With such a change, each of the above uses would evoke a syntax error.


From MAILER-DAEMON Thu Jun 23 20:44:47 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QZuVr-00079x-Dt
	for mharc-coreutils@gnu.org; Thu, 23 Jun 2011 20:44:47 -0400
Received: from eggs.gnu.org ([140.186.70.92]:46874)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bruno@clisp.org>) id 1QZuVo-00079Y-Vj
	for coreutils@gnu.org; Thu, 23 Jun 2011 20:44:45 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bruno@clisp.org>) id 1QZuVo-00084b-1g
	for coreutils@gnu.org; Thu, 23 Jun 2011 20:44:44 -0400
Received: from mo-p00-ob.rzone.de ([81.169.146.160]:12245)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bruno@clisp.org>)
	id 1QZuVl-000848-Ch; Thu, 23 Jun 2011 20:44:41 -0400
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; t=1308876278; l=1110;
	s=domk; d=haible.de;
	h=Content-Transfer-Encoding:Content-Type:MIME-Version:In-Reply-To:
	References:Cc:Date:Subject:To:From:X-RZG-CLASS-ID:X-RZG-AUTH;
	bh=NMMq2jQa5gUbrLHrdXvksenr1jo=;
	b=Q+Up2u9crRY86M/3Rej4x2oxFLTztE9/F6af9F68PBBa5oVP/Z9FhGxCcWRivDjKTqx
	xZtgqIEMO6rA6JdNu7sNuN561LGhWY8pEkhHDKGdcYgNfe0vIFlfeezc6EMVbA+zFaP4n
	sXtJGwR8WmUDb/089MRKHJfeARjKj/Vh0CQ=
X-RZG-AUTH: :Ln4Re0+Ic/6oZXR1YgKryK8brksyK8dozXDwHXjf9hj/zDNRbP444xzQwQ==
X-RZG-CLASS-ID: mo00
Received: from linuix.haible.de
	(dslb-088-068-058-108.pools.arcor-ip.net [88.68.58.108])
	by post.strato.de (klopstock mo8) (RZmta 25.18)
	with ESMTPA id f00a05n5NMSddy ; Fri, 24 Jun 2011 02:44:37 +0200 (MEST)
From: Bruno Haible <bruno@clisp.org>
To: Jim Meyering <jim@meyering.net>
Subject: Re: PATH_MAX constant expression
Date: Fri, 24 Jun 2011 02:44:35 +0200
User-Agent: KMail/1.9.9
References: <201106182222.52871.bruno@clisp.org> <4E0093C7.90802@redhat.com>
	<87aadbz6ih.fsf@rho.meyering.net>
In-Reply-To: <87aadbz6ih.fsf@rho.meyering.net>
MIME-Version: 1.0
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
Message-Id: <201106240244.37016.bruno@clisp.org>
X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta)
X-Received-From: 81.169.146.160
Cc: bug-gnulib@gnu.org, 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: Fri, 24 Jun 2011 00:44:46 -0000

Hi Jim,

> Bruno's comment (in the text you elided) suggests intent to have
> pathmax.h leave PATH_MAX undefined on the Hurd:
> 
>   >> I find it reasonable to use "#ifdef PATH_MAX" in front of every use of
>   >> PATH_MAX, like POSIX requires.
> 
> With such a change, each of the above uses would evoke a syntax error.

A package like coreutils can also do
  #ifndef PATH_MAX
  # define PATH_MAX 8192
  #endif
in its system.h.

Looking at both uses of PATH_MAX in coreutils (src/pwd.c:88 and
src/remove.c:186) the value of PATH_MAX is capped by 8192 or 16384 anyway.
So, on systems like GNU/Hurd, where filenames can have arbitrary size, you
are calling pathconf for no real purpose.

To me, this confirms that a generic pathmax.h (like the one in gnulib)
should only define PATH_MAX when it makes sense - like POSIX says -,
and that the handling of the GNU/Hurd case should be done on a case-by-case
basis:
  - Either a package-wide handling, or a per-file handling.
  - Either a fallback value of 8192, or a fallback value of
    pathconf ("/", _PC_PATH_MAX), or just a #ifdef test.

Bruno


From MAILER-DAEMON Fri Jun 24 03:36:04 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qa0vs-0008EY-16
	for mharc-coreutils@gnu.org; Fri, 24 Jun 2011 03:36:04 -0400
Received: from eggs.gnu.org ([140.186.70.92]:34083)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Qa0vo-0008Dz-Ck
	for coreutils@gnu.org; Fri, 24 Jun 2011 03:36:01 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Qa0vn-0003G5-JN
	for coreutils@gnu.org; Fri, 24 Jun 2011 03:36:00 -0400
Received: from mx.meyering.net ([82.230.74.64]:43618)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>)
	id 1Qa0vl-0003Fj-8u; Fri, 24 Jun 2011 03:35:57 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 79046601AE; Fri, 24 Jun 2011 09:35:56 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Bruno Haible <bruno@clisp.org>
Subject: Re: PATH_MAX constant expression
In-Reply-To: <201106240244.37016.bruno@clisp.org> (Bruno Haible's message of
	"Fri, 24 Jun 2011 02:44:35 +0200")
References: <201106182222.52871.bruno@clisp.org> <4E0093C7.90802@redhat.com>
	<87aadbz6ih.fsf@rho.meyering.net> <201106240244.37016.bruno@clisp.org>
Date: Fri, 24 Jun 2011 09:35:56 +0200
Message-ID: <87tybfisv7.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: 82.230.74.64
Cc: bug-gnulib@gnu.org, 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: Fri, 24 Jun 2011 07:36:01 -0000

Bruno Haible wrote:
>> Bruno's comment (in the text you elided) suggests intent to have
>> pathmax.h leave PATH_MAX undefined on the Hurd:
>>
>>   >> I find it reasonable to use "#ifdef PATH_MAX" in front of every use of
>>   >> PATH_MAX, like POSIX requires.
>>
>> With such a change, each of the above uses would evoke a syntax error.
>
> A package like coreutils can also do
>   #ifndef PATH_MAX
>   # define PATH_MAX 8192
>   #endif
> in its system.h.

Of course.  It should stop including pathmax.h and do that regardless.

And I don't mind adapting.  In fact, I've just made the change.
Just wanted to make sure you realize that what you propose
would change long-standing policy.

> Looking at both uses of PATH_MAX in coreutils (src/pwd.c:88 and
> src/remove.c:186) the value of PATH_MAX is capped by 8192 or 16384 anyway.
> So, on systems like GNU/Hurd, where filenames can have arbitrary size, you
> are calling pathconf for no real purpose.
>
> To me, this confirms that a generic pathmax.h (like the one in gnulib)
> should only define PATH_MAX when it makes sense - like POSIX says -,
> and that the handling of the GNU/Hurd case should be done on a case-by-case
> basis:
>   - Either a package-wide handling, or a per-file handling.
>   - Either a fallback value of 8192, or a fallback value of
>     pathconf ("/", _PC_PATH_MAX), or just a #ifdef test.


From MAILER-DAEMON Fri Jun 24 03:36:41 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qa0wS-0008Jj-LP
	for mharc-coreutils@gnu.org; Fri, 24 Jun 2011 03:36:40 -0400
Received: from eggs.gnu.org ([140.186.70.92]:40683)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Qa0wO-0008JV-Uh
	for coreutils@gnu.org; Fri, 24 Jun 2011 03:36:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Qa0wN-0003ZK-Qg
	for coreutils@gnu.org; Fri, 24 Jun 2011 03:36:36 -0400
Received: from mx.meyering.net ([82.230.74.64]:43619)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Qa0wN-0003ZG-L6
	for coreutils@gnu.org; Fri, 24 Jun 2011 03:36:35 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 189846012D; Fri, 24 Jun 2011 09:36:35 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH] maint: don't use gnulib's pathmax module;
	define PATH_MAX if needed
Date: Fri, 24 Jun 2011 09:36:34 +0200
Message-ID: <87oc1nisu5.fsf@rho.meyering.net>
Lines: 52
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: 82.230.74.64
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, 24 Jun 2011 07:36:38 -0000

Prompted by recent discussion on bug-gnulib,

>From 0bcfe87631993b3bd60bbc37ba26f2e267ebb8c6 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Fri, 24 Jun 2011 09:12:59 +0200
Subject: [PATCH] maint: don't use gnulib's pathmax module; define PATH_MAX if
 needed

* bootstrap.conf (gnulib_modules): Remove pathmax.
* src/system.h: Don't include "pathmax.h".
(PATH_MAX) [!PATH_MAX]: Define to 8192.  Defining it to a constant
is preferable to using a definition from pathmax.h that might expand
to pathconf ("/", _PC_PATH_MAX). Prompted by discussion leading to:
http://thread.gmane.org/gmane.comp.lib.gnulib.bugs/27183/focus=27269
---
 bootstrap.conf |    1 -
 src/system.h   |    7 +++----
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/bootstrap.conf b/bootstrap.conf
index c998384..08bfc21 100644
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -158,7 +158,6 @@ gnulib_modules="
   nproc
   obstack
   parse-datetime
-  pathmax
   perl
   physmem
   posix-shell
diff --git a/src/system.h b/src/system.h
index 95ef2c3..d250d94 100644
--- a/src/system.h
+++ b/src/system.h
@@ -40,11 +40,10 @@ you must include <sys/types.h> before including this file

 #include <unistd.h>

-/* limits.h must come before pathmax.h because limits.h on some systems
-   undefs PATH_MAX, whereas pathmax.h sets PATH_MAX.  */
 #include <limits.h>
-
-#include "pathmax.h"
+#ifndef PATH_MAX
+# define PATH_MAX 8192
+#endif

 #include "configmake.h"

--
1.7.6.rc2.302.gc2115


From MAILER-DAEMON Fri Jun 24 06:37:49 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qa3lk-000103-Tu
	for mharc-coreutils@gnu.org; Fri, 24 Jun 2011 06:37:48 -0400
Received: from eggs.gnu.org ([140.186.70.92]:54330)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1Qa3lg-0000z2-Qx
	for coreutils@gnu.org; Fri, 24 Jun 2011 06:37:46 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1Qa3lf-0004im-EP
	for coreutils@gnu.org; Fri, 24 Jun 2011 06:37:44 -0400
Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]:8194)
	by eggs.gnu.org with smtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1Qa3lf-0004iV-0f
	for coreutils@gnu.org; Fri, 24 Jun 2011 06:37:43 -0400
Received: (qmail 95665 invoked from network); 24 Jun 2011 10:37:39 -0000
Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218)
	by mail1.slb.deg.dub.stisp.net with SMTP; 24 Jun 2011 10:37:39 -0000
Message-ID: <4E0468E6.2080808@draigBrady.com>
Date: Fri, 24 Jun 2011 11:37:26 +0100
From: =?UTF-8?B?UMOhZHJhaWcgQnJhZHk=?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US;
	rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3
MIME-Version: 1.0
To: Coreutils <coreutils@gnu.org>
Subject: [PATCH] stat: recognize MQUEUE file systems
X-Enigmail-Version: 1.0.1
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9
X-Received-From: 84.203.253.98
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, 24 Jun 2011 10:37:46 -0000

I noticed the mqueue file system on my Fedora 15 install,
which is used to interact with POSIX message queues.

cheers,
PÃ¡draig.

diff --git a/src/stat.c b/src/stat.c
index c479726..54c4e97 100644
--- a/src/stat.c
+++ b/src/stat.c
@@ -323,6 +323,8 @@ human_fstype (STRUCT_STATVFS const *statfsbuf)
       return "minix v2 (30 char.)";
     case S_MAGIC_MINIX_V3: /* 0x4D5A */
       return "minix3";
+    case S_MAGIC_MQUEUE: /* 0x19800202 */
+      return "mqueue";
     case S_MAGIC_MSDOS: /* 0x4D44 */
       return "msdos";
     case S_MAGIC_NCP: /* 0x564C */


From MAILER-DAEMON Fri Jun 24 08:06:17 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qa59M-00007h-HS
	for mharc-coreutils@gnu.org; Fri, 24 Jun 2011 08:06:16 -0400
Received: from eggs.gnu.org ([140.186.70.92]:46109)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Qa59H-00005x-7J
	for coreutils@gnu.org; Fri, 24 Jun 2011 08:06:12 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Qa59D-0000eP-Nf
	for coreutils@gnu.org; Fri, 24 Jun 2011 08:06:10 -0400
Received: from mx.meyering.net ([82.230.74.64]:44728)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Qa59D-0000e9-6c
	for coreutils@gnu.org; Fri, 24 Jun 2011 08:06:07 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 5D5D6600A9; Fri, 24 Jun 2011 14:06:05 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: =?iso-8859-1?Q?P=E1draig?= Brady <P@draigBrady.com>
Subject: Re: [PATCH] stat: recognize MQUEUE file systems
In-Reply-To: <4E0468E6.2080808@draigBrady.com> (=?iso-8859-1?Q?=22P=E1drai?=
	=?iso-8859-1?Q?g?= Brady"'s message of
	"Fri, 24 Jun 2011 11:37:26 +0100")
References: <4E0468E6.2080808@draigBrady.com>
Date: Fri, 24 Jun 2011 14:06:05 +0200
Message-ID: <87zkl7h1si.fsf@rho.meyering.net>
Lines: 27
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: 82.230.74.64
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: Fri, 24 Jun 2011 12:06:13 -0000

P=E1draig Brady wrote:
> I noticed the mqueue file system on my Fedora 15 install,
> which is used to interact with POSIX message queues.
>
> cheers,
> P=E1draig.
>
> diff --git a/src/stat.c b/src/stat.c
> index c479726..54c4e97 100644
> --- a/src/stat.c
> +++ b/src/stat.c
> @@ -323,6 +323,8 @@ human_fstype (STRUCT_STATVFS const *statfsbuf)
>        return "minix v2 (30 char.)";
>      case S_MAGIC_MINIX_V3: /* 0x4D5A */
>        return "minix3";
> +    case S_MAGIC_MQUEUE: /* 0x19800202 */
> +      return "mqueue";
>      case S_MAGIC_MSDOS: /* 0x4D44 */
>        return "msdos";
>      case S_MAGIC_NCP: /* 0x564C */

Thanks.
While you're adding that, you might also want to add an entry for this:

# define S_MAGIC_PSTOREFS 0x6165676C

It was reported by running "make -C src fs-magic-compare" on rawhide.


From MAILER-DAEMON Sat Jun 25 01:14:31 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QaLCR-0007EQ-DB
	for mharc-coreutils@gnu.org; Sat, 25 Jun 2011 01:14:31 -0400
Received: from eggs.gnu.org ([140.186.70.92]:38660)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1QaLCP-0007EI-1b
	for coreutils@gnu.org; Sat, 25 Jun 2011 01:14:30 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1QaLCO-0001N2-4N
	for coreutils@gnu.org; Sat, 25 Jun 2011 01:14:29 -0400
Received: from mail-gx0-f169.google.com ([209.85.161.169]:57385)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1QaLCN-0001Mh-UG
	for coreutils@gnu.org; Sat, 25 Jun 2011 01:14:28 -0400
Received: by gxk23 with SMTP id 23so1836040gxk.0
	for <coreutils@gnu.org>; Fri, 24 Jun 2011 22:14:26 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:date:message-id:subject:from:to
	:content-type; bh=jwp4HRPKheqX1cV/IkqpMrFtyEnCtoI4Cw3ZkviTHzY=;
	b=AkkMX9IKKj42TxGYHQfBoW2VvC5+7CLCcMrHNlPNo5hugCDS6fM7rflsJGBkQ0dmVN
	+Nbqb5xDhEBJnglVB12AGrByOke5HgANl5bbLGiQaG15dqMoU9lkGX+Yl2WKih2TwEjo
	+gsLG0pMpl0iDeCLOX9i8WfplLA6wadPBL7FY=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	b=hc2XqKB1/eiCQxW7ecdiEgdtEZBrqcZyBciKsDkSxhhAx5u/45nejnpguVYcJ366rJ
	nOrunqlEi2i0WlaByksUc3elZEeZsKsdttMpcd6uqaRajoUXEnOr4Ivw3LKjuZi9IWj8
	7qMko3yrL5Zl3f3ZQbAH5MDlLJEBfOmhtoCQs=
MIME-Version: 1.0
Received: by 10.236.139.199 with SMTP id c47mr473524yhj.246.1308978866629;
	Fri, 24 Jun 2011 22:14:26 -0700 (PDT)
Received: by 10.236.202.131 with HTTP; Fri, 24 Jun 2011 22:14:26 -0700 (PDT)
Date: Sat, 25 Jun 2011 00:14:26 -0500
Message-ID: <BANLkTik_sgJm2iaRedT_kXtLQhCyTL8Evw@mail.gmail.com>
Subject: Faster ls when there are thousands of files in a directory
From: Peng Yu <pengyu.ut@gmail.com>
To: coreutils@gnu.org
Content-Type: text/plain; charset=ISO-8859-1
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.161.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: Sat, 25 Jun 2011 05:14:30 -0000

Hi,

When there are a few thousands of files/directories in a directory
that I want to ls, I experience long wait time (a few seconds on mac).
I'm wondering if some kind of cache can be built for ls to speed it
up? Note my ls is installed from macport (not the native mac ls).

-- 
Regards,
Peng


From MAILER-DAEMON Sat Jun 25 01:54:59 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QaLpa-00029C-Se
	for mharc-coreutils@gnu.org; Sat, 25 Jun 2011 01:54:58 -0400
Received: from eggs.gnu.org ([140.186.70.92]:42425)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QaLpX-00028d-0s
	for coreutils@gnu.org; Sat, 25 Jun 2011 01:54:56 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QaLpV-0001dM-6w
	for coreutils@gnu.org; Sat, 25 Jun 2011 01:54:54 -0400
Received: from mx.meyering.net ([82.230.74.64]:45560)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QaLpU-0001d5-BC
	for coreutils@gnu.org; Sat, 25 Jun 2011 01:54:52 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 4A2EF60154; Sat, 25 Jun 2011 07:54:51 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Peng Yu <pengyu.ut@gmail.com>
Subject: Re: Faster ls when there are thousands of files in a directory
In-Reply-To: <BANLkTik_sgJm2iaRedT_kXtLQhCyTL8Evw@mail.gmail.com> (Peng Yu's
	message of "Sat, 25 Jun 2011 00:14:26 -0500")
References: <BANLkTik_sgJm2iaRedT_kXtLQhCyTL8Evw@mail.gmail.com>
Date: Sat, 25 Jun 2011 07:54:51 +0200
Message-ID: <87r56ie9qs.fsf@rho.meyering.net>
Lines: 13
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: 82.230.74.64
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: Sat, 25 Jun 2011 05:54:56 -0000

Peng Yu wrote:
> When there are a few thousands of files/directories in a directory
> that I want to ls, I experience long wait time (a few seconds on mac).
> I'm wondering if some kind of cache can be built for ls to speed it
> up? Note my ls is installed from macport (not the native mac ls).

Use "ls -1U" (efficient with coreutils-7.0 or newer) or find.

Someday GNU ls will use fts, and then it will benefit from
the inode-sorting fts does for some FS types when there are
very many files.  Then it will be faster with additional
combinations of options.  But even then, it won't beat "ls -1U",
which doesn't call stat at all for FS with useful dirent.d_type.


From MAILER-DAEMON Sat Jun 25 02:01:45 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QaLw9-0002tf-9R
	for mharc-coreutils@gnu.org; Sat, 25 Jun 2011 02:01:45 -0400
Received: from eggs.gnu.org ([140.186.70.92]:34859)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QaLw7-0002tZ-0T
	for coreutils@gnu.org; Sat, 25 Jun 2011 02:01:44 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QaLw5-0003NG-U9
	for coreutils@gnu.org; Sat, 25 Jun 2011 02:01:42 -0400
Received: from mx.meyering.net ([82.230.74.64]:36213)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QaLw5-0003N7-OM
	for coreutils@gnu.org; Sat, 25 Jun 2011 02:01:41 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 0268760154; Sat, 25 Jun 2011 08:01:40 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Peng Yu <pengyu.ut@gmail.com>
Subject: Re: Faster ls when there are thousands of files in a directory
In-Reply-To: <87r56ie9qs.fsf@rho.meyering.net> (Jim Meyering's message of
	"Sat, 25 Jun 2011 07:54:51 +0200")
References: <BANLkTik_sgJm2iaRedT_kXtLQhCyTL8Evw@mail.gmail.com>
	<87r56ie9qs.fsf@rho.meyering.net>
Date: Sat, 25 Jun 2011 08:01:40 +0200
Message-ID: <87liwqe9ff.fsf@rho.meyering.net>
Lines: 61
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: 82.230.74.64
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: Sat, 25 Jun 2011 06:01:44 -0000

Jim Meyering wrote:
> Peng Yu wrote:
>> When there are a few thousands of files/directories in a directory
>> that I want to ls, I experience long wait time (a few seconds on mac).
>> I'm wondering if some kind of cache can be built for ls to speed it
>> up? Note my ls is installed from macport (not the native mac ls).
>
> Use "ls -1U" (efficient with coreutils-7.0 or newer) or find.
>
> Someday GNU ls will use fts, and then it will benefit from
> the inode-sorting fts does for some FS types when there are
> very many files.  Then it will be faster with additional
> combinations of options.  But even then, it won't beat "ls -1U",
> which doesn't call stat at all for FS with useful dirent.d_type.

I went to NEWS to quote that entry and did not find it right away
because there was no use of ls -1 or ls -U there.

I adjusted it like this:

>From 18839ad9c17c3f8fe42210e17c707bfc12fd4b1b Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Sat, 25 Jun 2011 07:57:59 +0200
Subject: [PATCH] doc: clarify an improvement from coreutils-7.0

* NEWS (7.0 Improvements): Mention the command: "ls -1U".
* cfg.mk (old_NEWS_hash): Update.
---
 NEWS   |    3 ++-
 cfg.mk |    2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/NEWS b/NEWS
index 619fbdd..d58df26 100644
--- a/NEWS
+++ b/NEWS
@@ -1082,7 +1082,8 @@ GNU coreutils NEWS                                    -*- outline -*-
   join has significantly better performance due to better memory management

   ls now uses constant memory when not sorting and using one_per_line format,
-  no matter how many files are in a given directory
+  no matter how many files are in a given directory.  I.e., to list a directory
+  with very many files, ls -1U is much more efficient.

   od now aligns fields across lines when printing multiple -t
   specifiers, and no longer prints fields that resulted entirely from
diff --git a/cfg.mk b/cfg.mk
index 8a0dc9f..ce27cf6 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -27,7 +27,7 @@ bootstrap-tools = autoconf,automake,gnulib,bison
 # Now that we have better tests, make this the default.
 export VERBOSE = yes

-old_NEWS_hash = 792b8dca00fe03568653f7ca2d096d9d
+old_NEWS_hash = 7b32bb1296f27ceca68b3a20956cb1b8

 # Add an exemption for sc_makefile_at_at_check.
 _makefile_at_at_check_exceptions = ' && !/^cu_install_program =/'
--
1.7.6.rc2.302.gc2115


From MAILER-DAEMON Sat Jun 25 08:23:40 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QaRtj-0007kP-VW
	for mharc-coreutils@gnu.org; Sat, 25 Jun 2011 08:23:39 -0400
Received: from eggs.gnu.org ([140.186.70.92]:39226)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1QaRth-0007kE-5b
	for coreutils@gnu.org; Sat, 25 Jun 2011 08:23:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1QaRtg-0001bb-3i
	for coreutils@gnu.org; Sat, 25 Jun 2011 08:23:37 -0400
Received: from mail-gy0-f169.google.com ([209.85.160.169]:36241)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1QaRtg-0001bX-1G
	for coreutils@gnu.org; Sat, 25 Jun 2011 08:23:36 -0400
Received: by gyg13 with SMTP id 13so1883703gyg.0
	for <coreutils@gnu.org>; Sat, 25 Jun 2011 05:23:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:date:message-id:subject:from:to
	:content-type; bh=Yc48RgmYyW00+X6IAtT3+wY4UZX0xbTgZQnfFJ20nFM=;
	b=iLroVq5/5YR5k36vPlbWhBlaqMzBxSRzgCq9SRs3iSGBP5lPBFp7kNromjGvyNtY9O
	a9sz16toEqkjaKJEmzA02JRKtCyADqFB9IJcr+rKlnp0NN/RJKZdCQBmKSvY4e0yFyOH
	ao6Rdc18MHBkt0AeoEjRBu7lXCxa6jteFia0M=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	b=KgIFYJt2/RrXGW4j5oVLiVUiJAPzSWamIiyMD1zrgiJIYnFKP3aaqvCPZ4Bo4S6lE4
	MUUYWJy9vEfk6d9IIbhDF3m9QjsOlGI4fXR29yIjYAWn7a/L18O+67H3n0BAoSAkiy9G
	KIMsDKjOXapUXylNfmuz73klVIuFF+JZx87iE=
MIME-Version: 1.0
Received: by 10.236.139.199 with SMTP id c47mr899421yhj.246.1309004615360;
	Sat, 25 Jun 2011 05:23:35 -0700 (PDT)
Received: by 10.236.202.131 with HTTP; Sat, 25 Jun 2011 05:23:35 -0700 (PDT)
Date: Sat, 25 Jun 2011 07:23:35 -0500
Message-ID: <BANLkTinWDWEBWA0YKuibtAWQcP5JNtAV4w@mail.gmail.com>
Subject: typo in man ls?
From: Peng Yu <pengyu.ut@gmail.com>
To: coreutils@gnu.org
Content-Type: text/plain; charset=ISO-8859-1
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.160.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: Sat, 25 Jun 2011 12:23:38 -0000

Hi,

"Sort entries alphabetically if none of -cftuvSUX nor --sort."

I suspect that there is a typo in the above sentence from man ls.
Should it be "Sort entries alphabetically if none of -cftuvSUX nor
--sort exists."?

-- 
Regards,
Peng


From MAILER-DAEMON Sat Jun 25 08:32:36 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QaS2N-000876-6W
	for mharc-coreutils@gnu.org; Sat, 25 Jun 2011 08:32:35 -0400
Received: from eggs.gnu.org ([140.186.70.92]:40133)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1QaS2K-00086z-Rk
	for coreutils@gnu.org; Sat, 25 Jun 2011 08:32:33 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1QaS2J-00034J-TA
	for coreutils@gnu.org; Sat, 25 Jun 2011 08:32:32 -0400
Received: from mail-yi0-f41.google.com ([209.85.218.41]:58804)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1QaS2J-00034D-Qe
	for coreutils@gnu.org; Sat, 25 Jun 2011 08:32:31 -0400
Received: by yia13 with SMTP id 13so1892183yia.0
	for <coreutils@gnu.org>; Sat, 25 Jun 2011 05:32:31 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:in-reply-to:references:date
	:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	bh=bVZ0D/K27kzA6Rseuz4Xd7zW84l77SYP9+NUL7e+9F0=;
	b=R/FqNP+1nyWIs6K0agDokAFTyfBwXHFc6qyt90NZu0VwmCqQaErY/YEOlGKxi5ypmm
	ZKFUi2IXRA/awAvOemw+tfTefILuwOW4rxV9O/MDgA+RcrO4DVLYc/KyWsQtF5FVd326
	hoEn0Sj4/KUiYCNRH3gmTnY7/07yFAL7vOisQ=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type:content-transfer-encoding;
	b=nAg8KdnxWsY6p0SAPgtKDU5EqQdMeWafgTbbks31YOOeofd+yCp2luHEdaq/YRCcpQ
	LQDbLY4jIqpJBGTmMH7oiOLwc4zOEzZFiVY/XV9dkdZzn1eE1qNwaNisw7B3cfFCNCe0
	QxoZThJElh3YKjpu60jB/0/lHV+sYlp1X9BFw=
MIME-Version: 1.0
Received: by 10.236.139.199 with SMTP id c47mr908976yhj.246.1309005151132;
	Sat, 25 Jun 2011 05:32:31 -0700 (PDT)
Received: by 10.236.202.131 with HTTP; Sat, 25 Jun 2011 05:32:31 -0700 (PDT)
In-Reply-To: <87r56ie9qs.fsf@rho.meyering.net>
References: <BANLkTik_sgJm2iaRedT_kXtLQhCyTL8Evw@mail.gmail.com>
	<87r56ie9qs.fsf@rho.meyering.net>
Date: Sat, 25 Jun 2011 07:32:31 -0500
Message-ID: <BANLkTim0ODL27w=noQafhz=ZN++Hg-2y1A@mail.gmail.com>
Subject: Re: Faster ls when there are thousands of files in a directory
From: Peng Yu <pengyu.ut@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: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.218.41
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: Sat, 25 Jun 2011 12:32:34 -0000

On Sat, Jun 25, 2011 at 12:54 AM, Jim Meyering <jim@meyering.net> wrote:
> Peng Yu wrote:
>> When there are a few thousands of files/directories in a directory
>> that I want to ls, I experience long wait time (a few seconds on mac).
>> I'm wondering if some kind of cache can be built for ls to speed it
>> up? Note my ls is installed from macport (not the native mac ls).
>
> Use "ls -1U" (efficient with coreutils-7.0 or newer) or find.

If I use -1U with -ltr, I see the results are still sorted. What does
ls do internally with "-1U" for speedup?

> Someday GNU ls will use fts, and then it will benefit from
> the inode-sorting fts does for some FS types when there are
> very many files. =A0Then it will be faster with additional
> combinations of options. =A0But even then, it won't beat "ls -1U",
> which doesn't call stat at all for FS with useful dirent.d_type.


What is fts?

--=20
Regards,
Peng


From MAILER-DAEMON Sat Jun 25 08:48:39 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QaSHv-0001v1-EL
	for mharc-coreutils@gnu.org; Sat, 25 Jun 2011 08:48:39 -0400
Received: from eggs.gnu.org ([140.186.70.92]:59255)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QaSHt-0001uo-Hq
	for coreutils@gnu.org; Sat, 25 Jun 2011 08:48:38 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QaSHs-00068w-5i
	for coreutils@gnu.org; Sat, 25 Jun 2011 08:48:37 -0400
Received: from mx.meyering.net ([82.230.74.64]:33494)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QaSHr-00068f-UD
	for coreutils@gnu.org; Sat, 25 Jun 2011 08:48:36 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 5C496600E7; Sat, 25 Jun 2011 14:48:34 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Peng Yu <pengyu.ut@gmail.com>
Subject: Re: Faster ls when there are thousands of files in a directory
In-Reply-To: <BANLkTim0ODL27w=noQafhz=ZN++Hg-2y1A@mail.gmail.com> (Peng Yu's
	message of "Sat, 25 Jun 2011 07:32:31 -0500")
References: <BANLkTik_sgJm2iaRedT_kXtLQhCyTL8Evw@mail.gmail.com>
	<87r56ie9qs.fsf@rho.meyering.net>
	<BANLkTim0ODL27w=noQafhz=ZN++Hg-2y1A@mail.gmail.com>
Date: Sat, 25 Jun 2011 14:48:34 +0200
Message-ID: <878vsqcc0t.fsf@rho.meyering.net>
Lines: 36
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: 82.230.74.64
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: Sat, 25 Jun 2011 12:48:38 -0000

Peng Yu wrote:
> On Sat, Jun 25, 2011 at 12:54 AM, Jim Meyering <jim@meyering.net> wrote:
>> Peng Yu wrote:
>>> When there are a few thousands of files/directories in a directory
>>> that I want to ls, I experience long wait time (a few seconds on mac).
>>> I'm wondering if some kind of cache can be built for ls to speed it
>>> up? Note my ls is installed from macport (not the native mac ls).
>>
>> Use "ls -1U" (efficient with coreutils-7.0 or newer) or find.
>
> If I use -1U with -ltr, I see the results are still sorted. What does
> ls do internally with "-1U" for speedup?

When using *only* -1U, ls prints each directory entry name as it is read.

For minimal overhead ls, use only the -1U options.
I.e., type exactly this:

    env ls -1U

followed by zero or more directory names.
Then the results will not be sorted.

>> Someday GNU ls will use fts, and then it will benefit from
>> the inode-sorting fts does for some FS types when there are
>> very many files. =A0Then it will be faster with additional
>> combinations of options. =A0But even then, it won't beat "ls -1U",
>> which doesn't call stat at all for FS with useful dirent.d_type.
>
> What is fts?

It's a module in gnulib, with several improvements over the version in
the GNU C Library.  Short answer: fts is an API for efficient traversal
of a file hierarchy.

See "man fts" for a description.


From MAILER-DAEMON Sat Jun 25 08:56:19 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QaSPK-0002v8-GG
	for mharc-coreutils@gnu.org; Sat, 25 Jun 2011 08:56:18 -0400
Received: from eggs.gnu.org ([140.186.70.92]:60197)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QaSPB-0002tU-N1
	for coreutils@gnu.org; Sat, 25 Jun 2011 08:56:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QaSP9-0007uo-EW
	for coreutils@gnu.org; Sat, 25 Jun 2011 08:56:09 -0400
Received: from mx.meyering.net ([82.230.74.64]:56363)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QaSP9-0007uh-0w
	for coreutils@gnu.org; Sat, 25 Jun 2011 08:56:07 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 3D0B2600E7; Sat, 25 Jun 2011 14:56:06 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: Peng Yu <pengyu.ut@gmail.com>
Subject: Re: typo in man ls?
In-Reply-To: <BANLkTinWDWEBWA0YKuibtAWQcP5JNtAV4w@mail.gmail.com> (Peng Yu's
	message of "Sat, 25 Jun 2011 07:23:35 -0500")
References: <BANLkTinWDWEBWA0YKuibtAWQcP5JNtAV4w@mail.gmail.com>
Date: Sat, 25 Jun 2011 14:56:06 +0200
Message-ID: <8739iycbo9.fsf@rho.meyering.net>
Lines: 48
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: 82.230.74.64
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: Sat, 25 Jun 2011 12:56:16 -0000

Peng Yu wrote:
> "Sort entries alphabetically if none of -cftuvSUX nor --sort."
>
> I suspect that there is a typo in the above sentence from man ls.
> Should it be "Sort entries alphabetically if none of -cftuvSUX nor
> --sort exists."?

Thanks.  There was room for improvement there:

>From 10ec91d84a53b3acae630864c2e82f2a74fa9c38 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Sat, 25 Jun 2011 14:54:45 +0200
Subject: [PATCH] doc: improve ls --help grammar

* src/ls.c (usage): Improve grammar.
Reported by Peng Yu.
---
 THANKS.in |    1 +
 src/ls.c  |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/THANKS.in b/THANKS.in
index a7ec933..2979d52 100644
--- a/THANKS.in
+++ b/THANKS.in
@@ -454,6 +454,7 @@ Paul Slootman                       paul@debian.org
 Paul Townsend                       aab@purdue.edu
 Paul Worrall                        paul@basilisk.uklinux.net
 Pawel Prokop                        pablo@wizard.ae.krakow.pl
+Peng Yu                             pengyu.ut@gmail.com
 Per Cederqvist                      ceder@lysator.liu.se
 Per Kristian Hove                   perhov@math.ntnu.no
 Per Starb=E4ck                        starback@stp.lingfil.uu.se
diff --git a/src/ls.c b/src/ls.c
index a167254..c604e14 100644
--- a/src/ls.c
+++ b/src/ls.c
@@ -4588,7 +4588,7 @@ usage (int status)
       printf (_("Usage: %s [OPTION]... [FILE]...\n"), program_name);
       fputs (_("\
 List information about the FILEs (the current directory by default).\n\
-Sort entries alphabetically if none of -cftuvSUX nor --sort.\n\
+Sort entries alphabetically if none of -cftuvSUX nor --sort is specified.\=
n\
 \n\
 "), stdout);
       fputs (_("\
--
1.7.6.rc2.302.gc2115


From MAILER-DAEMON Sat Jun 25 09:27:22 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QaStN-0007Nw-Pq
	for mharc-coreutils@gnu.org; Sat, 25 Jun 2011 09:27:21 -0400
Received: from eggs.gnu.org ([140.186.70.92]:47620)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bob@proulx.com>) id 1QaStL-0007N9-0s
	for coreutils@gnu.org; Sat, 25 Jun 2011 09:27:20 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bob@proulx.com>) id 1QaStI-0006MR-Ul
	for coreutils@gnu.org; Sat, 25 Jun 2011 09:27:18 -0400
Received: from joseki.proulx.com ([216.17.153.58]:45718)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bob@proulx.com>) id 1QaStI-0006LA-3B
	for coreutils@gnu.org; Sat, 25 Jun 2011 09:27:16 -0400
Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119])
	by joseki.proulx.com (Postfix) with ESMTP id 76F1C21310
	for <coreutils@gnu.org>; Sat, 25 Jun 2011 07:27:13 -0600 (MDT)
Received: by hysteria.proulx.com (Postfix, from userid 1000)
	id 4F8C62DC67; Sat, 25 Jun 2011 07:27:13 -0600 (MDT)
Date: Sat, 25 Jun 2011 07:27:13 -0600
From: Bob Proulx <bob@proulx.com>
To: coreutils@gnu.org
Subject: Re: Faster ls when there are thousands of files in a directory
Message-ID: <20110625132713.GA11524@hysteria.proulx.com>
Mail-Followup-To: coreutils@gnu.org
References: <BANLkTik_sgJm2iaRedT_kXtLQhCyTL8Evw@mail.gmail.com>
	<87r56ie9qs.fsf@rho.meyering.net>
	<BANLkTim0ODL27w=noQafhz=ZN++Hg-2y1A@mail.gmail.com>
	<878vsqcc0t.fsf@rho.meyering.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <878vsqcc0t.fsf@rho.meyering.net>
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
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: Sat, 25 Jun 2011 13:27:21 -0000

Jim Meyering wrote:
> For minimal overhead ls, use only the -1U options.
> I.e., type exactly this:
> 
>     env ls -1U

What benefit is provided by invoking through 'env' in that example
without any environment modifications specified?  I am sure I am
missing something and would enjoy the education.

Bob


From MAILER-DAEMON Sat Jun 25 09:42:46 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QaT8I-0001fB-4J
	for mharc-coreutils@gnu.org; Sat, 25 Jun 2011 09:42:46 -0400
Received: from eggs.gnu.org ([140.186.70.92]:46264)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QaT8F-0001ei-P8
	for coreutils@gnu.org; Sat, 25 Jun 2011 09:42:44 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QaT8D-0001dn-RW
	for coreutils@gnu.org; Sat, 25 Jun 2011 09:42:43 -0400
Received: from mx.meyering.net ([82.230.74.64]:50534)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1QaT8D-0001dj-Dh
	for coreutils@gnu.org; Sat, 25 Jun 2011 09:42:41 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id 5B661600E7; Sat, 25 Jun 2011 15:42:40 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: Re: Faster ls when there are thousands of files in a directory
In-Reply-To: <20110625132713.GA11524@hysteria.proulx.com> (Bob Proulx's
	message of "Sat, 25 Jun 2011 07:27:13 -0600")
References: <BANLkTik_sgJm2iaRedT_kXtLQhCyTL8Evw@mail.gmail.com>
	<87r56ie9qs.fsf@rho.meyering.net>
	<BANLkTim0ODL27w=noQafhz=ZN++Hg-2y1A@mail.gmail.com>
	<878vsqcc0t.fsf@rho.meyering.net>
	<20110625132713.GA11524@hysteria.proulx.com>
Date: Sat, 25 Jun 2011 15:42:40 +0200
Message-ID: <87wrgaauy7.fsf@rho.meyering.net>
Lines: 15
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: 82.230.74.64
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: Sat, 25 Jun 2011 13:42:45 -0000

Bob Proulx wrote:
> Jim Meyering wrote:
>> For minimal overhead ls, use only the -1U options.
>> I.e., type exactly this:
>>
>>     env ls -1U
>
> What benefit is provided by invoking through 'env' in that example
> without any environment modifications specified?  I am sure I am
> missing something and would enjoy the education.

Hi Bob,

Using "env" like that is the portable and shell-agnostic way to ensure
you run the program rather than an alias or shell function named "ls".


From MAILER-DAEMON Sat Jun 25 10:14:50 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QaTdK-0005Y9-8K
	for mharc-coreutils@gnu.org; Sat, 25 Jun 2011 10:14:50 -0400
Received: from eggs.gnu.org ([140.186.70.92]:33794)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bob@proulx.com>) id 1QaTdH-0005Xb-Oy
	for coreutils@gnu.org; Sat, 25 Jun 2011 10:14:48 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bob@proulx.com>) id 1QaTdG-000760-3m
	for coreutils@gnu.org; Sat, 25 Jun 2011 10:14:47 -0400
Received: from joseki.proulx.com ([216.17.153.58]:46880)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bob@proulx.com>) id 1QaTdF-00075t-LP
	for coreutils@gnu.org; Sat, 25 Jun 2011 10:14:45 -0400
Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119])
	by joseki.proulx.com (Postfix) with ESMTP id 340D021310
	for <coreutils@gnu.org>; Sat, 25 Jun 2011 08:14:44 -0600 (MDT)
Received: by hysteria.proulx.com (Postfix, from userid 1000)
	id 15A332DC6E; Sat, 25 Jun 2011 08:14:44 -0600 (MDT)
Date: Sat, 25 Jun 2011 08:14:44 -0600
From: Bob Proulx <bob@proulx.com>
To: coreutils@gnu.org
Subject: Re: Faster ls when there are thousands of files in a directory
Message-ID: <20110625141444.GA31095@hysteria.proulx.com>
Mail-Followup-To: coreutils@gnu.org
References: <BANLkTik_sgJm2iaRedT_kXtLQhCyTL8Evw@mail.gmail.com>
	<87r56ie9qs.fsf@rho.meyering.net>
	<BANLkTim0ODL27w=noQafhz=ZN++Hg-2y1A@mail.gmail.com>
	<878vsqcc0t.fsf@rho.meyering.net>
	<20110625132713.GA11524@hysteria.proulx.com>
	<87wrgaauy7.fsf@rho.meyering.net>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <87wrgaauy7.fsf@rho.meyering.net>
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
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: Sat, 25 Jun 2011 14:14:49 -0000

Jim Meyering wrote:
> Bob Proulx wrote:
> > Jim Meyering wrote:
> >> For minimal overhead ls, use only the -1U options.
> >> I.e., type exactly this:
> >>
> >>     env ls -1U
> >
> > What benefit is provided by invoking through 'env' in that example
> > without any environment modifications specified?  I am sure I am
> > missing something and would enjoy the education.
> 
> Using "env" like that is the portable and shell-agnostic way to ensure
> you run the program rather than an alias or shell function named "ls".

Ah...  Yes.  Good call.

Thanks!
Bob


From MAILER-DAEMON Sun Jun 26 11:06:33 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qaquu-0004Tn-Nb
	for mharc-coreutils@gnu.org; Sun, 26 Jun 2011 11:06:32 -0400
Received: from eggs.gnu.org ([140.186.70.92]:36035)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Qaquq-0004Rk-C5
	for coreutils@gnu.org; Sun, 26 Jun 2011 11:06:30 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Qaqun-0001qY-64
	for coreutils@gnu.org; Sun, 26 Jun 2011 11:06:28 -0400
Received: from mx.meyering.net ([82.230.74.64]:59369)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jim@meyering.net>) id 1Qaqum-0001oK-Cu
	for coreutils@gnu.org; Sun, 26 Jun 2011 11:06:24 -0400
Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000)
	id B2000600A7; Sun, 26 Jun 2011 17:06:22 +0200 (CEST)
From: Jim Meyering <jim@meyering.net>
To: coreutils@gnu.org
Subject: [PATCH 2/2] maint: use "const" and "pure" function attributes where
	possible
Date: Sun, 26 Jun 2011 17:06:22 +0200
Message-ID: <87aad4eioh.fsf@rho.meyering.net>
Lines: 563
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: 82.230.74.64
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, 26 Jun 2011 15:06:31 -0000

Following up on a month-old gnulib thread, and now
that gnulib provides _GL_ATTRIBUTE_CONST and _GL_ATTRIBUTE_PURE, ...

>From 4c45a7a71190231b542a90bc8a179ee17f1fe329 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Sat, 4 Jun 2011 10:41:08 +0200
Subject: [PATCH 1/2] buffer_lcm: declare with _GL_ATTRIBUTE_CONST

* lib/buffer-lcm.h (buffer_lcm): Use _GL_ATTRIBUTE_CONST.
* lib/buffer-lcm.c: Include <config.h>.
---
 lib/buffer-lcm.c |    1 +
 lib/buffer-lcm.h |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lib/buffer-lcm.c b/lib/buffer-lcm.c
index 022a731..87503af 100644
--- a/lib/buffer-lcm.c
+++ b/lib/buffer-lcm.c
@@ -17,6 +17,7 @@

 /* Written by Paul Eggert.  */

+#include <config.h>
 #include "buffer-lcm.h"

 /* Return a buffer size suitable for doing I/O with files whose block
diff --git a/lib/buffer-lcm.h b/lib/buffer-lcm.h
index 9a6cdf5..454c65b 100644
--- a/lib/buffer-lcm.h
+++ b/lib/buffer-lcm.h
@@ -1,2 +1,2 @@
 #include <stddef.h>
-size_t buffer_lcm (size_t, size_t, size_t);
+size_t buffer_lcm (size_t, size_t, size_t) _GL_ATTRIBUTE_CONST;
--
1.7.6.rc2.302.gc2115


>From 16af8b95c0dc985e072ef6c22267c00c21637588 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering@redhat.com>
Date: Sun, 24 Apr 2011 19:06:39 +0200
Subject: [PATCH 2/2] maint: use "const" and "pure" function attributes where
 possible

* configure.ac (WARN_CFLAGS): Add -Wsuggest-attribute=const,
-Wsuggest-attribute=pure and -Wsuggest-attribute=noreturn.
(GNULIB_WARN_CFLAGS): But do not add them here... yet.
* src/chown-core.h (chopt_free, uid_to_name): Add function attribute(s).
* src/copy.c (is_ancestor, valid_options): Likewise.
* src/copy.h (chown_failure_ok): Likewise.
* src/dd.c (operand_matches, operand_is): Likewise.
* src/df.c (selected_fstype, excluded_fstype): Likewise.
* src/expr.c (null looks_like_integer): Likewise.
* src/md5sum.c (hex_digits): Likewise.
* src/od.c (get_lcm): Likewise.
* src/pathchk.c (component_start, component_len): Likewise.
* src/pinky.c (count_ampersands): Likewise.
* src/pr.c (cols_ready_to_print): Likewise.
* src/ptx.c (search_table): Likewise.
* src/sort.c (find_unit_order): Likewise.
* src/stty.c (mode_type_flag, string_to_baud, baud_to_value): Likewise.
* src/system.h (gcd, lcm): Likewise.
* src/tr.c (is_char_class_member, look_up_char_class): Likewise.
(star_digits_closebracket): Likewise.
* src/uniq.c (find_field): Likewise.
* src/wc.c (compute_number_width): Likewise.
* lib/xfts.h (cycle_warning_required): Likewise.
* gl/lib/randint.h (randint_get_source): Likewise.
* gl/lib/randperm.c (ceil_lg): Likewise.
* gl/lib/randperm.h (randperm_bound): Likewise.
* lib/strnumcmp.h (strintcmp): Likewise.
---
 configure.ac           |    6 ++++++
 gl/lib/randint.h       |    3 ++-
 gl/lib/randperm.c      |    2 +-
 gl/lib/randperm.h      |    2 +-
 gl/lib/tempname.c.diff |    2 +-
 lib/strnumcmp-in.h     |    4 ++--
 lib/strnumcmp.c        |    2 +-
 lib/strnumcmp.h        |    2 +-
 lib/xfts.h             |    3 ++-
 src/chown-core.h       |    4 ++--
 src/copy.c             |    4 ++--
 src/copy.h             |    2 +-
 src/dd.c               |    4 ++--
 src/df.c               |    4 ++--
 src/expr.c             |    4 ++--
 src/md5sum.c           |    2 +-
 src/od.c               |    2 +-
 src/pathchk.c          |    4 ++--
 src/pinky.c            |    2 +-
 src/pr.c               |    2 +-
 src/ptx.c              |    2 +-
 src/sort.c             |    2 +-
 src/stty.c             |    6 +++---
 src/system.h           |    4 ++--
 src/tr.c               |    6 +++---
 src/uniq.c             |    2 +-
 src/wc.c               |    2 +-
 27 files changed, 46 insertions(+), 38 deletions(-)

diff --git a/configure.ac b/configure.ac
index b6a1007..41b2f00 100644
--- a/configure.ac
+++ b/configure.ac
@@ -101,6 +101,9 @@ if test "$gl_gcc_warnings" = yes; then
   done
   gl_WARN_ADD([-Wno-sign-compare])     # Too many warnings for now
   gl_WARN_ADD([-Wno-unused-parameter]) # Too many warnings for now
+  gl_WARN_ADD([-Wsuggest-attribute=const])
+  gl_WARN_ADD([-Wsuggest-attribute=pure])
+  gl_WARN_ADD([-Wsuggest-attribute=noreturn])

   # In spite of excluding -Wlogical-op above, it is enabled, as of
   # gcc 4.5.0 20090517, and it provokes warnings in cat.c, dd.c, truncate.c
@@ -124,6 +127,9 @@ if test "$gl_gcc_warnings" = yes; then
   nw="$nw -Wunused-macros"
   nw="$nw -Wmissing-prototypes"
   nw="$nw -Wold-style-definition"
+  # FIXME: remove/reenable the following two, once gnulib is adjusted.
+  nw="$nw -Wsuggest-attribute=const"
+  nw="$nw -Wsuggest-attribute=pure"
   gl_MANYWARN_COMPLEMENT([GNULIB_WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
   AC_SUBST([GNULIB_WARN_CFLAGS])

diff --git a/gl/lib/randint.h b/gl/lib/randint.h
index edd6b19..80c9a0e 100644
--- a/gl/lib/randint.h
+++ b/gl/lib/randint.h
@@ -34,7 +34,8 @@ struct randint_source;

 struct randint_source *randint_new (struct randread_source *);
 struct randint_source *randint_all_new (char const *, size_t);
-struct randread_source *randint_get_source (struct randint_source const *);
+struct randread_source *randint_get_source (struct randint_source const *)
+  _GL_ATTRIBUTE_PURE;
 randint randint_genmax (struct randint_source *, randint genmax);

 /* Consume random data from *S to generate a random number in the range
diff --git a/gl/lib/randperm.c b/gl/lib/randperm.c
index 26181b8..362316e 100644
--- a/gl/lib/randperm.c
+++ b/gl/lib/randperm.c
@@ -30,7 +30,7 @@
 /* Return the ceiling of the log base 2 of N.  If N is zero, return
    an unspecified value.  */

-static size_t
+static size_t _GL_ATTRIBUTE_CONST
 ceil_lg (size_t n)
 {
   size_t b = 0;
diff --git a/gl/lib/randperm.h b/gl/lib/randperm.h
index 79bbf9f..0a0837a 100644
--- a/gl/lib/randperm.h
+++ b/gl/lib/randperm.h
@@ -1,4 +1,4 @@
 #include "randint.h"
 #include <stddef.h>
-size_t randperm_bound (size_t, size_t);
+size_t randperm_bound (size_t, size_t) _GL_ATTRIBUTE_CONST;
 size_t *randperm_new (struct randint_source *, size_t, size_t);
diff --git a/gl/lib/tempname.c.diff b/gl/lib/tempname.c.diff
index 1bf1119..fcacf53 100644
--- a/gl/lib/tempname.c.diff
+++ b/gl/lib/tempname.c.diff
@@ -22,7 +22,7 @@ index 2da5afe..562955a 100644
  }
  #endif /* _LIBC */

-+static inline bool
++static inline bool _GL_ATTRIBUTE_PURE
 +check_x_suffix (char const *s, size_t len)
 +{
 +  return len <= strspn (s, "X");
diff --git a/lib/strnumcmp-in.h b/lib/strnumcmp-in.h
index dccbca5..7e963bc 100644
--- a/lib/strnumcmp-in.h
+++ b/lib/strnumcmp-in.h
@@ -71,7 +71,7 @@
      if digit return -1, else 0
    return 0 */

-static inline int
+static inline int _GL_ATTRIBUTE_PURE
 fraccompare (char const *a, char const *b, char decimal_point)
 {
   if (*a == decimal_point && *b == decimal_point)
@@ -111,7 +111,7 @@ fraccompare (char const *a, char const *b, char decimal_point)
    causes comparisons to act as if there is no decimal point
    character, and likewise for THOUSANDS_SEP.  */

-static inline int
+static inline int _GL_ATTRIBUTE_PURE
 numcompare (char const *a, char const *b,
             int decimal_point, int thousands_sep)
 {
diff --git a/lib/strnumcmp.c b/lib/strnumcmp.c
index f130b58..2dfc28c 100644
--- a/lib/strnumcmp.c
+++ b/lib/strnumcmp.c
@@ -23,7 +23,7 @@

 /* Externally-visible name for numcompare.  */

-int
+int _GL_ATTRIBUTE_PURE
 strnumcmp (char const *a, char const *b,
            int decimal_point, int thousands_sep)
 {
diff --git a/lib/strnumcmp.h b/lib/strnumcmp.h
index 91ad351..4deef82 100644
--- a/lib/strnumcmp.h
+++ b/lib/strnumcmp.h
@@ -1,2 +1,2 @@
-int strintcmp (char const *, char const *);
+int strintcmp (char const *, char const *) _GL_ATTRIBUTE_PURE;
 int strnumcmp (char const *, char const *, int, int);
diff --git a/lib/xfts.h b/lib/xfts.h
index fc3ba90..f903f48 100644
--- a/lib/xfts.h
+++ b/lib/xfts.h
@@ -6,4 +6,5 @@ xfts_open (char * const *, int options,
            int (*) (const FTSENT **, const FTSENT **));

 bool
-cycle_warning_required (FTS const *fts, FTSENT const *ent);
+cycle_warning_required (FTS const *fts, FTSENT const *ent)
+  _GL_ATTRIBUTE_PURE;
diff --git a/src/chown-core.h b/src/chown-core.h
index 3acb5e9..e7b3741 100644
--- a/src/chown-core.h
+++ b/src/chown-core.h
@@ -68,13 +68,13 @@ struct Chown_option
 void
 chopt_init (struct Chown_option *);

-void
+void _GL_ATTRIBUTE_PURE _GL_ATTRIBUTE_CONST
 chopt_free (struct Chown_option *);

 char *
 gid_to_name (gid_t);

-char *
+char * _GL_ATTRIBUTE_PURE
 uid_to_name (uid_t);

 bool
diff --git a/src/copy.c b/src/copy.c
index 1025fe1..c17b942 100644
--- a/src/copy.c
+++ b/src/copy.c
@@ -468,7 +468,7 @@ extent_copy (int src_fd, int dest_fd, char *buf, size_t buf_size,
    performance hit that's probably noticeable only on trees deeper
    than a few hundred levels.  See use of active_dir_map in remove.c  */

-static bool
+static bool _GL_ATTRIBUTE_PURE
 is_ancestor (const struct stat *sb, const struct dir_list *ancestors)
 {
   while (ancestors != 0)
@@ -2535,7 +2535,7 @@ un_backup:
   return false;
 }

-static bool
+static bool _GL_ATTRIBUTE_PURE
 valid_options (const struct cp_options *co)
 {
   assert (co != NULL);
diff --git a/src/copy.h b/src/copy.h
index 5014ea9..7332c7c 100644
--- a/src/copy.h
+++ b/src/copy.h
@@ -282,7 +282,7 @@ void dest_info_init (struct cp_options *);
 void src_info_init (struct cp_options *);

 void cp_options_default (struct cp_options *);
-bool chown_failure_ok (struct cp_options const *);
+bool chown_failure_ok (struct cp_options const *) _GL_ATTRIBUTE_PURE;
 mode_t cached_umask (void);

 #endif
diff --git a/src/dd.c b/src/dd.c
index 45aa9b9..3799d75 100644
--- a/src/dd.c
+++ b/src/dd.c
@@ -1028,7 +1028,7 @@ write_output (void)

 /* Return true if STR is of the form "PATTERN" or "PATTERNDELIM...".  */

-static bool
+static bool _GL_ATTRIBUTE_PURE
 operand_matches (char const *str, char const *pattern, char delim)
 {
   while (*pattern)
@@ -1108,7 +1108,7 @@ parse_integer (const char *str, bool *invalid)

 /* OPERAND is of the form "X=...".  Return true if X is NAME.  */

-static bool
+static bool _GL_ATTRIBUTE_PURE
 operand_is (char const *operand, char const *name)
 {
   return operand_matches (operand, name, '=');
diff --git a/src/df.c b/src/df.c
index 1b27675..982d607 100644
--- a/src/df.c
+++ b/src/df.c
@@ -321,7 +321,7 @@ get_header (void)

 /* Is FSTYPE a type of file system that should be listed?  */

-static bool
+static bool _GL_ATTRIBUTE_PURE
 selected_fstype (const char *fstype)
 {
   const struct fs_type_list *fsp;
@@ -336,7 +336,7 @@ selected_fstype (const char *fstype)

 /* Is FSTYPE a type of file system that should be omitted?  */

-static bool
+static bool _GL_ATTRIBUTE_PURE
 excluded_fstype (const char *fstype)
 {
   const struct fs_type_list *fsp;
diff --git a/src/expr.c b/src/expr.c
index 2331f64..1f53507 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -393,7 +393,7 @@ printv (VALUE *v)

 /* Return true if V is a null-string or zero-number.  */

-static bool
+static bool _GL_ATTRIBUTE_PURE
 null (VALUE *v)
 {
   switch (v->type)
@@ -424,7 +424,7 @@ null (VALUE *v)

 /* Return true if CP takes the form of an integer.  */

-static bool
+static bool _GL_ATTRIBUTE_PURE
 looks_like_integer (char const *cp)
 {
   cp += (*cp == '-');
diff --git a/src/md5sum.c b/src/md5sum.c
index 6f6e637..9bbdc60 100644
--- a/src/md5sum.c
+++ b/src/md5sum.c
@@ -355,7 +355,7 @@ split_3 (char *s, size_t s_len,

 /* Return true if S is a NUL-terminated string of DIGEST_HEX_BYTES hex digits.
    Otherwise, return false.  */
-static bool
+static bool _GL_ATTRIBUTE_PURE
 hex_digits (unsigned char const *s)
 {
   unsigned int i;
diff --git a/src/od.c b/src/od.c
index 8604a8d..9ddd519 100644
--- a/src/od.c
+++ b/src/od.c
@@ -1257,7 +1257,7 @@ read_block (size_t n, char *block, size_t *n_bytes_in_buffer)
 /* Return the least common multiple of the sizes associated
    with the format specs.  */

-static int
+static int _GL_ATTRIBUTE_PURE
 get_lcm (void)
 {
   size_t i;
diff --git a/src/pathchk.c b/src/pathchk.c
index 7f4e5df..8146528 100644
--- a/src/pathchk.c
+++ b/src/pathchk.c
@@ -211,7 +211,7 @@ portable_chars_only (char const *file, size_t filelen)

 /* Return the address of the start of the next file name component in F.  */

-static char *
+static char * _GL_ATTRIBUTE_PURE
 component_start (char *f)
 {
   while (*f == '/')
@@ -221,7 +221,7 @@ component_start (char *f)

 /* Return the size of the file name component F.  F must be nonempty.  */

-static size_t
+static size_t _GL_ATTRIBUTE_PURE
 component_len (char const *f)
 {
   size_t len;
diff --git a/src/pinky.c b/src/pinky.c
index 5e279e9..00107b7 100644
--- a/src/pinky.c
+++ b/src/pinky.c
@@ -82,7 +82,7 @@ static struct option const longopts[] =

 /* Count and return the number of ampersands in STR.  */

-static size_t
+static size_t _GL_ATTRIBUTE_PURE
 count_ampersands (const char *str)
 {
   size_t count = 0;
diff --git a/src/pr.c b/src/pr.c
index 3995c37..771418c 100644
--- a/src/pr.c
+++ b/src/pr.c
@@ -773,7 +773,7 @@ static struct option const long_options[] =
 /* Return the number of columns that have either an open file or
    stored lines. */

-static int
+static int _GL_ATTRIBUTE_PURE
 cols_ready_to_print (void)
 {
   COLUMN *q;
diff --git a/src/ptx.c b/src/ptx.c
index 7ac6e8f..ff5e433 100644
--- a/src/ptx.c
+++ b/src/ptx.c
@@ -595,7 +595,7 @@ compare_occurs (const void *void_first, const void *void_second)
 | Return !0 if WORD appears in TABLE.  Uses a binary search.  |
 `------------------------------------------------------------*/

-static int
+static int _GL_ATTRIBUTE_PURE
 search_table (WORD *word, WORD_TABLE *table)
 {
   int lowest;			/* current lowest possible index */
diff --git a/src/sort.c b/src/sort.c
index 084addf..3d3119d 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -1846,7 +1846,7 @@ static char const unit_order[UCHAR_LIM] =
    separators and a decimal point, but it may not contain leading blanks.
    Negative numbers get negative orders; zero numbers have a zero order.  */

-static int
+static int _GL_ATTRIBUTE_PURE
 find_unit_order (char const *number)
 {
   bool minus_sign = (*number == '-');
diff --git a/src/stty.c b/src/stty.c
index 6d54ece..5f5211b 100644
--- a/src/stty.c
+++ b/src/stty.c
@@ -1428,7 +1428,7 @@ screen_columns (void)
   }
 }

-static tcflag_t *
+static tcflag_t * _GL_ATTRIBUTE_PURE
 mode_type_flag (enum mode_type type, struct termios *mode)
 {
   switch (type)
@@ -1789,7 +1789,7 @@ static struct speed_map const speeds[] =
   {NULL, 0, 0}
 };

-static speed_t
+static speed_t _GL_ATTRIBUTE_PURE
 string_to_baud (const char *arg)
 {
   int i;
@@ -1800,7 +1800,7 @@ string_to_baud (const char *arg)
   return (speed_t) -1;
 }

-static unsigned long int
+static unsigned long int _GL_ATTRIBUTE_PURE
 baud_to_value (speed_t speed)
 {
   int i;
diff --git a/src/system.h b/src/system.h
index d250d94..107dbd5 100644
--- a/src/system.h
+++ b/src/system.h
@@ -439,7 +439,7 @@ enum
 /* Compute the greatest common divisor of U and V using Euclid's
    algorithm.  U and V must be nonzero.  */

-static inline size_t
+static inline size_t _GL_ATTRIBUTE_CONST
 gcd (size_t u, size_t v)
 {
   do
@@ -457,7 +457,7 @@ gcd (size_t u, size_t v)
    nonzero.  There is no overflow checking, so callers should not
    specify outlandish sizes.  */

-static inline size_t
+static inline size_t _GL_ATTRIBUTE_CONST
 lcm (size_t u, size_t v)
 {
   return u * (v / gcd (u, v));
diff --git a/src/tr.c b/src/tr.c
index f7593d3..dfa37d0 100644
--- a/src/tr.c
+++ b/src/tr.c
@@ -364,7 +364,7 @@ is_equiv_class_member (unsigned char equiv_class, unsigned char c)
 /* Return true if the character C is a member of the
    character class CHAR_CLASS.  */

-static bool
+static bool _GL_ATTRIBUTE_PURE
 is_char_class_member (enum Char_class char_class, unsigned char c)
 {
   int result;
@@ -542,7 +542,7 @@ unquote (char const *s, struct E_string *es)
 /* If CLASS_STR is a valid character class string, return its index
    in the global char_class_name array.  Otherwise, return CC_NO_CLASS.  */

-static enum Char_class
+static enum Char_class _GL_ATTRIBUTE_PURE
 look_up_char_class (char const *class_str, size_t len)
 {
   enum Char_class i;
@@ -844,7 +844,7 @@ find_bracketed_repeat (const struct E_string *es, size_t start_idx,
    expression `\*[0-9]*\]', false otherwise.  The string does not
    match if any of its characters are escaped.  */

-static bool
+static bool _GL_ATTRIBUTE_PURE
 star_digits_closebracket (const struct E_string *es, size_t idx)
 {
   size_t i;
diff --git a/src/uniq.c b/src/uniq.c
index b35938a..db717b1 100644
--- a/src/uniq.c
+++ b/src/uniq.c
@@ -206,7 +206,7 @@ size_opt (char const *opt, char const *msgid)
 /* Given a linebuffer LINE,
    return a pointer to the beginning of the line's field to be compared. */

-static char *
+static char * _GL_ATTRIBUTE_PURE
 find_field (struct linebuffer const *line)
 {
   size_t count;
diff --git a/src/wc.c b/src/wc.c
index d5a0afc..c4b5a91 100644
--- a/src/wc.c
+++ b/src/wc.c
@@ -556,7 +556,7 @@ get_input_fstatus (int nfiles, char *const *file)
    recorded in FSTATUS.  Optimize the same special case that
    get_input_fstatus optimizes.  */

-static int
+static int _GL_ATTRIBUTE_PURE
 compute_number_width (int nfiles, struct fstatus const *fstatus)
 {
   int width = 1;
--
1.7.6.rc2.302.gc2115


From MAILER-DAEMON Sun Jun 26 20:00:23 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QazFW-0006Js-FI
	for mharc-coreutils@gnu.org; Sun, 26 Jun 2011 20:00:22 -0400
Received: from eggs.gnu.org ([140.186.70.92]:43455)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <frogstarr78@gmail.com>) id 1QavC5-00031K-Ub
	for coreutils@gnu.org; Sun, 26 Jun 2011 15:40:35 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <frogstarr78@gmail.com>) id 1QavC4-0003pQ-Pv
	for coreutils@gnu.org; Sun, 26 Jun 2011 15:40:33 -0400
Received: from mail-fx0-f52.google.com ([209.85.161.52]:44454)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <frogstarr78@gmail.com>) id 1QavC4-0003pH-DQ
	for coreutils@gnu.org; Sun, 26 Jun 2011 15:40:32 -0400
Received: by fxd18 with SMTP id 18so1162046fxd.39
	for <coreutils@gnu.org>; Sun, 26 Jun 2011 12:40:30 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:date:message-id:subject:from:to
	:content-type; bh=QwlmNdWxGp0xAsLn1VS1bUaPasqNOPAgRCoeFT6dVPQ=;
	b=gwit/WJhaE/NlfuovSxW6BJbEqUNZFMLeEyUPY9HvxpX1PZzRVxlUQYwsP88RS3kzh
	JBuTNeeyyyhALdnREp1vTW6mgeGS0MzzkujtyCdtVjgBfl9OLa6/sq40eTyRHrowvSRR
	f0M7+ZgBbKmg7/3dE5iaaxHziMEMnYAZ4oxiE=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	b=ZbFot9iEnXSYq8CNeSgvE3sPLe1CYTJMbQzRoNLWvrhfisG59DZ6X7vlIPckJQVWPc
	DRyigs1l9L1USbWISlA6PE5gxS6FvsZYvI1PvY6QyeSczWbavDlwu+1tgFlXnPFWsgV6
	BHs0Ig2T7vvlD1B6lejh83try0ktAK6LzQLDQ=
MIME-Version: 1.0
Received: by 10.223.87.215 with SMTP id x23mr7804636fal.32.1309117230490; Sun,
	26 Jun 2011 12:40:30 -0700 (PDT)
Received: by 10.223.103.1 with HTTP; Sun, 26 Jun 2011 12:40:30 -0700 (PDT)
Date: Sun, 26 Jun 2011 12:40:30 -0700
Message-ID: <BANLkTimC5Ur_LngQW35TY1x6NPk_TDSkqA@mail.gmail.com>
Subject: Feature Request for 'sort' utility
From: scott n-h <frogstarr78@gmail.com>
To: coreutils@gnu.org
Content-Type: text/plain; charset=ISO-8859-1
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.161.52
X-Mailman-Approved-At: Sun, 26 Jun 2011 20:00:20 -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: Sun, 26 Jun 2011 19:40:35 -0000

-I or --ip-address

I'm hoping the usefulness of this would be apparent.


From MAILER-DAEMON Sun Jun 26 20:05:42 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QazKf-0007Qe-I8
	for mharc-coreutils@gnu.org; Sun, 26 Jun 2011 20:05:41 -0400
Received: from eggs.gnu.org ([140.186.70.92]:34692)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bob@proulx.com>) id 1QazKZ-0007PB-1B
	for coreutils@gnu.org; Sun, 26 Jun 2011 20:05:39 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <bob@proulx.com>) id 1QazKW-00015y-8c
	for coreutils@gnu.org; Sun, 26 Jun 2011 20:05:34 -0400
Received: from joseki.proulx.com ([216.17.153.58]:52838)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <bob@proulx.com>) id 1QazKV-00015c-Qg
	for coreutils@gnu.org; Sun, 26 Jun 2011 20:05:32 -0400
Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119])
	by joseki.proulx.com (Postfix) with ESMTP id D364E21361
	for <coreutils@gnu.org>; Sun, 26 Jun 2011 18:05:29 -0600 (MDT)
Received: by hysteria.proulx.com (Postfix, from userid 1000)
	id 8C2062DC6E; Sun, 26 Jun 2011 18:05:29 -0600 (MDT)
Date: Sun, 26 Jun 2011 18:05:29 -0600
From: Bob Proulx <bob@proulx.com>
To: coreutils@gnu.org
Subject: Re: Feature Request for 'sort' utility
Message-ID: <20110627000529.GA31433@hysteria.proulx.com>
Mail-Followup-To: coreutils@gnu.org
References: <BANLkTimC5Ur_LngQW35TY1x6NPk_TDSkqA@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <BANLkTimC5Ur_LngQW35TY1x6NPk_TDSkqA@mail.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
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, 27 Jun 2011 00:05:39 -0000

scott n-h wrote:
> -I or --ip-address
> I'm hoping the usefulness of this would be apparent.

The coreutils manual:

  http://www.gnu.org/software/coreutils/manual/html_node/sort-invocation.html#sort-invocation

Shows an example of sorting IPv4 addresses this way:

  sort -s -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n

Bob


From MAILER-DAEMON Mon Jun 27 05:11:14 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1Qb7qb-0001gC-Or
	for mharc-coreutils@gnu.org; Mon, 27 Jun 2011 05:11:13 -0400
Received: from eggs.gnu.org ([140.186.70.92]:33532)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kerolasa@gmail.com>) id 1Qb7qW-0001fH-Pk
	for coreutils@gnu.org; Mon, 27 Jun 2011 05:11:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <kerolasa@gmail.com>) id 1Qb7qT-0000pm-9x
	for coreutils@gnu.org; Mon, 27 Jun 2011 05:11:08 -0400
Received: from mail-qw0-f41.google.com ([209.85.216.41]:55653)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kerolasa@gmail.com>) id 1Qb7qS-0000pV-LD
	for coreutils@gnu.org; Mon, 27 Jun 2011 05:11:05 -0400
Received: by qwa26 with SMTP id 26so2965960qwa.0
	for <coreutils@gnu.org>; Mon, 27 Jun 2011 02:11:02 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:reply-to:sender:date
	:x-google-sender-auth:message-id:subject:from:to:content-type;
	bh=e3rQJnrxeKD9BBBppNdzl3dD9e3yDJrX5m5kO1uBcOU=;
	b=xMCal2cxiH/PhP7BNqR1ZDLD/8mMbjWHwF0MTb9/RnTG78hBoq0Vm/Fhhs8OEqfefZ
	ZgpHhildUqfIHdSB4KbeDgvqexDFHDYanVOmYiWvaGlUgmIMj3bvqZ0XKXQrc41jfxgQ
	pz/nkCRVDqt0doofaSRu5oeK3RCewQfW1bIbM=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:reply-to:sender:date:x-google-sender-auth:message-id
	:subject:from:to:content-type;
	b=s1S1cb+ISLgkCdGdLp+0rJ64UoZhs+YTcszh0JUS+wqRoHDSH5De3SmNhg0BcseYAz
	szcnKSWJdifCwfJ2kfXDF6FtDFVcA8jtw4dkhD1vrPiwq9yhGcMuOXCM158U633bjPAw
	GBmKpTUJ+Kg8W8bV/3WOWAt1uYXhMKy2FdFwk=
MIME-Version: 1.0
Received: by 10.229.137.19 with SMTP id u19mr4292965qct.173.1309165861587;
	Mon, 27 Jun 2011 02:11:01 -0700 (PDT)
Sender: kerolasa@gmail.com
Received: by 10.229.107.15 with HTTP; Mon, 27 Jun 2011 02:11:01 -0700 (PDT)
Date: Mon, 27 Jun 2011 11:11:01 +0200
X-Google-Sender-Auth: q4vVBvzWXcqzO8lRwcYCkcedlFw
Message-ID: <BANLkTimnRiDUcE=UnyTXMEKjL9NA7yk5fA@mail.gmail.com>
Subject: rename command
From: Sami Kerola <kerolasa@iki.fi>
To: coreutils@gnu.org
Content-Type: multipart/mixed; boundary=00235452ffec21cbaa04a6adeef4
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.216.41
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: Mon, 27 Jun 2011 09:11:11 -0000

--00235452ffec21cbaa04a6adeef4
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hello coreutilitarians,

I have been lately making some util-linux patches and while doing
so I found rename command. It did not take long to realize that
the command would be much better if it would support similar
switches as mv. To accomplish that reusing gnulib copy
functionality felt correct to me, but that is a problem within
context of util-linux package, it does not use gnulib and I do
not think it will have anytime soon. I proposed to move rename in
util-linux mail list from util-linux to coreutils package, and
Karel Zak, current util-linux maintainer, responded 'go ahead and
ask at coreutils mailing list'.

So here we are, would it sound reasonable to take rename command
to be part of coreutils?

To be a bit more concrete I wrote first version of patch. While
the patch is nearly good there are issues. For instance
tests/misc/help-version is failing, and I my attempt to fix that
was unsuccessful. The command itself poses few implementation
questions. Should rename support recursion, and should the rename
move files across directories (IMHO that would be unintuitive)?

--=20
=A0=A0 Sami Kerola
=A0=A0 http://www.iki.fi/kerolasa/

--00235452ffec21cbaa04a6adeef4
Content-Type: text/plain; charset=UTF-8; 
	name="0001-rename-move-command-from-util-linux-to-coreutils-packa.txt"
Content-Disposition: attachment; 
	filename="0001-rename-move-command-from-util-linux-to-coreutils-packa.txt"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_gpf7hpxl0

RnJvbSAwODIyYjZkM2ViMTY3NjM5NzQ3YjczZDY2MThiZjIzYThhOTljYjM1IE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBTYW1pIEtlcm9sYSA8a2Vyb2xhc2FAaWtpLmZpPgpEYXRlOiBT
YXQsIDI1IEp1biAyMDExIDIxOjQwOjEwICswMjAwClN1YmplY3Q6IFtQQVRDSF0gcmVuYW1lOiBt
b3ZlIGNvbW1hbmQgZnJvbSB1dGlsLWxpbnV4IHRvIGNvcmV1dGlscyBwYWNrYWdlCgoqIEFVVEhP
UlM6IEFkZCBteSBuYW1lLgoqIE5FV1M6IE1lbnRpb24gaXQuCiogUkVBRE1FOiBMaWtld2lzZS4K
KiBkb2MvY29yZXV0aWxzLnRleGkgKHJlbmFtZSBpbnZvY2F0aW9uKTogQWRkIHJlbmFtZSBpbmZv
LgoqIG1hbi9NYWtlZmlsZS5hbSAocmVuYW1lLjEpOiBBZGQgZGVwZW5kZW5jeS4KKiBtYW4vcmVu
YW1lLng6IE5ldyB0ZW1wbGF0ZS4KKiBtYW4vLmdpdGlnbm9yZTogSWdub3JlIGdlbmVyYXRlZCBt
YW4gcGFnZS4KKiBwby9QT1RGSUxFUy5pbjogQWRkIHNyYy9yZW5hbWUuYy4KKiBzcmMvLmdpdGln
bm9yZTogRXhjbHVkZSByZW5hbWUuCiogc3JjL01ha2VmaWxlLmFtIChFWFRSQV9QUk9HUkFNUyk6
IEFkZCByZW5hbWUuCiogc3JjL3JlbmFtZS5jOiBOZXcgZmlsZS4KKiB0ZXN0cy9NYWtlZmlsZS5h
bSAoVEVTVFMpOiBBZGQgbWlzYy9yZW5hbWUtZm9vMmJhci4KKiB0ZXN0cy9taXNjL3JlbmFtZS1m
b28yYmFyOiBOZXcgZmlsZS4KClNpZ25lZC1vZmYtYnk6IFNhbWkgS2Vyb2xhIDxrZXJvbGFzYUBp
a2kuZmk+Ci0tLQogQVVUSE9SUyAgICAgICAgICAgICAgICAgICB8ICAgIDEgKwogTkVXUyAgICAg
ICAgICAgICAgICAgICAgICB8ICAgIDQgKwogUkVBRE1FICAgICAgICAgICAgICAgICAgICB8ICAg
MTAgKy0KIGRvYy9jb3JldXRpbHMudGV4aSAgICAgICAgfCAgIDc1ICsrKysrKysrKysrKy0KIG1h
bi8uZ2l0aWdub3JlICAgICAgICAgICAgfCAgICAxICsKIG1hbi9NYWtlZmlsZS5hbSAgICAgICAg
ICAgfCAgICAxICsKIG1hbi9yZW5hbWUueCAgICAgICAgICAgICAgfCAgIDEwICsrCiBwby9QT1RG
SUxFUy5pbiAgICAgICAgICAgIHwgICAgMSArCiBzcmMvLmdpdGlnbm9yZSAgICAgICAgICAgIHwg
ICAgMSArCiBzcmMvTWFrZWZpbGUuYW0gICAgICAgICAgIHwgICAgNCArCiBzcmMvcmVuYW1lLmMg
ICAgICAgICAgICAgIHwgIDI5MCArKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysrKysr
KysrKysrKysKIHRlc3RzL01ha2VmaWxlLmFtICAgICAgICAgfCAgICAxICsKIHRlc3RzL21pc2Mv
cmVuYW1lLWZvbzJiYXIgfCAgIDMwICsrKysrCiAxMyBmaWxlcyBjaGFuZ2VkLCA0MjMgaW5zZXJ0
aW9ucygrKSwgNiBkZWxldGlvbnMoLSkKIGNyZWF0ZSBtb2RlIDEwMDY0NCBtYW4vcmVuYW1lLngK
IGNyZWF0ZSBtb2RlIDEwMDY0NCBzcmMvcmVuYW1lLmMKIGNyZWF0ZSBtb2RlIDEwMDc1NSB0ZXN0
cy9taXNjL3JlbmFtZS1mb28yYmFyCgpkaWZmIC0tZ2l0IGEvQVVUSE9SUyBiL0FVVEhPUlMKaW5k
ZXggMGMxNTQ3Mi4uMTY2YWIzNCAxMDA2NDQKLS0tIGEvQVVUSE9SUworKysgYi9BVVRIT1JTCkBA
IC02Miw2ICs2Miw3IEBAIHByaW50ZjogRGF2aWQgTWFjS2VuemllCiBwdHg6IEZyYW7Dp29pcyBQ
aW5hcmQKIHB3ZDogSmltIE1leWVyaW5nCiByZWFkbGluazogRG1pdHJ5IFYuIExldmluCityZW5h
bWU6IGFlYig/KSwgU2FtaSBLZXJvbGEKIHJtOiBQYXVsIFJ1YmluLCBEYXZpZCBNYWNLZW56aWUs
IFJpY2hhcmQgTS4gU3RhbGxtYW4sIEppbSBNZXllcmluZwogcm1kaXI6IERhdmlkIE1hY0tlbnpp
ZQogcnVuY29uOiBSdXNzZWxsIENva2VyCmRpZmYgLS1naXQgYS9ORVdTIGIvTkVXUwppbmRleCA2
MTlmYmRkLi5hMmQwMTQ3IDEwMDY0NAotLS0gYS9ORVdTCisrKyBiL05FV1MKQEAgLTE5LDYgKzE5
LDEwIEBAIEdOVSBjb3JldXRpbHMgTkVXUyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgIC0qLSBvdXRsaW5lIC0qLQogICBjaG1vZCwgY2hvd24gYW5kIGNoZ3JwIG5vdyBvdXRwdXQg
dGhlIG9yaWdpbmFsIGF0dHJpYnV0ZXMgaW4gbWVzc2FnZXMsCiAgIHdoZW4gLXYgb3IgLWMgc3Bl
Y2lmaWVkLgogCisqKiBOZXcgcHJvZ3JhbXMKKworICByZW5hbWU6IFJlbmFtZSBtdWx0aXBsZSBm
aWxlcyBieSB1c2luZyBwYXR0ZXJuLgorCiAqKiBOZXcgZmVhdHVyZXMKIAogICBzcGxpdCBhY2Nl
cHRzIGEgbmV3IC0tZmlsdGVyPUNNRCBvcHRpb24uICBXaXRoIGl0LCBzcGxpdCBmaWx0ZXJzIG91
dHB1dApkaWZmIC0tZ2l0IGEvUkVBRE1FIGIvUkVBRE1FCmluZGV4IGVhYTVmYjAuLjVkNWZmNDcg
MTAwNjQ0Ci0tLSBhL1JFQURNRQorKysgYi9SRUFETUUKQEAgLTExLDExICsxMSwxMSBAQCBUaGUg
cHJvZ3JhbXMgdGhhdCBjYW4gYmUgYnVpbHQgd2l0aCB0aGlzIHBhY2thZ2UgYXJlOgogICBjc3Bs
aXQgY3V0IGRhdGUgZGQgZGYgZGlyIGRpcmNvbG9ycyBkaXJuYW1lIGR1IGVjaG8gZW52IGV4cGFu
ZCBleHByCiAgIGZhY3RvciBmYWxzZSBmbXQgZm9sZCBncm91cHMgaGVhZCBob3N0aWQgaG9zdG5h
bWUgaWQgaW5zdGFsbCBqb2luIGtpbGwKICAgbGluayBsbiBsb2duYW1lIGxzIG1kNXN1bSBta2Rp
ciBta2ZpZm8gbWtub2QgbWt0ZW1wIG12IG5pY2Ugbmwgbm9odXAKLSAgbnByb2Mgb2QgcGFzdGUg
cGF0aGNoayBwaW5reSBwciBwcmludGVudiBwcmludGYgcHR4IHB3ZCByZWFkbGluayBybSBybWRp
cgotICBydW5jb24gc2VxIHNoYTFzdW0gc2hhMjI0c3VtIHNoYTI1NnN1bSBzaGEzODRzdW0gc2hh
NTEyc3VtIHNocmVkIHNodWYKLSAgc2xlZXAgc29ydCBzcGxpdCBzdGF0IHN0ZGJ1ZiBzdHR5IHN1
IHN1bSBzeW5jIHRhYyB0YWlsIHRlZSB0ZXN0IHRpbWVvdXQKLSAgdG91Y2ggdHIgdHJ1ZSB0cnVu
Y2F0ZSB0c29ydCB0dHkgdW5hbWUgdW5leHBhbmQgdW5pcSB1bmxpbmsgdXB0aW1lIHVzZXJzCi0g
IHZkaXIgd2Mgd2hvIHdob2FtaSB5ZXMKKyAgbnByb2Mgb2QgcGFzdGUgcGF0aGNoayBwaW5reSBw
ciBwcmludGVudiBwcmludGYgcHR4IHB3ZCByZWFkbGluayByZW5hbWUKKyAgcm0gcm1kaXIgcnVu
Y29uIHNlcSBzaGExc3VtIHNoYTIyNHN1bSBzaGEyNTZzdW0gc2hhMzg0c3VtIHNoYTUxMnN1bSBz
aHJlZAorICBzaHVmIHNsZWVwIHNvcnQgc3BsaXQgc3RhdCBzdGRidWYgc3R0eSBzdSBzdW0gc3lu
YyB0YWMgdGFpbCB0ZWUgdGVzdAorICB0aW1lb3V0IHRvdWNoIHRyIHRydWUgdHJ1bmNhdGUgdHNv
cnQgdHR5IHVuYW1lIHVuZXhwYW5kIHVuaXEgdW5saW5rCisgIHVwdGltZSB1c2VycyB2ZGlyIHdj
IHdobyB3aG9hbWkgeWVzCiAKIFNlZSB0aGUgZmlsZSBORVdTIGZvciBhIGxpc3Qgb2YgbWFqb3Ig
Y2hhbmdlcyBpbiB0aGUgY3VycmVudCByZWxlYXNlLgogCmRpZmYgLS1naXQgYS9kb2MvY29yZXV0
aWxzLnRleGkgYi9kb2MvY29yZXV0aWxzLnRleGkKaW5kZXggZjc0ZGQxYy4uOGZkMTgxYiAxMDA2
NDQKLS0tIGEvZG9jL2NvcmV1dGlscy50ZXhpCisrKyBiL2RvYy9jb3JldXRpbHMudGV4aQpAQCAt
OTQsNiArOTQsNyBAQAogKiBwdHg6IChjb3JldXRpbHMpcHR4IGludm9jYXRpb24uICAgICAgICAg
ICAgICAgUHJvZHVjZSBwZXJtdXRlZCBpbmRleGVzLgogKiBwd2Q6IChjb3JldXRpbHMpcHdkIGlu
dm9jYXRpb24uICAgICAgICAgICAgICAgUHJpbnQgd29ya2luZyBkaXJlY3RvcnkuCiAqIHJlYWRs
aW5rOiAoY29yZXV0aWxzKXJlYWRsaW5rIGludm9jYXRpb24uICAgICBQcmludCByZWZlcmVudCBv
ZiBhIHN5bWxpbmsuCisqIHJlbmFtZTogKGNvcmV1dGlscylyZW5hbWUgaW52b2NhdGlvbi4JCVJl
bmFtZSBtdWx0aXBsZSBmaWxlcy4KICogcm06IChjb3JldXRpbHMpcm0gaW52b2NhdGlvbi4gICAg
ICAgICAgICAgICAgIFJlbW92ZSBmaWxlcy4KICogcm1kaXI6IChjb3JldXRpbHMpcm1kaXIgaW52
b2NhdGlvbi4gICAgICAgICAgIFJlbW92ZSBlbXB0eSBkaXJlY3Rvcmllcy4KICogcnVuY29uOiAo
Y29yZXV0aWxzKXJ1bmNvbiBpbnZvY2F0aW9uLiAgICAgICAgIFJ1biBpbiBzcGVjaWZpZWQgU0VM
aW51eCBDVFguCkBAIC0xOTQsNyArMTk1LDcgQEAgRnJlZSBEb2N1bWVudGF0aW9uIExpY2Vuc2Un
Jy4KICogUHJpbnRpbmcgdGV4dDo6ICAgICAgICAgICAgICAgIGVjaG8gcHJpbnRmIHllcwogKiBD
b25kaXRpb25zOjogICAgICAgICAgICAgICAgICAgZmFsc2UgdHJ1ZSB0ZXN0IGV4cHIKICogUmVk
aXJlY3Rpb246OiAgICAgICAgICAgICAgICAgIHRlZQotKiBGaWxlIG5hbWUgbWFuaXB1bGF0aW9u
OjogICAgICAgZGlybmFtZSBiYXNlbmFtZSBwYXRoY2hrIG1rdGVtcAorKiBGaWxlIG5hbWUgbWFu
aXB1bGF0aW9uOjogICAgICAgZGlybmFtZSBiYXNlbmFtZSBwYXRoY2hrIHJlbmFtZSBta3RlbXAK
ICogV29ya2luZyBjb250ZXh0OjogICAgICAgICAgICAgIHB3ZCBzdHR5IHByaW50ZW52IHR0eQog
KiBVc2VyIGluZm9ybWF0aW9uOjogICAgICAgICAgICAgaWQgbG9nbmFtZSB3aG9hbWkgZ3JvdXBz
IHVzZXJzIHdobwogKiBTeXN0ZW0gY29udGV4dDo6ICAgICAgICAgICAgICAgZGF0ZSBhcmNoIG5w
cm9jIHVuYW1lIGhvc3RuYW1lIGhvc3RpZCB1cHRpbWUKQEAgLTM4MCw2ICszODEsNyBAQCBGaWxl
IG5hbWUgbWFuaXB1bGF0aW9uCiAqIGJhc2VuYW1lIGludm9jYXRpb246OiAgICAgICAgICBTdHJp
cCBkaXJlY3RvcnkgYW5kIHN1ZmZpeCBmcm9tIGEgZmlsZSBuYW1lCiAqIGRpcm5hbWUgaW52b2Nh
dGlvbjo6ICAgICAgICAgICBTdHJpcCBsYXN0IGZpbGUgbmFtZSBjb21wb25lbnQKICogcGF0aGNo
ayBpbnZvY2F0aW9uOjogICAgICAgICAgIENoZWNrIGZpbGUgbmFtZSB2YWxpZGl0eSBhbmQgcG9y
dGFiaWxpdHkKKyogcmVuYW1lIGludm9jYXRpb246OiAgICAgICAgICAgIFJlbmFtZSBtdWx0aXBs
ZSBmaWxlcyBieSB1c2luZyBwYXR0ZXJuCiAqIG1rdGVtcCBpbnZvY2F0aW9uOjogICAgICAgICAg
ICBDcmVhdGUgdGVtcG9yYXJ5IGZpbGUgb3IgZGlyZWN0b3J5CiAKIFdvcmtpbmcgY29udGV4dApA
QCAtMTIzMDcsNiArMTIzMDksNyBAQCBUaGlzIHNlY3Rpb24gZGVzY3JpYmVzIGNvbW1hbmRzIHRo
YXQgbWFuaXB1bGF0ZSBmaWxlIG5hbWVzLgogKiBiYXNlbmFtZSBpbnZvY2F0aW9uOjogICAgICAg
ICBTdHJpcCBkaXJlY3RvcnkgYW5kIHN1ZmZpeCBmcm9tIGEgZmlsZSBuYW1lLgogKiBkaXJuYW1l
IGludm9jYXRpb246OiAgICAgICAgICBTdHJpcCBsYXN0IGZpbGUgbmFtZSBjb21wb25lbnQuCiAq
IHBhdGhjaGsgaW52b2NhdGlvbjo6ICAgICAgICAgIENoZWNrIGZpbGUgbmFtZSB2YWxpZGl0eSBh
bmQgcG9ydGFiaWxpdHkuCisqIHJlbmFtZSBpbnZvY2F0aW9uOjogICAgICAgICAgIFJlbmFtZSBt
dWx0aXBsZSBmaWxlcyBieSB1c2luZyBwYXR0ZXJuLgogKiBta3RlbXAgaW52b2NhdGlvbjo6ICAg
ICAgICAgICBDcmVhdGUgdGVtcG9yYXJ5IGZpbGUgb3IgZGlyZWN0b3J5LgogQGVuZCBtZW51CiAK
QEAgLTEyNDg2LDYgKzEyNDg5LDc2IEBAIEV4aXQgc3RhdHVzOgogMSBvdGhlcndpc2UuCiBAZW5k
IGRpc3BsYXkKIAorCitAbm9kZSByZW5hbWUgaW52b2NhdGlvbgorQHNlY3Rpb24gQGNvbW1hbmR7
cmVuYW1lfTogUmVuYW1lIG11bHRpcGxlIGZpbGVzIGJ5IHVzaW5nIHBhdHRlcm4KKworQHBpbmRl
eCByZW5hbWUKK0BjaW5kZXggcmVuYW1lIG11bHRpcGxlIGZpbGVzCisKK0Bjb21tYW5ke3JlbmFt
ZX0gbW92ZXMgbXVsdGlwbGUgZmlsZXMgYnkgdXNpbmcgcGF0dGVybi4gU3lub3BzaXM6CisKK0Bl
eGFtcGxlCityZW5hbWUgW0B2YXJ7b3B0aW9ufV0gQHZhcntleHByZXNzaW9ufSBAdmFye3JlcGxh
Y2VtZW50fSBAdmFye2ZpbGV9CitAZW5kIGV4YW1wbGUKKworSW4gZXNzZW5jZSB0aGUgQGNvbW1h
bmR7cmVuYW1lfSBjb21tYW5kIGRvZXMgbXVsdGlwbGUgQHZhcntmaWxlfSByZW5hbWVzCitzYW1l
IHdheSBhcyBAY29tbWFuZHttdn0gd291bGQgZG8gaW5kaXZpZHVhbGx5LiBUaGUgQGNvbW1hbmR7
cmVuYW1lfSB3b3Jrcworb24gYmFzaXMgb2YgZXhwcmVzc2lvbiAtIHJlcGxhY2VtZW50IHdoZXJl
IHRoZSBmaXJzdCBvY2N1cnJlbmNlIG9mIHRoZQorZXhwcmVzc2lvbiBpcyByZXBsYWNlZC4gQm90
aCBleHByZXNzaW9uIGFuZCByZXBsYWNlbWVudCBhcmUgc3RyaW5ncy4KKworVGhlIHByb2dyYW0g
YWNjZXB0cyB0aGUgZm9sbG93aW5nIG9wdGlvbnMuICBBbHNvIHNlZSBAcmVme0NvbW1vbiBvcHRp
b25zfS4KKworQHRhYmxlIEBzYW1wCisKK0BvcHRCYWNrdXAKKworQGl0ZW0gLWYKK0BpdGVteCAt
LWZvcmNlCitAb3BpbmRleCAtZgorQG9waW5kZXggLS1mb3JjZQorQGNpbmRleCBwcm9tcHRzLCBv
bWl0dGluZworRG8gbm90IHByb21wdCB0aGUgdXNlciBiZWZvcmUgcmVtb3ZpbmcgYSBkZXN0aW5h
dGlvbiBmaWxlLgorQG12T3B0c0lmbgorCitAaXRlbSAtaQorQGl0ZW14IC0taW50ZXJhY3RpdmUK
K0BvcGluZGV4IC1pCitAb3BpbmRleCAtLWludGVyYWN0aXZlCitAY2luZGV4IHByb21wdHMsIGZv
cmNpbmcKK1Byb21wdCB3aGV0aGVyIHRvIG92ZXJ3cml0ZSBlYWNoIGV4aXN0aW5nIGRlc3RpbmF0
aW9uIGZpbGUsIHJlZ2FyZGxlc3MKK29mIGl0cyBwZXJtaXNzaW9ucy4KK0lmIHRoZSByZXNwb25z
ZSBpcyBub3QgYWZmaXJtYXRpdmUsIHRoZSBmaWxlIGlzIHNraXBwZWQuCitAbXZPcHRzSWZuCisK
K0BpdGVtIC1uCitAaXRlbXggLS1uby1jbG9iYmVyCitAb3BpbmRleCAtbgorQG9waW5kZXggLS1u
by1jbG9iYmVyCitAY2luZGV4IHByb21wdHMsIG9taXR0aW5nCitEbyBub3Qgb3ZlcndyaXRlIGFu
IGV4aXN0aW5nIGZpbGUuCitAbXZPcHRzSWZuCitUaGlzIG9wdGlvbiBpcyBtdXR1YWxseSBleGNs
dXNpdmUgd2l0aCBAb3B0aW9uey1ifSBvciBAb3B0aW9uey0tYmFja3VwfSBvcHRpb24uCisKK0Bv
cHRCYWNrdXBTdWZmaXgKKworQGl0ZW0gLXYKK0BpdGVteCAtLXZlcmJvc2UKK0BvcGluZGV4IC12
CitAb3BpbmRleCAtLXZlcmJvc2UKK1ByaW50IHRoZSBuYW1lIG9mIGVhY2ggZmlsZSBiZWZvcmUg
bW92aW5nIGl0LgorCitAZW5kIHRhYmxlCisKK0BjaW5kZXggZXhpdCBzdGF0dXMgb2YgQGNvbW1h
bmR7cmVuYW1lfQorRXhpdCBzdGF0dXM6CisKK0BkaXNwbGF5CiswIGFsbCBmaWxlcyB3aGVyZSBy
ZW5hbWVkIHN1Y2Nlc2Z1bGx5CisxIG90aGVyd2lzZS4KK0BlbmQgZGlzcGxheQorCisKIEBub2Rl
IG1rdGVtcCBpbnZvY2F0aW9uCiBAc2VjdGlvbiBAY29tbWFuZHtta3RlbXB9OiBDcmVhdGUgdGVt
cG9yYXJ5IGZpbGUgb3IgZGlyZWN0b3J5CiAKZGlmZiAtLWdpdCBhL21hbi8uZ2l0aWdub3JlIGIv
bWFuLy5naXRpZ25vcmUKaW5kZXggMmMyZmZjZC4uNzRmNjlhMSAxMDA2NDQKLS0tIGEvbWFuLy5n
aXRpZ25vcmUKKysrIGIvbWFuLy5naXRpZ25vcmUKQEAgLTU5LDYgKzU5LDcgQEAgcHJpbnRmLjEK
IHB0eC4xCiBwd2QuMQogcmVhZGxpbmsuMQorcmVuYW1lLjEKIHJtLjEKIHJtZGlyLjEKIHNlcS4x
CmRpZmYgLS1naXQgYS9tYW4vTWFrZWZpbGUuYW0gYi9tYW4vTWFrZWZpbGUuYW0KaW5kZXggY2I0
NDA4Yy4uZGUwNTBlOSAxMDA2NDQKLS0tIGEvbWFuL01ha2VmaWxlLmFtCisrKyBiL21hbi9NYWtl
ZmlsZS5hbQpAQCAtOTEsNiArOTEsNyBAQCBwcmludGYuMToJJChjb21tb25fZGVwKQkkKHNyY2Rp
cikvcHJpbnRmLngJLi4vc3JjL3ByaW50Zi5jCiBwdHguMToJCSQoY29tbW9uX2RlcCkJJChzcmNk
aXIpL3B0eC54CQkuLi9zcmMvcHR4LmMKIHB3ZC4xOgkJJChjb21tb25fZGVwKQkkKHNyY2Rpcikv
cHdkLngJCS4uL3NyYy9wd2QuYwogcmVhZGxpbmsuMToJJChjb21tb25fZGVwKQkkKHNyY2Rpcikv
cmVhZGxpbmsueAkuLi9zcmMvcmVhZGxpbmsuYworcmVuYW1lLjE6CSQoY29tbW9uX2RlcCkgICAk
KHNyY2RpcikvcmVuYW1lLngJLi4vc3JjL3JlbmFtZS5jCiBybS4xOgkJJChjb21tb25fZGVwKQkk
KHNyY2Rpcikvcm0ueAkJLi4vc3JjL3JtLmMKIHJtZGlyLjE6CSQoY29tbW9uX2RlcCkJJChzcmNk
aXIpL3JtZGlyLngJLi4vc3JjL3JtZGlyLmMKIHJ1bmNvbi4xOgkkKGNvbW1vbl9kZXApCSQoc3Jj
ZGlyKS9ydW5jb24ueAkuLi9zcmMvcnVuY29uLmMKZGlmZiAtLWdpdCBhL21hbi9yZW5hbWUueCBi
L21hbi9yZW5hbWUueApuZXcgZmlsZSBtb2RlIDEwMDY0NAppbmRleCAwMDAwMDAwLi5hMzhkZGZk
Ci0tLSAvZGV2L251bGwKKysrIGIvbWFuL3JlbmFtZS54CkBAIC0wLDAgKzEsMTAgQEAKK1tOQU1F
XQorcmVuYW1lIFwtIHJlbmFtZSBtdWx0aXBsZSBmaWxlcyBieSB1c2luZyBwYXR0ZXJuCitbREVT
Q1JJUFRJT05dCisuXCIgQWRkIGFueSBhZGRpdGlvbmFsIGRlc2NyaXB0aW9uIGhlcmUKK1tFWEFN
UExFU10KKy5CIHJlbmFtZSAuaHRtIC5odG1sICouaHRtCisuYnIKK1RoaXMgd2lsbCBtb3ZlIGFs
bCBmaWxlcyBlbmRpbmcgLmh0bSB0byBlbmQgd2l0aCAuaHRtbCBpbiBjdXJyZW50IGRpcmVjdG9y
eS4KK1tTRUUgQUxTT10KK3JlbmFtZSgyKQpkaWZmIC0tZ2l0IGEvcG8vUE9URklMRVMuaW4gYi9w
by9QT1RGSUxFUy5pbgppbmRleCA5N2JjZjQ1Li42ZDA0N2MxIDEwMDY0NAotLS0gYS9wby9QT1RG
SUxFUy5pbgorKysgYi9wby9QT1RGSUxFUy5pbgpAQCAtMTAxLDYgKzEwMSw3IEBAIHNyYy9wdHgu
Ywogc3JjL3B3ZC5jCiBzcmMvcmVhZGxpbmsuYwogc3JjL3JlbW92ZS5jCitzcmMvcmVuYW1lLmMK
IHNyYy9ybS5jCiBzcmMvcm1kaXIuYwogc3JjL3J1bmNvbi5jCmRpZmYgLS1naXQgYS9zcmMvLmdp
dGlnbm9yZSBiL3NyYy8uZ2l0aWdub3JlCmluZGV4IGQzOTczNzAuLjQzMGMxZTIgMTAwNjQ0Ci0t
LSBhL3NyYy8uZ2l0aWdub3JlCisrKyBiL3NyYy8uZ2l0aWdub3JlCkBAIC02Nyw2ICs2Nyw3IEBA
IHByaW50ZgogcHR4CiBwd2QKIHJlYWRsaW5rCityZW5hbWUKIHJtCiBybWRpcgogcnVuY29uCmRp
ZmYgLS1naXQgYS9zcmMvTWFrZWZpbGUuYW0gYi9zcmMvTWFrZWZpbGUuYW0KaW5kZXggZWYwZTdh
NC4uMjVjZjk4NSAxMDA2NDQKLS0tIGEvc3JjL01ha2VmaWxlLmFtCisrKyBiL3NyYy9NYWtlZmls
ZS5hbQpAQCAtOTcsNiArOTcsNyBAQCBFWFRSQV9QUk9HUkFNUyA9IFwKICAgcHR4CQlcCiAgIHB3
ZAkJXAogICByZWFkbGluawlcCisgIHJlbmFtZQlcCiAgIHJtCQlcCiAgIHJtZGlyCQlcCiAgIHJ1
bmNvbglcCkBAIC0yNDgsNiArMjQ5LDcgQEAgcHR4X0xEQUREID0gJChMREFERCkKIHB3ZF9MREFE
RCA9ICQoTERBREQpCiByZWFkbGlua19MREFERCA9ICQoTERBREQpCiBybV9MREFERCA9ICQoTERB
REQpCityZW5hbWVfTERBREQgPSAkKExEQUREKQogcm1kaXJfTERBREQgPSAkKExEQUREKQogcnVu
Y29uX0xEQUREID0gJChMREFERCkKIHNlcV9MREFERCA9ICQoTERBREQpCkBAIC0zMDEsNiArMzAz
LDcgQEAgY29weV9MREFERCA9CiBjcF9MREFERCArPSAkKGNvcHlfTERBREQpCiBnaW5zdGFsbF9M
REFERCArPSAkKGNvcHlfTERBREQpCiBtdl9MREFERCArPSAkKGNvcHlfTERBREQpCityZW5hbWVf
TERBREQgKz0gJChjb3B5X0xEQUREKQogCiByZW1vdmVfTERBREQgPQogbXZfTERBREQgKz0gJChy
ZW1vdmVfTERBREQpCkBAIC00NzcsNiArNDgwLDcgQEAgdGltZW91dF9TT1VSQ0VTID0gdGltZW91
dC5jIG9wZXJhbmQyc2lnLmMKIAogbXZfU09VUkNFUyA9IG12LmMgcmVtb3ZlLmMgJChjb3B5X3Nv
dXJjZXMpCiBybV9TT1VSQ0VTID0gcm0uYyByZW1vdmUuYworcmVuYW1lX1NPVVJDRVMgPSByZW5h
bWUuYyAkKGNvcHlfc291cmNlcykKIAogbWtkaXJfU09VUkNFUyA9IG1rZGlyLmMgcHJvZy1mcHJp
bnRmLmMKIHJtZGlyX1NPVVJDRVMgPSBybWRpci5jIHByb2ctZnByaW50Zi5jCmRpZmYgLS1naXQg
YS9zcmMvcmVuYW1lLmMgYi9zcmMvcmVuYW1lLmMKbmV3IGZpbGUgbW9kZSAxMDA2NDQKaW5kZXgg
MDAwMDAwMC4uMDcyNjY3OAotLS0gL2Rldi9udWxsCisrKyBiL3NyYy9yZW5hbWUuYwpAQCAtMCww
ICsxLDI5MCBAQAorLyogcmVuYW1lIC0tIHJlbmFtZSBuYW1lcworICAgQ29weXJpZ2h0IChDKSAy
MDExLSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb24sIEluYy4KKworICAgVGhpcyBwcm9ncmFtIGlz
IGZyZWUgc29mdHdhcmU6IHlvdSBjYW4gcmVkaXN0cmlidXRlIGl0IGFuZC9vciBtb2RpZnkKKyAg
IGl0IHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UgYXMg
cHVibGlzaGVkIGJ5CisgICB0aGUgRnJlZSBTb2Z0d2FyZSBGb3VuZGF0aW9uLCBlaXRoZXIgdmVy
c2lvbiAzIG9mIHRoZSBMaWNlbnNlLCBvcgorICAgKGF0IHlvdXIgb3B0aW9uKSBhbnkgbGF0ZXIg
dmVyc2lvbi4KKworICAgVGhpcyBwcm9ncmFtIGlzIGRpc3RyaWJ1dGVkIGluIHRoZSBob3BlIHRo
YXQgaXQgd2lsbCBiZSB1c2VmdWwsCisgICBidXQgV0lUSE9VVCBBTlkgV0FSUkFOVFk7IHdpdGhv
dXQgZXZlbiB0aGUgaW1wbGllZCB3YXJyYW50eSBvZgorICAgTUVSQ0hBTlRBQklMSVRZIG9yIEZJ
VE5FU1MgRk9SIEEgUEFSVElDVUxBUiBQVVJQT1NFLiAgU2VlIHRoZQorICAgR05VIEdlbmVyYWwg
UHVibGljIExpY2Vuc2UgZm9yIG1vcmUgZGV0YWlscy4KKworICAgWW91IHNob3VsZCBoYXZlIHJl
Y2VpdmVkIGEgY29weSBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vuc2UKKyAgIGFsb25n
IHdpdGggdGhpcyBwcm9ncmFtLiAgSWYgbm90LCBzZWUgPGh0dHA6Ly93d3cuZ251Lm9yZy9saWNl
bnNlcy8+LiAgKi8KKworLyogV3JpdHRlbiBieSBhZWIoPykgMjAwMC0wMS0wMS4gVGhlIHV0aWxp
dHkgd2FzIHBhcnQgb2YgdXRpbC1saW51eCBwYWNrYWdlCisgICB5ZWFycyAyMDAwLTIwMTEuIFNh
bWkgS2Vyb2xhIG1hZGUgdGhlIHJlbmFtZSB0byBiZSBwYXJ0IG9mIGNvcmV1dGlscy4KKyAgIFJl
YXNvbiB0byBtb3ZlIHRoZSBjb21tYW5kIGJlIHBhcnQgb2Ygd2FzIHRvIHJldXNlIGZ1bmN0aW9u
YWxpdHkgdGhhdCBpcworICAgaW4gdXNlIGZvciBtdi4gKi8KKworLyogVE9ETzoKKyAgIG8gT3B0
aW9uIC1yIGZvciByZWN1cnNpdmUuCisgICBvIFJlbmFtZSBkZXN0aW5hdGlvbiBjYW4gYmUgYSBk
aXJlY3RvcnksIHdoaWNoIG5vdyBnaXZlczoKKyAgICAgcmVuYW1lOiBjYW5ub3Qgb3ZlcndyaXRl
IGRpcmVjdG9yeSBgYmFyMicgd2l0aCBub24tZGlyZWN0b3J5CisgICAgIFNob3VsZCB0aGUgZmls
ZSBiZSByZW5hbWVkIGFuZCBwdXQgdG8gZGlyZWN0b3J5PworICAgbyBXaGVuIHRoZSBkZXN0aW5h
dGlvbiBpcyBtb3VudCBwb2ludCBzb3VyY2UgZmlsZSBoYXMgdG8gYmUKKyAgICAgcmVtb3ZlZCwg
YXNzdW1pbmcgY29weSBpcyBzdWNjZXNzZnVsLiAqLworCisjaW5jbHVkZSA8Y29uZmlnLmg+Cisj
aW5jbHVkZSA8c3RkaW8uaD4KKyNpbmNsdWRlIDxzdHJpbmcuaD4KKyNpbmNsdWRlIDxzdGRsaWIu
aD4KKyNpbmNsdWRlIDxlcnJuby5oPgorI2luY2x1ZGUgPGdldG9wdC5oPgorI2luY2x1ZGUgPHNl
bGludXgvc2VsaW51eC5oPgorCisjaW5jbHVkZSAic3lzdGVtLmgiCisjaW5jbHVkZSAiYmFja3Vw
ZmlsZS5oIgorI2luY2x1ZGUgImNvcHkuaCIKKyNpbmNsdWRlICJjcC1oYXNoLmgiCisjaW5jbHVk
ZSAiZXJyb3IuaCIKKyNpbmNsdWRlICJxdW90ZS5oIgorCisvKiBUaGUgb2ZmaWNpYWwgbmFtZSBv
ZiB0aGlzIHByb2dyYW0gKGUuZy4sIG5vIGBnJyBwcmVmaXgpLiAgKi8KKyNkZWZpbmUgUFJPR1JB
TV9OQU1FICJyZW5hbWUiCisKKyNkZWZpbmUgQVVUSE9SUyBcCisgIHByb3Blcl9uYW1lICgiU2Ft
aSBLZXJvbGEiKQorCitzdGF0aWMgdm9pZAorY3Bfb3B0aW9uX2luaXQgKHN0cnVjdCBjcF9vcHRp
b25zICp4KQoreworICBib29sIHNlbGludXhfZW5hYmxlZCA9ICgwIDwgaXNfc2VsaW51eF9lbmFi
bGVkICgpKTsKKworICBjcF9vcHRpb25zX2RlZmF1bHQgKHgpOworICB4LT5jb3B5X2FzX3JlZ3Vs
YXIgPSBmYWxzZTsJLyogRklYTUU6IG1heWJlIG1ha2UgdGhpcyBhbiBvcHRpb24gKi8KKyAgeC0+
cmVmbGlua19tb2RlID0gUkVGTElOS19ORVZFUjsKKyAgeC0+ZGVyZWZlcmVuY2UgPSBERVJFRl9O
RVZFUjsKKyAgeC0+dW5saW5rX2Rlc3RfYmVmb3JlX29wZW5pbmcgPSBmYWxzZTsKKyAgeC0+dW5s
aW5rX2Rlc3RfYWZ0ZXJfZmFpbGVkX29wZW4gPSBmYWxzZTsKKyAgeC0+aGFyZF9saW5rID0gZmFs
c2U7CisgIHgtPmludGVyYWN0aXZlID0gSV9VTlNQRUNJRklFRDsKKyAgeC0+bW92ZV9tb2RlID0g
dHJ1ZTsKKyAgeC0+b25lX2ZpbGVfc3lzdGVtID0gZmFsc2U7CisgIHgtPnByZXNlcnZlX293bmVy
c2hpcCA9IHRydWU7CisgIHgtPnByZXNlcnZlX2xpbmtzID0gdHJ1ZTsKKyAgeC0+cHJlc2VydmVf
bW9kZSA9IHRydWU7CisgIHgtPnByZXNlcnZlX3RpbWVzdGFtcHMgPSB0cnVlOworICB4LT5wcmVz
ZXJ2ZV9zZWN1cml0eV9jb250ZXh0ID0gc2VsaW51eF9lbmFibGVkOworICB4LT5yZWR1Y2VfZGlh
Z25vc3RpY3MgPSBmYWxzZTsKKyAgeC0+ZGF0YV9jb3B5X3JlcXVpcmVkID0gdHJ1ZTsKKyAgeC0+
cmVxdWlyZV9wcmVzZXJ2ZSA9IGZhbHNlOwkvKiBGSVhNRTogbWF5YmUgbWFrZSB0aGlzIGFuIG9w
dGlvbiAqLworICB4LT5yZXF1aXJlX3ByZXNlcnZlX2NvbnRleHQgPSBmYWxzZTsKKyAgeC0+cHJl
c2VydmVfeGF0dHIgPSB0cnVlOworICB4LT5yZXF1aXJlX3ByZXNlcnZlX3hhdHRyID0gZmFsc2U7
CisgIHgtPnJlY3Vyc2l2ZSA9IHRydWU7CisgIHgtPnNwYXJzZV9tb2RlID0gU1BBUlNFX0FVVE87
CS8qIEZJWE1FOiBtYXliZSBtYWtlIHRoaXMgYW4gb3B0aW9uICovCisgIHgtPnN5bWJvbGljX2xp
bmsgPSBmYWxzZTsKKyAgeC0+c2V0X21vZGUgPSBmYWxzZTsKKyAgeC0+bW9kZSA9IDA7CisgIHgt
PnN0ZGluX3R0eSA9IGlzYXR0eSAoU1RESU5fRklMRU5PKTsKKworICB4LT5vcGVuX2RhbmdsaW5n
X2Rlc3Rfc3ltbGluayA9IGZhbHNlOworICB4LT51cGRhdGUgPSBmYWxzZTsKKyAgeC0+dmVyYm9z
ZSA9IGZhbHNlOworICB4LT5kZXN0X2luZm8gPSBOVUxMOworICB4LT5zcmNfaW5mbyA9IE5VTEw7
Cit9CisKK3N0YXRpYyBib29sCitkb19yZW5hbWUgKGNoYXIgKmV4cHJlc3Npb24sIGNoYXIgKnJl
cGxhY2VtZW50LCBjaGFyICpzb3VyY2UsCisJICAgc3RydWN0IGNwX29wdGlvbnMgKngpCit7Cisg
IGNoYXIgKmRlc3RpbmF0aW9uLCAqd2hlcmUsICphLCAqYjsKKyAgaW50IGVsZW4sIHJsZW4sIHNs
ZW47CisgIGJvb2wgY29weV9pbnRvX3NlbGY7CisgIGJvb2wgcmVuYW1lX3N1Y2NlZWRlZDsKKyAg
Ym9vbCBvazsKKworICB3aGVyZSA9IHN0cnN0ciAoc291cmNlLCBleHByZXNzaW9uKTsKKyAgaWYg
KHdoZXJlID09IE5VTEwpCisgICAgcmV0dXJuIGZhbHNlOworCisgIGVsZW4gPSBzdHJsZW4gKGV4
cHJlc3Npb24pOworICBybGVuID0gc3RybGVuIChyZXBsYWNlbWVudCk7CisgIHNsZW4gPSBzdHJs
ZW4gKHNvdXJjZSk7CisgIGRlc3RpbmF0aW9uID0geG1hbGxvYyAocmxlbiArIHNsZW4gKyAxKTsK
KworICBhID0gc291cmNlOworICBiID0gZGVzdGluYXRpb247CisgIHdoaWxlIChhIDwgd2hlcmUp
CisgICAgKmIrKyA9ICphKys7CisgIGEgPSByZXBsYWNlbWVudDsKKyAgd2hpbGUgKCphKQorICAg
ICpiKysgPSAqYSsrOworICBhID0gd2hlcmUgKyBlbGVuOworICB3aGlsZSAoKmEpCisgICAgKmIr
KyA9ICphKys7CisgICpiID0gMDsKKworICBvayA9CisgICAgY29weSAoc291cmNlLCBkZXN0aW5h
dGlvbiwgZmFsc2UsIHgsICZjb3B5X2ludG9fc2VsZiwgJnJlbmFtZV9zdWNjZWVkZWQpOworCisg
IGlmIChvaykKKyAgICB7CisgICAgICBpZiAoY29weV9pbnRvX3NlbGYpCisJeworCSAgLyogVGhl
IGxpa2VseSBjYXNlIGlzIHRoYXQgZXhwcmVzc2lvbiBhbmQgcmVwbGFjZW1lbnQgYXJlIHRoZSBz
YW1lCisJICAgICBzdHJpbmcuIE1heWJlIHRoaXMgc2hvdWxkIGJlIGRvbmUgc29tZSBiZXR0ZXIg
d2F5LiAqLworCSAgb2sgPSBmYWxzZTsKKwl9CisgICAgfQorCisgIGZyZWUgKGRlc3RpbmF0aW9u
KTsKKyAgcmV0dXJuIHRydWU7Cit9CisKK3ZvaWQKK3VzYWdlIChpbnQgc3RhdHVzKQoreworICBp
ZiAoc3RhdHVzICE9IEVYSVRfU1VDQ0VTUykKKyAgICBmcHJpbnRmIChzdGRlcnIsIF8oIlRyeSBg
JXMgLS1oZWxwJyBmb3IgbW9yZSBpbmZvcm1hdGlvbi5cbiIpLAorCSAgICAgcHJvZ3JhbV9uYW1l
KTsKKyAgZWxzZQorICAgIHsKKyAgICAgIHByaW50ZiAoXygiXAorVXNhZ2U6ICVzIFtPUFRJT05d
Li4uIEVYUFJFU1NJT04gUkVQTEFDRU1FTlQgRklMRS4uLlxuXAorIiksIHByb2dyYW1fbmFtZSk7
CisgICAgICBmcHV0cyAoXygiXAorUmVuYW1lIGZpcnN0IG9jY3VyZW5jZSBvZiBFWFBSRVNTSU9O
IGJ5IFJFUExBQ0VNRU5UIGluIEZJTEUgbmFtZS5cblwKK1xuXAorIiksIHN0ZG91dCk7CisgICAg
ICBmcHV0cyAoXygiXAorICAgICAgLS1iYWNrdXBbPUNPTlRST0xdICBtYWtlIGEgYmFja3VwIG9m
IGVhY2ggZXhpc3RpbmcgZGVzdGluYXRpb24gZmlsZVwKK1xuXAorICAtYiAgICAgICAgICAgICAg
ICAgICAgICBsaWtlIC0tYmFja3VwIGJ1dCBkb2VzIG5vdCBhY2NlcHQgYW4gYXJndW1lbnRcblwK
KyAgLWYsIC0tZm9yY2UgICAgICAgICAgICAgZG8gbm90IHByb21wdCBiZWZvcmUgb3ZlcndyaXRp
bmdcblwKKyAgLWksIC0taW50ZXJhY3RpdmUgICAgICAgcHJvbXB0IGJlZm9yZSBvdmVyd3JpdGVc
blwKKyAgLW4sIC0tbm8tY2xvYmJlciAgICAgICAgZG8gbm90IG92ZXJ3cml0ZSBhbiBleGlzdGlu
ZyBmaWxlXG5cCitJZiB5b3Ugc3BlY2lmeSBtb3JlIHRoYW4gb25lIG9mIC1pLCAtZiwgLW4sIG9u
bHkgdGhlIGZpbmFsIG9uZSB0YWtlcyBlZmZlY3QuXG5cCisgIC1TLCAtLXN1ZmZpeD1TVUZGSVgg
ICAgIG92ZXJyaWRlIHRoZSB1c3VhbCBiYWNrdXAgc3VmZml4XG5cCisgIC12LCAtLXZlcmJvc2Ug
ICAgICAgICAgIGV4cGxhaW4gd2hhdCBpcyBiZWluZyBkb25lXG5cCisiKSwgc3Rkb3V0KTsKKyAg
ICAgIGZwdXRzIChIRUxQX09QVElPTl9ERVNDUklQVElPTiwgc3Rkb3V0KTsKKyAgICAgIGZwdXRz
IChWRVJTSU9OX09QVElPTl9ERVNDUklQVElPTiwgc3Rkb3V0KTsKKyAgICAgIGZwdXRzIChfKCJc
CitcblwKK1RoZSBiYWNrdXAgc3VmZml4IGlzIGB+JywgdW5sZXNzIHNldCB3aXRoIC0tc3VmZml4
IG9yIFNJTVBMRV9CQUNLVVBfU1VGRklYLlxuXAorVGhlIHZlcnNpb24gY29udHJvbCBtZXRob2Qg
bWF5IGJlIHNlbGVjdGVkIHZpYSB0aGUgLS1iYWNrdXAgb3B0aW9uIG9yIHRocm91Z2hcblwKK3Ro
ZSBWRVJTSU9OX0NPTlRST0wgZW52aXJvbm1lbnQgdmFyaWFibGUuICBIZXJlIGFyZSB0aGUgdmFs
dWVzOlxuXAorXG5cCisiKSwgc3Rkb3V0KTsKKyAgICAgIGZwdXRzIChfKCJcCisgIG5vbmUsIG9m
ZiAgICAgICBuZXZlciBtYWtlIGJhY2t1cHMgKGV2ZW4gaWYgLS1iYWNrdXAgaXMgZ2l2ZW4pXG5c
CisgIG51bWJlcmVkLCB0ICAgICBtYWtlIG51bWJlcmVkIGJhY2t1cHNcblwKKyAgZXhpc3Rpbmcs
IG5pbCAgIG51bWJlcmVkIGlmIG51bWJlcmVkIGJhY2t1cHMgZXhpc3QsIHNpbXBsZSBvdGhlcndp
c2VcblwKKyAgc2ltcGxlLCBuZXZlciAgIGFsd2F5cyBtYWtlIHNpbXBsZSBiYWNrdXBzXG5cCisi
KSwgc3Rkb3V0KTsKKyAgICAgIGVtaXRfYW5jaWxsYXJ5X2luZm8gKCk7CisgICAgfQorICBleGl0
IChzdGF0dXMpOworfQorCitpbnQKK21haW4gKGludCBhcmdjLCBjaGFyICoqYXJndikKK3sKKyAg
aW50IGksIGM7CisgIGJvb2wgbWFrZV9iYWNrdXBzID0gZmFsc2U7CisgIGNoYXIgKmJhY2t1cF9z
dWZmaXhfc3RyaW5nOworICBjaGFyICp2ZXJzaW9uX2NvbnRyb2xfc3RyaW5nID0gTlVMTDsKKyAg
c3RydWN0IGNwX29wdGlvbnMgeDsKKyAgY2hhciAqZXhwcmVzc2lvbiwgKnJlcGxhY2VtZW50Owor
ICBpbnQgbl9hcmd1bWVudHM7CisgIGNoYXIgKiphcmd1bWVudDsKKyAgYm9vbCBvazsKKworICBz
dGF0aWMgY29uc3Qgc3RydWN0IG9wdGlvbiBsb25nb3B0c1tdID0geworICAgIHsiYmFja3VwIiwg
b3B0aW9uYWxfYXJndW1lbnQsIE5VTEwsICdiJ30sCisgICAgeyJmb3JjZSIsIG5vX2FyZ3VtZW50
LCBOVUxMLCAnZid9LAorICAgIHsiaW50ZXJhY3RpdmUiLCBub19hcmd1bWVudCwgTlVMTCwgJ2kn
fSwKKyAgICB7Im5vLWNsb2JiZXIiLCBub19hcmd1bWVudCwgTlVMTCwgJ24nfSwKKyAgICB7InN1
ZmZpeCIsIHJlcXVpcmVkX2FyZ3VtZW50LCBOVUxMLCAnUyd9LAorICAgIHsidmVyYm9zZSIsIG5v
X2FyZ3VtZW50LCBOVUxMLCAndid9LAorICAgIHtHRVRPUFRfSEVMUF9PUFRJT05fREVDTH0sCisg
ICAge0dFVE9QVF9WRVJTSU9OX09QVElPTl9ERUNMfSwKKyAgICB7TlVMTCwgMCwgTlVMTCwgMH0K
KyAgfTsKKworICBpbml0aWFsaXplX21haW4gKCZhcmdjLCAmYXJndik7CisgIHNldF9wcm9ncmFt
X25hbWUgKGFyZ3ZbMF0pOworICBzZXRsb2NhbGUgKExDX0FMTCwgIiIpOworICBiaW5kdGV4dGRv
bWFpbiAoUEFDS0FHRSwgTE9DQUxFRElSKTsKKyAgdGV4dGRvbWFpbiAoUEFDS0FHRSk7CisKKyAg
YXRleGl0IChjbG9zZV9zdGRpbik7CisKKyAgY3Bfb3B0aW9uX2luaXQgKCZ4KTsKKworICAvKiBG
SVhNRTogY29uc2lkZXIgbm90IGNhbGxpbmcgZ2V0ZW52IGZvciBTSU1QTEVfQkFDS1VQX1NVRkZJ
WCB1bmxlc3MKKyAgICAgd2UnbGwgYWN0dWFsbHkgdXNlIGJhY2t1cF9zdWZmaXhfc3RyaW5nLiAg
Ki8KKyAgYmFja3VwX3N1ZmZpeF9zdHJpbmcgPSBnZXRlbnYgKCJTSU1QTEVfQkFDS1VQX1NVRkZJ
WCIpOworCisgIHdoaWxlICgoYyA9IGdldG9wdF9sb25nIChhcmdjLCBhcmd2LCAiYmZpblM6diIs
IGxvbmdvcHRzLCBOVUxMKSkgIT0gLTEpCisgICAgeworICAgICAgc3dpdGNoIChjKQorCXsKKwlj
YXNlICdiJzoKKwkgIG1ha2VfYmFja3VwcyA9IHRydWU7CisJICBpZiAob3B0YXJnKQorCSAgICB2
ZXJzaW9uX2NvbnRyb2xfc3RyaW5nID0gb3B0YXJnOworCSAgYnJlYWs7CisJY2FzZSAnZic6CisJ
ICB4LmludGVyYWN0aXZlID0gSV9BTFdBWVNfWUVTOworCSAgYnJlYWs7CisJY2FzZSAnaSc6CisJ
ICB4LmludGVyYWN0aXZlID0gSV9BU0tfVVNFUjsKKwkgIGJyZWFrOworCWNhc2UgJ24nOgorCSAg
eC5pbnRlcmFjdGl2ZSA9IElfQUxXQVlTX05POworCSAgYnJlYWs7CisJY2FzZSAndic6CisJICB4
LnZlcmJvc2UgPSB0cnVlOworCSAgYnJlYWs7CisJY2FzZSAnUyc6CisJICBtYWtlX2JhY2t1cHMg
PSB0cnVlOworCSAgYmFja3VwX3N1ZmZpeF9zdHJpbmcgPSBvcHRhcmc7CisJICBicmVhazsKKwor
CSAgY2FzZV9HRVRPUFRfSEVMUF9DSEFSOworCSAgY2FzZV9HRVRPUFRfVkVSU0lPTl9DSEFSIChQ
Uk9HUkFNX05BTUUsIEFVVEhPUlMpOworCWRlZmF1bHQ6CisJICB1c2FnZSAoRVhJVF9GQUlMVVJF
KTsKKwl9CisgICAgfQorCisgIG5fYXJndW1lbnRzID0gYXJnYyAtIG9wdGluZDsKKyAgYXJndW1l
bnQgPSBhcmd2ICsgb3B0aW5kOworCisgIGlmIChtYWtlX2JhY2t1cHMgJiYgeC5pbnRlcmFjdGl2
ZSA9PSBJX0FMV0FZU19OTykKKyAgICB7CisgICAgICBlcnJvciAoMCwgMCwKKwkgICAgIF8oIm9w
dGlvbnMgLS1iYWNrdXAgYW5kIC0tbm8tY2xvYmJlciBhcmUgbXV0dWFsbHkgZXhjbHVzaXZlIikp
OworICAgICAgdXNhZ2UgKEVYSVRfRkFJTFVSRSk7CisgICAgfQorCisgIGlmIChiYWNrdXBfc3Vm
Zml4X3N0cmluZykKKyAgICBzaW1wbGVfYmFja3VwX3N1ZmZpeCA9IHhzdHJkdXAgKGJhY2t1cF9z
dWZmaXhfc3RyaW5nKTsKKworICB4LmJhY2t1cF90eXBlID0gKG1ha2VfYmFja3VwcworCQkgICA/
IHhnZXRfdmVyc2lvbiAoXygiYmFja3VwIHR5cGUiKSwKKwkJCQkgICB2ZXJzaW9uX2NvbnRyb2xf
c3RyaW5nKSA6IG5vX2JhY2t1cHMpOworCisgIGhhc2hfaW5pdCAoKTsKKworICBpZiAobl9hcmd1
bWVudHMgPCAzKQorICAgIHsKKyAgICAgIGVycm9yICgwLCAwLCBfKCJub3QgZW5vdWdoIGFyZ3Vt
ZW50cyIpKTsKKyAgICAgIHVzYWdlIChFWElUX0ZBSUxVUkUpOworICAgIH0KKworICBleHByZXNz
aW9uID0gYXJndW1lbnRbMF07CisgIHJlcGxhY2VtZW50ID0gYXJndW1lbnRbMV07CisKKyAgb2sg
PSB0cnVlOworICBmb3IgKGkgPSAyOyBpIDwgbl9hcmd1bWVudHM7IGkrKykKKyAgICBvayAmPSBk
b19yZW5hbWUgKGV4cHJlc3Npb24sIHJlcGxhY2VtZW50LCBhcmd1bWVudFtpXSwgJngpOworCisg
IGV4aXQgKG9rID8gRVhJVF9TVUNDRVNTIDogRVhJVF9GQUlMVVJFKTsKK30KZGlmZiAtLWdpdCBh
L3Rlc3RzL01ha2VmaWxlLmFtIGIvdGVzdHMvTWFrZWZpbGUuYW0KaW5kZXggZjhmYmQzOC4uYjQz
ZTZiYyAxMDA2NDQKLS0tIGEvdGVzdHMvTWFrZWZpbGUuYW0KKysrIGIvdGVzdHMvTWFrZWZpbGUu
YW0KQEAgLTIxOSw2ICsyMTksNyBAQCBURVNUUyA9CQkJCQkJXAogICBtaXNjL3ByaW50Zi1zdXJw
cmlzZQkJCQlcCiAgIG1pc2MvcHdkLWxvbmcJCQkJCVwKICAgbWlzYy9yZWFkbGluay1mcC1sb29w
CQkJCVwKKyAgbWlzYy9yZW5hbWUtZm9vMmJhcgkJCQlcCiAgIG1pc2MvcnVuY29uLW5vLXJlb3Jk
ZXIJCQlcCiAgIG1pc2Mvc2hhMXN1bQkJCQkJXAogICBtaXNjL3NoYTFzdW0tdmVjCQkJCVwKZGlm
ZiAtLWdpdCBhL3Rlc3RzL21pc2MvcmVuYW1lLWZvbzJiYXIgYi90ZXN0cy9taXNjL3JlbmFtZS1m
b28yYmFyCm5ldyBmaWxlIG1vZGUgMTAwNzU1CmluZGV4IDAwMDAwMDAuLjZhYTg1OGEKLS0tIC9k
ZXYvbnVsbAorKysgYi90ZXN0cy9taXNjL3JlbmFtZS1mb28yYmFyCkBAIC0wLDAgKzEsMzAgQEAK
KyMhL2Jpbi9zaAorIyB0ZXN0IHJlbmFtZSBiYXNpYyBmdW5jdGlvbmFsaXR5CisKKyMgQ29weXJp
Z2h0IChDKSAyMDExIEZyZWUgU29mdHdhcmUgRm91bmRhdGlvbiwgSW5jLgorCisjIFRoaXMgcHJv
Z3JhbSBpcyBmcmVlIHNvZnR3YXJlOiB5b3UgY2FuIHJlZGlzdHJpYnV0ZSBpdCBhbmQvb3IgbW9k
aWZ5CisjIGl0IHVuZGVyIHRoZSB0ZXJtcyBvZiB0aGUgR05VIEdlbmVyYWwgUHVibGljIExpY2Vu
c2UgYXMgcHVibGlzaGVkIGJ5CisjIHRoZSBGcmVlIFNvZnR3YXJlIEZvdW5kYXRpb24sIGVpdGhl
ciB2ZXJzaW9uIDMgb2YgdGhlIExpY2Vuc2UsIG9yCisjIChhdCB5b3VyIG9wdGlvbikgYW55IGxh
dGVyIHZlcnNpb24uCisKKyMgVGhpcyBwcm9ncmFtIGlzIGRpc3RyaWJ1dGVkIGluIHRoZSBob3Bl
IHRoYXQgaXQgd2lsbCBiZSB1c2VmdWwsCisjIGJ1dCBXSVRIT1VUIEFOWSBXQVJSQU5UWTsgd2l0
aG91dCBldmVuIHRoZSBpbXBsaWVkIHdhcnJhbnR5IG9mCisjIE1FUkNIQU5UQUJJTElUWSBvciBG
SVRORVNTIEZPUiBBIFBBUlRJQ1VMQVIgUFVSUE9TRS4gIFNlZSB0aGUKKyMgR05VIEdlbmVyYWwg
UHVibGljIExpY2Vuc2UgZm9yIG1vcmUgZGV0YWlscy4KKworIyBZb3Ugc2hvdWxkIGhhdmUgcmVj
ZWl2ZWQgYSBjb3B5IG9mIHRoZSBHTlUgR2VuZXJhbCBQdWJsaWMgTGljZW5zZQorIyBhbG9uZyB3
aXRoIHRoaXMgcHJvZ3JhbS4gIElmIG5vdCwgc2VlIDxodHRwOi8vd3d3LmdudS5vcmcvbGljZW5z
ZXMvPi4KKworLiAiJHtzcmNkaXI9Ln0vaW5pdC5zaCI7IHBhdGhfcHJlcGVuZF8gLi4vc3JjCitw
cmludF92ZXJfIHJlbmFtZQorCitmb3IgaSBpbiBmb28xIGZvbzIgOyBkbworICBlY2hvIGEgPiAk
aSB8fCBmcmFtZXdvcmtfZmFpbHVyZQorZG9uZQorCityZW5hbWUgZm9vIGJhciBmb28/IDI+L2Rl
di9udWxsIHx8IGZhaWw9MQordGVzdCAtZiBiYXIxIHx8IGZhaWw9MQordGVzdCAtZiBiYXIyIHx8
IGZhaWw9MQorCitFeGl0ICRmYWlsCi0tIAoxLjcuNS4yCgo=
--00235452ffec21cbaa04a6adeef4--


From MAILER-DAEMON Mon Jun 27 08:53:52 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QbBK3-0000st-PK
	for mharc-coreutils@gnu.org; Mon, 27 Jun 2011 08:53:51 -0400
Received: from eggs.gnu.org ([140.186.70.92]:58743)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QbBJy-0000ry-H2
	for coreutils@gnu.org; Mon, 27 Jun 2011 08:53:47 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QbBJw-000653-M3
	for coreutils@gnu.org; Mon, 27 Jun 2011 08:53:46 -0400
Received: from mx1.redhat.com ([209.132.183.28]:44978)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QbBJw-00064z-5N
	for coreutils@gnu.org; Mon, 27 Jun 2011 08:53:44 -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 p5RCrgeh008657
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <coreutils@gnu.org>; Mon, 27 Jun 2011 08:53:42 -0400
Received: from [10.3.113.74] (ovpn-113-74.phx2.redhat.com [10.3.113.74])
	by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP
	id p5RCrgon012728
	for <coreutils@gnu.org>; Mon, 27 Jun 2011 08:53:42 -0400
Message-ID: <4E087D50.60401@redhat.com>
Date: Mon, 27 Jun 2011 06:53:36 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14
	Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10
MIME-Version: 1.0
To: coreutils@gnu.org
Subject: Re: Feature Request for 'sort' utility
References: <BANLkTimC5Ur_LngQW35TY1x6NPk_TDSkqA@mail.gmail.com>
	<20110627000529.GA31433@hysteria.proulx.com>
In-Reply-To: <20110627000529.GA31433@hysteria.proulx.com>
X-Enigmail-Version: 1.1.2
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="------------enig918C0CE3481384915BD06679"
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, 27 Jun 2011 12:53:48 -0000

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

On 06/26/2011 06:05 PM, Bob Proulx wrote:
> scott n-h wrote:
>> -I or --ip-address
>> I'm hoping the usefulness of this would be apparent.
>=20
> The coreutils manual:
>=20
>   http://www.gnu.org/software/coreutils/manual/html_node/sort-invocatio=
n.html#sort-invocation
>=20
> Shows an example of sorting IPv4 addresses this way:
>=20
>   sort -s -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n

However, there's no easy way to sort IPv6 addresses using existing sort
keys, so maybe there is indeed room for improvement, if someone would
care to contribute code.

--=20
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


--------------enig918C0CE3481384915BD06679
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.11 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJOCH1VAAoJEKeha0olJ0NqDscH/jCbolyKTBcGJ7btaBPGldb1
GLoH7x2QY9jRl9uHxabG6zUmOpNs6dijtuB9ejNm9aoM4r75mTr5K99Vh+Tj+eCa
mm/e0Cf+QIU3vId2qBQ0HNdcZNYV9PkEV4gNWHv1+Z8Y975O+wVLgUIiTX5wn5sx
mQM9tY87Tbrw3IjV6R0y4LfuvA0LadSQgXoGV0dsZ74E/Gdwjv2HVCS9jQqOsKlr
OPAdOiWQxIEb47Z+Aebvls2UEnHEV5Pcc/AFWPXaVTFq68nHDMX4sSHJvT4R5nWG
cntp+2uPZ6CiXywJ0UygiqrrPHZznzt7l1KrxOGxcWJ/DV3RXip/KT/+WhXwr9Y=
=J9et
-----END PGP SIGNATURE-----

--------------enig918C0CE3481384915BD06679--


From MAILER-DAEMON Mon Jun 27 10:34:39 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QbCta-00081f-EY
	for mharc-coreutils@gnu.org; Mon, 27 Jun 2011 10:34:38 -0400
Received: from eggs.gnu.org ([140.186.70.92]:36689)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1QbCtX-00080p-Sd
	for coreutils@gnu.org; Mon, 27 Jun 2011 10:34:37 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1QbCtW-0005rk-0M
	for coreutils@gnu.org; Mon, 27 Jun 2011 10:34:35 -0400
Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]:17242)
	by eggs.gnu.org with smtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1QbCtV-0005r5-9F
	for coreutils@gnu.org; Mon, 27 Jun 2011 10:34:33 -0400
Received: (qmail 54442 invoked from network); 27 Jun 2011 14:34:30 -0000
Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218)
	by mail1.slb.deg.dub.stisp.net with SMTP; 27 Jun 2011 14:34:30 -0000
Message-ID: <4E0894D9.3020505@draigBrady.com>
Date: Mon, 27 Jun 2011 15:34:01 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US;
	rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3
MIME-Version: 1.0
To: Eric Blake <eblake@redhat.com>
Subject: Re: Feature Request for 'sort' utility
References: <BANLkTimC5Ur_LngQW35TY1x6NPk_TDSkqA@mail.gmail.com>	<20110627000529.GA31433@hysteria.proulx.com>
	<4E087D50.60401@redhat.com>
In-Reply-To: <4E087D50.60401@redhat.com>
X-Enigmail-Version: 1.0.1
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9
X-Received-From: 84.203.253.98
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, 27 Jun 2011 14:34:37 -0000

On 27/06/11 13:53, Eric Blake wrote:
> On 06/26/2011 06:05 PM, Bob Proulx wrote:
>> scott n-h wrote:
>>> -I or --ip-address
>>> I'm hoping the usefulness of this would be apparent.
>>
>> The coreutils manual:
>>
>>   http://www.gnu.org/software/coreutils/manual/html_node/sort-invocation.html#sort-invocation
>>
>> Shows an example of sorting IPv4 addresses this way:
>>
>>   sort -s -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n
> 
> However, there's no easy way to sort IPv6 addresses using existing sort
> keys, so maybe there is indeed room for improvement, if someone would
> care to contribute code.
> 

Well the argument here is whether IP addresses are
a fundamental enough type to support directly within sort,
or whether using the Decorate Sort Undecorate pattern is more appropriate.

Here is an example of using DSU with funcpy¹
which handles the various formats IPV6 addresses can be in:

printf '%s\n' ::03 ::2 ::1 |
funcpy --import socket,struct "
':'.join('%04x' % x for x in
  struct.unpack('>HHHHHHHH',
    socket.inet_pton(socket.AF_INET6,
      x.split()[0])))+'\t'+x
" | sort | cut -f2-

While being more general, this is fairly awkward.
Also there is a binary to ascii step that would
not be required if done internally.
I guess if we were supporting this we'd use the 'I' option.
I'm 50:50 on adding this though, as I'm not
sure how common it is to need to sort IP addresses?

cheers,
Pádraig.

¹ http://www.pixelbeat.org/scripts/funcpy


From MAILER-DAEMON Mon Jun 27 12:27:27 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QbEek-0005Xa-Ly
	for mharc-coreutils@gnu.org; Mon, 27 Jun 2011 12:27:26 -0400
Received: from eggs.gnu.org ([140.186.70.92]:54875)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1QbEeg-0005Wa-Qc
	for coreutils@gnu.org; Mon, 27 Jun 2011 12:27:24 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1QbEed-0008QC-Tp
	for coreutils@gnu.org; Mon, 27 Jun 2011 12:27:22 -0400
Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]:2204)
	by eggs.gnu.org with smtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1QbEed-0008Q3-EA
	for coreutils@gnu.org; Mon, 27 Jun 2011 12:27:19 -0400
Received: (qmail 77141 invoked from network); 27 Jun 2011 16:27:17 -0000
Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218)
	by mail1.slb.deg.dub.stisp.net with SMTP; 27 Jun 2011 16:27:17 -0000
Message-ID: <4E08AF48.9010008@draigBrady.com>
Date: Mon, 27 Jun 2011 17:26:48 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US;
	rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3
MIME-Version: 1.0
To: kerolasa@gmail.com
Subject: Re: rename command
References: <BANLkTimnRiDUcE=UnyTXMEKjL9NA7yk5fA@mail.gmail.com>
In-Reply-To: <BANLkTimnRiDUcE=UnyTXMEKjL9NA7yk5fA@mail.gmail.com>
X-Enigmail-Version: 1.0.1
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9
X-Received-From: 84.203.253.98
Cc: Sami Kerola <kerolasa@iki.fi>, 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, 27 Jun 2011 16:27:24 -0000

On 27/06/11 10:11, Sami Kerola wrote:
> Hello coreutilitarians,
> 
> I have been lately making some util-linux patches and while doing
> so I found rename command. It did not take long to realize that
> the command would be much better if it would support similar
> switches as mv. To accomplish that reusing gnulib copy
> functionality felt correct to me, but that is a problem within
> context of util-linux package, it does not use gnulib and I do
> not think it will have anytime soon. I proposed to move rename in
> util-linux mail list from util-linux to coreutils package, and
> Karel Zak, current util-linux maintainer, responded 'go ahead and
> ask at coreutils mailing list'.
> 
> So here we are, would it sound reasonable to take rename command
> to be part of coreutils?

Well it's not linux specific.
So I suppose it fits more here, than in util-linux.

I've never used rename actually, instead using find | sed | sh
in the rare times I've had to do something like this.
I find that easier and more general, for lower casing etc.
That is a process per file though.

Anyway, I see you're adding these options,
to better handle existing files.

+      fputs (_("\
+      --backup[=CONTROL]  make a backup of each existing destination file\
+\n\
+  -b                      like --backup but does not accept an argument\n\
+  -f, --force             do not prompt before overwriting\n\
+  -i, --interactive       prompt before overwrite\n\
+  -n, --no-clobber        do not overwrite an existing file\n\
+If you specify more than one of -i, -f, -n, only the final one takes effect.\n\
+  -S, --suffix=SUFFIX     override the usual backup suffix\n\
+  -v, --verbose           explain what is being done\n\

> To be a bit more concrete I wrote first version of patch. While
> the patch is nearly good there are issues. For instance
> tests/misc/help-version is failing, and I my attempt to fix that
> was unsuccessful. The command itself poses few implementation
> questions. Should rename support recursion

maybe.

> and should the rename
> move files across directories (IMHO that would be unintuitive)?

maybe not.

--- a/AUTHORS
+++ b/AUTHORS
@@ -62,6 +62,7 @@ printf: David MacKenzie
 ptx: François Pinard
 pwd: Jim Meyering
 readlink: Dmitry V. Levin
+rename: aeb(?), Sami Kerola

Andries Brouwer


+* rename invocation::            Rename multiple files by using pattern

s/by using pattern/using a pattern/ (in NEWS and info)

sorry I've not time to review fully,

cheers,
Pádraig.


From MAILER-DAEMON Mon Jun 27 13:10:48 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QbFKh-00005q-Ro
	for mharc-coreutils@gnu.org; Mon, 27 Jun 2011 13:10:48 -0400
Received: from eggs.gnu.org ([140.186.70.92]:41896)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1QbFKe-0008WQ-LV
	for coreutils@gnu.org; Mon, 27 Jun 2011 13:10:45 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1QbFKc-0007Se-WF
	for coreutils@gnu.org; Mon, 27 Jun 2011 13:10:44 -0400
Received: from mail-gx0-f169.google.com ([209.85.161.169]:56373)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <pengyu.ut@gmail.com>) id 1QbFKb-0007Rw-OJ
	for coreutils@gnu.org; Mon, 27 Jun 2011 13:10:42 -0400
Received: by gxk23 with SMTP id 23so2637148gxk.0
	for <coreutils@gnu.org>; Mon, 27 Jun 2011 10:10:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:date:message-id:subject:from:to
	:content-type; bh=d3GGXrCj23YFqpCpIUTfzVE9xzizeTSYr01GtelYurk=;
	b=n2aFxPSDGKbOgJ0XS149OjUP5wUyebgvRetE6XR8OtXyzUqxybqo81GB6vZ9FHsfZA
	ktGwSVa+PWPLKHvfR297L1Q4N/0fGJViRHlQm8I6Id7xEiJg8bO/TPdc0Il/SoXtTze+
	Fz/atQW5nmKTczkCtMvg8g4vfcHoXRjt1t1kg=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	b=FisPPT0WTFXnbQ4363zolv/BHd5cY+VB1SFkUzaog36SEkK6aDY3jb3ym6tpgqgO1j
	Rv3yEhqFQiL0P+drXuIOuJPf9w6Dk2WoV1Lw2PWgQ86TlgwRVRLgaDNGycEZAPeV87Hw
	URMMoTx46zwaN6ucgqNO7HEkp/iRzXnyO7VaM=
MIME-Version: 1.0
Received: by 10.236.184.105 with SMTP id r69mr9840392yhm.179.1309194639964;
	Mon, 27 Jun 2011 10:10:39 -0700 (PDT)
Received: by 10.236.106.38 with HTTP; Mon, 27 Jun 2011 10:10:39 -0700 (PDT)
Date: Mon, 27 Jun 2011 12:10:39 -0500
Message-ID: <BANLkTinOXSCc_h5PTYZTZREymocSii6R5g@mail.gmail.com>
Subject: sort's --key argument
From: Peng Yu <pengyu.ut@gmail.com>
To: coreutils@gnu.org
Content-Type: text/plain; charset=ISO-8859-1
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.161.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: Mon, 27 Jun 2011 17:10:46 -0000

Hi,

I want to sort by the 2nd column (see the 2nd command). But it seems
that it still sorts by the second column then by the first column.
Does anybody know how --key works?

$ cat input.txt
u a
c c
a a
e e
p a
m e
a a
l e
a a
$sort --key=2,2 input.txt
a a
a a
a a
p a
u a
c c
e e
l e
m e
$sort --key=2,2 --key=1,1 input.txt
a a
a a
a a
p a
u a
c c
e e
l e
m e
$ sort --version
sort (GNU coreutils) 7.4
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and Paul Eggert.

-- 
Regards,
Peng


From MAILER-DAEMON Mon Jun 27 14:24:29 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QbGU0-0002mm-8U
	for mharc-coreutils@gnu.org; Mon, 27 Jun 2011 14:24:28 -0400
Received: from eggs.gnu.org ([140.186.70.92]:41982)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <davidleothomas@gmail.com>) id 1QbGTw-0002lp-RJ
	for coreutils@gnu.org; Mon, 27 Jun 2011 14:24:26 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <davidleothomas@gmail.com>) id 1QbGTu-0003IP-Bh
	for coreutils@gnu.org; Mon, 27 Jun 2011 14:24:24 -0400
Received: from mail-pz0-f51.google.com ([209.85.210.51]:50929)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <davidleothomas@gmail.com>) id 1QbGTt-0003IE-TX
	for coreutils@gnu.org; Mon, 27 Jun 2011 14:24:22 -0400
Received: by pzk26 with SMTP id 26so3312263pzk.38
	for <coreutils@gnu.org>; Mon, 27 Jun 2011 11:24:20 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:in-reply-to:references:date
	:message-id:subject:from:to:cc:content-type;
	bh=dpwPrq6xWjumR0kJdZJZ19jRoeMx3z/JlDKczJ9S8Z4=;
	b=mcrNbYGfLIlEAW0Wp3KrxbiqAFeeuegQkgTUZbYE14r3oXf4pM2fWUSQ7vjyHJ71kT
	Ol39U6tSv9uVPuE+fn62GTPY/TJVAjPjrQwQ48f1bVKpp03KsPx6scCG4qBIDGOd+WRG
	6l2EVuT11ORrhP210eLKJLgA6gRNf4ODqAWZU=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	b=jADAb1CMS4uCgxWbTe+EoHJCp64LrlRELsTNSg6S3a1K8LilSTIVe4YwwlIAWTUmLB
	8aWnfYMV27ZEuQfXIWIDf7Cd4IeWMQVySrGdDOCDHCtgV/e60Yi5Ns0ubFw0g+hN0DQZ
	TbML2jYmDWWkQ4jsvIXoSEK1TXS+Q9sbeQ3SE=
MIME-Version: 1.0
Received: by 10.68.8.136 with SMTP id r8mr3204045pba.498.1309199060194; Mon,
	27 Jun 2011 11:24:20 -0700 (PDT)
Received: by 10.68.62.71 with HTTP; Mon, 27 Jun 2011 11:24:20 -0700 (PDT)
In-Reply-To: <BANLkTinOXSCc_h5PTYZTZREymocSii6R5g@mail.gmail.com>
References: <BANLkTinOXSCc_h5PTYZTZREymocSii6R5g@mail.gmail.com>
Date: Mon, 27 Jun 2011 11:24:20 -0700
Message-ID: <BANLkTi=FHqmxn-+WqVZGfhOgecA7g+2oSg@mail.gmail.com>
Subject: Re: sort's --key argument
From: David Thomas <davidleothomas@gmail.com>
To: Peng Yu <pengyu.ut@gmail.com>
Content-Type: text/plain; charset=ISO-8859-1
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.210.51
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, 27 Jun 2011 18:24:26 -0000

I believe you want --stable.

On Mon, Jun 27, 2011 at 10:10 AM, Peng Yu <pengyu.ut@gmail.com> wrote:
> Hi,
>
> I want to sort by the 2nd column (see the 2nd command). But it seems
> that it still sorts by the second column then by the first column.
> Does anybody know how --key works?
>
> $ cat input.txt
> u a
> c c
> a a
> e e
> p a
> m e
> a a
> l e
> a a
> $sort --key=2,2 input.txt
> a a
> a a
> a a
> p a
> u a
> c c
> e e
> l e
> m e
> $sort --key=2,2 --key=1,1 input.txt
> a a
> a a
> a a
> p a
> u a
> c c
> e e
> l e
> m e
> $ sort --version
> sort (GNU coreutils) 7.4
> Copyright (C) 2009 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
>
> Written by Mike Haertel and Paul Eggert.
>
> --
> Regards,
> Peng
>
>


From MAILER-DAEMON Mon Jun 27 14:31:34 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QbGar-0004b3-Pr
	for mharc-coreutils@gnu.org; Mon, 27 Jun 2011 14:31:34 -0400
Received: from eggs.gnu.org ([140.186.70.92]:40765)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kerolasa@gmail.com>) id 1QbGao-0004aF-RR
	for coreutils@gnu.org; Mon, 27 Jun 2011 14:31:32 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <kerolasa@gmail.com>) id 1QbGam-0004dc-Ft
	for coreutils@gnu.org; Mon, 27 Jun 2011 14:31:30 -0400
Received: from mail-qw0-f41.google.com ([209.85.216.41]:43478)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kerolasa@gmail.com>) id 1QbGam-0004dF-0W
	for coreutils@gnu.org; Mon, 27 Jun 2011 14:31:28 -0400
Received: by qwa26 with SMTP id 26so3298164qwa.0
	for <coreutils@gnu.org>; Mon, 27 Jun 2011 11:31:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=domainkey-signature:mime-version:reply-to:sender:in-reply-to
	:references:date:x-google-sender-auth:message-id:subject:from:to:cc
	:content-type:content-transfer-encoding;
	bh=MpVny++X3MTepabBKP11+l7vkKDdXd2upPwJr/iq1U0=;
	b=QYaPtyp5gfPq329rIP4j5TaPEsZunvzBm478LqUETeioGtPCcO3eb3LTGlwFQ+oqtW
	9H2fsWWDi/cBMnFmoL/hcEXIbmuMA/Zv1taqq6nN/RVyEMxWvRZAogc1/jytIWvPo/J0
	t9/IRIpMKNZZNsWwS8fIseAIREJ3eACHYl0Oc=
DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;
	h=mime-version:reply-to:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	b=ZC7vS+YDbkPzc6WEZsS+A6XXdLcZx0f5a3MEBl1KG61ht0dLdIcqx67q3SI0HlqjAR
	Gqbzc/L304qpzUy+GqrZxbdxvrjNcvl5JNW9pMiX3YoXjXr0OrJlnX6FA+Bf4Ma/pUkZ
	pPFmtCqH49r1tHhk6QXbMM7CZxqUAxi42cE6M=
MIME-Version: 1.0
Received: by 10.229.137.19 with SMTP id u19mr4805397qct.173.1309199486819;
	Mon, 27 Jun 2011 11:31:26 -0700 (PDT)
Sender: kerolasa@gmail.com
Received: by 10.229.107.15 with HTTP; Mon, 27 Jun 2011 11:31:26 -0700 (PDT)
In-Reply-To: <4E08AF48.9010008@draigBrady.com>
References: <BANLkTimnRiDUcE=UnyTXMEKjL9NA7yk5fA@mail.gmail.com>
	<4E08AF48.9010008@draigBrady.com>
Date: Mon, 27 Jun 2011 20:31:26 +0200
X-Google-Sender-Auth: SRXm6BW2UX1hOKlXAQFJHcjH7JQ
Message-ID: <BANLkTi==S+u1BroeR+zvw+7vqu_T91_mSg@mail.gmail.com>
Subject: Re: rename command
From: Sami Kerola <kerolasa@iki.fi>
To: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigbrady.com>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.216.41
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: Mon, 27 Jun 2011 18:31:32 -0000

2011/6/27 P=E1draig Brady <P@draigbrady.com>:
> On 27/06/11 10:11, Sami Kerola wrote:
>> Hello coreutilitarians,
>>
>> I have been lately making some util-linux patches and while doing
>> so I found rename command. It did not take long to realize that
>> the command would be much better if it would support similar
>> switches as mv. To accomplish that reusing gnulib copy
>> functionality felt correct to me, but that is a problem within
>> context of util-linux package, it does not use gnulib and I do
>> not think it will have anytime soon. I proposed to move rename in
>> util-linux mail list from util-linux to coreutils package, and
>> Karel Zak, current util-linux maintainer, responded 'go ahead and
>> ask at coreutils mailing list'.
>>
>> So here we are, would it sound reasonable to take rename command
>> to be part of coreutils?
>
> Well it's not linux specific.
> So I suppose it fits more here, than in util-linux.

That is true as well.

> I've never used rename actually, instead using find | sed | sh
> in the rare times I've had to do something like this.
> I find that easier and more general, for lower casing etc.
> That is a process per file though.

To be honest if the command would not already exist it should not be
taken to any package. Now when it already is in use making it good is
the reasonable thing to do.

> Anyway, I see you're adding these options,
> to better handle existing files.
>
> +      fputs (_("\
> +      --backup[=3DCONTROL]  make a backup of each existing destination f=
ile\
> +\n\
> +  -b                      like --backup but does not accept an argument\=
n\
> +  -f, --force             do not prompt before overwriting\n\
> +  -i, --interactive       prompt before overwrite\n\
> +  -n, --no-clobber        do not overwrite an existing file\n\
> +If you specify more than one of -i, -f, -n, only the final one takes eff=
ect.\n\
> +  -S, --suffix=3DSUFFIX     override the usual backup suffix\n\
> +  -v, --verbose           explain what is being done\n\
>
>> To be a bit more concrete I wrote first version of patch. While
>> the patch is nearly good there are issues. For instance
>> tests/misc/help-version is failing, and I my attempt to fix that
>> was unsuccessful. The command itself poses few implementation
>> questions. Should rename support recursion
>
> maybe.
>
>> and should the rename
>> move files across directories (IMHO that would be unintuitive)?
>
> maybe not.
>
> --- a/AUTHORS
> +++ b/AUTHORS
> @@ -62,6 +62,7 @@ printf: David MacKenzie
>  ptx: Fran=E7ois Pinard
>  pwd: Jim Meyering
>  readlink: Dmitry V. Levin
> +rename: aeb(?), Sami Kerola
>
> Andries Brouwer

Needs also to be inserted as proper_neme to #define AUTHORS.

> +* rename invocation::            Rename multiple files by using pattern
>
> s/by using pattern/using a pattern/ (in NEWS and info)
>
> sorry I've not time to review fully,

OK.

--=20
=A0=A0 Sami Kerola
=A0=A0 http://www.iki.fi/kerolasa/


From MAILER-DAEMON Mon Jun 27 15:32:10 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QbHXV-00040N-Gr
	for mharc-coreutils@gnu.org; Mon, 27 Jun 2011 15:32:09 -0400
Received: from eggs.gnu.org ([140.186.70.92]:48212)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QbHXS-0003zg-VV
	for coreutils@gnu.org; Mon, 27 Jun 2011 15:32:08 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QbHXQ-00076H-7h
	for coreutils@gnu.org; Mon, 27 Jun 2011 15:32:06 -0400
Received: from mx1.redhat.com ([209.132.183.28]:19112)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QbHXP-00075y-Nc
	for coreutils@gnu.org; Mon, 27 Jun 2011 15:32:04 -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 p5RJW0Qv012757
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Mon, 27 Jun 2011 15:32:00 -0400
Received: from [10.3.113.74] (ovpn-113-74.phx2.redhat.com [10.3.113.74])
	by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id p5RJW07S019963; Mon, 27 Jun 2011 15:32:00 -0400
Message-ID: <4E08DAAF.1060807@redhat.com>
Date: Mon, 27 Jun 2011 13:31:59 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14
	Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10
MIME-Version: 1.0
To: Peng Yu <pengyu.ut@gmail.com>
Subject: Re: sort's --key argument
References: <BANLkTinOXSCc_h5PTYZTZREymocSii6R5g@mail.gmail.com>
In-Reply-To: <BANLkTinOXSCc_h5PTYZTZREymocSii6R5g@mail.gmail.com>
X-Enigmail-Version: 1.1.2
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="------------enigA292B63DA1DDF75E220FE650"
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: 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, 27 Jun 2011 19:32:08 -0000

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

On 06/27/2011 11:10 AM, Peng Yu wrote:
> Hi,
>=20
> I want to sort by the 2nd column (see the 2nd command). But it seems
> that it still sorts by the second column then by the first column.
> Does anybody know how --key works?

Yes.  Unless you specify -s/--stable, then coreutils uses a last-resort
sort, as if you had specified -k1 for selecting the entire line.  And
'sort --debug' shows this:

> $sort --key=3D2,2 input.txt

$ LC_ALL=3DC sort --debug -k2,2 input.txt
sort: using simple byte comparison
a a
 __
___
p a
 __
___

$ LC_ALL=3DC sort --debug -k2,2 input.txt -s
sort: using simple byte comparison
p a
 __
a a
 __

> sort (GNU coreutils) 7.4

Well, you won't get the --debug option unless you upgrade to newer
coreutils; it was added in 8.6 (latest is now 8.12).

--=20
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


--------------enigA292B63DA1DDF75E220FE650
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.11 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJOCNqvAAoJEKeha0olJ0Nq5BEIAIfLtQY9DVN/YaHCcYgHD64s
8CXFZqD+R1loglJxFo3+gYyYELnSjnE5ACZaeKHQSryKwE+BH1xGih7u0jcH/vW9
9pto1XqYYUrxjxMyNgXL0zgiW3Q/o1MArtMPr6Z73QJFFt/4yNx7SsZqzJXqdLrx
NqLov+6vhfdVBeDeXlDFlYhfJVIlnfNH87j9zXQWIBcNFr023esqS/6ljeeEYNXK
9E/yJxxF/WRgaMiCn8eZe5mv5SRgkw7u3GLEoV60Cgfo6Y68/RvC5laeR2cD9J6F
oXuS3xMpX8L3sg7OthD9u4h5zno02wu/aSWEFNnRDmoYClPbLqwqmx/fHPBBJP0=
=e6Rh
-----END PGP SIGNATURE-----

--------------enigA292B63DA1DDF75E220FE650--


From MAILER-DAEMON Tue Jun 28 03:21:34 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QbSc1-0005c7-9c
	for mharc-coreutils@gnu.org; Tue, 28 Jun 2011 03:21:33 -0400
Received: from eggs.gnu.org ([140.186.70.92]:34505)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <auerswal@unix-ag.uni-kl.de>) id 1QbSby-0005bj-Hf
	for coreutils@gnu.org; Tue, 28 Jun 2011 03:21:31 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <auerswal@unix-ag.uni-kl.de>) id 1QbSbx-00021e-17
	for coreutils@gnu.org; Tue, 28 Jun 2011 03:21:30 -0400
Received: from mailgw1.uni-kl.de ([131.246.120.220]:45916)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <auerswal@unix-ag.uni-kl.de>) id 1QbSbw-00020R-Gm
	for coreutils@gnu.org; Tue, 28 Jun 2011 03:21:28 -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
	p5S7LO3U013863
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <coreutils@gnu.org>; Tue, 28 Jun 2011 09:21:24 +0200
Received: from sushi.unix-ag.uni-kl.de (ip6-localhost [IPv6:::1])
	by sushi.unix-ag.uni-kl.de (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP
	id p5S7LOBf025901
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <coreutils@gnu.org>; Tue, 28 Jun 2011 09:21:24 +0200
Received: (from auerswal@localhost)
	by sushi.unix-ag.uni-kl.de (8.14.3/8.14.3/Submit) id p5S7LON8025900
	for coreutils@gnu.org; Tue, 28 Jun 2011 09:21:24 +0200
Date: Tue, 28 Jun 2011 09:21:24 +0200
From: Erik Auerswald <auerswal@unix-ag.uni-kl.de>
To: coreutils@gnu.org
Subject: Re: rename command
Message-ID: <20110628072124.GA25171@sushi.unix-ag.uni-kl.de>
References: <BANLkTimnRiDUcE=UnyTXMEKjL9NA7yk5fA@mail.gmail.com>
	<4E08AF48.9010008@draigBrady.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
In-Reply-To: <4E08AF48.9010008@draigBrady.com>
User-Agent: Mutt/1.5.18 (2008-05-17)
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mailgw1.uni-kl.de id
	p5S7LO3U013863
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: Tue, 28 Jun 2011 07:21:31 -0000

Hi,

On Mon, Jun 27, 2011 at 05:26:48PM +0100, P=E1draig Brady wrote:
> On 27/06/11 10:11, Sami Kerola wrote:
> >=20
> > I have been lately making some util-linux patches and while doing
> > so I found rename command.
> > [...]
>=20
> I've never used rename actually, instead using find | sed | sh
> in the rare times I've had to do something like this.
> I find that easier and more general, for lower casing etc.
> That is a process per file though.

FWIW, I usually use the rename perl script as distributed by Debian with
the perl package (because it is available, convenient and works well).

Regards,
Erik
--=20
Once upon a time, Linux users had to be very careful about which hardware
they bought.
                        -- Jonathan Corbet


From MAILER-DAEMON Tue Jun 28 04:57:45 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QbU76-0002eb-UW
	for mharc-coreutils@gnu.org; Tue, 28 Jun 2011 04:57:45 -0400
Received: from eggs.gnu.org ([140.186.70.92]:39725)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1QbU73-0002dh-DD
	for coreutils@gnu.org; Tue, 28 Jun 2011 04:57:42 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1QbU70-0001Yi-T1
	for coreutils@gnu.org; Tue, 28 Jun 2011 04:57:40 -0400
Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]:18345)
	by eggs.gnu.org with smtp (Exim 4.71)
	(envelope-from <P@draigBrady.com>) id 1QbU70-0001YI-5y
	for coreutils@gnu.org; Tue, 28 Jun 2011 04:57:38 -0400
Received: (qmail 14881 invoked from network); 28 Jun 2011 08:57:34 -0000
Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218)
	by mail1.slb.deg.dub.stisp.net with SMTP; 28 Jun 2011 08:57:34 -0000
Message-ID: <4E09975E.4090709@draigBrady.com>
Date: Tue, 28 Jun 2011 09:57:02 +0100
From: =?ISO-8859-1?Q?P=E1draig_Brady?= <P@draigBrady.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US;
	rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3
MIME-Version: 1.0
To: Erik Auerswald <auerswal@unix-ag.uni-kl.de>
Subject: Re: rename command
References: <BANLkTimnRiDUcE=UnyTXMEKjL9NA7yk5fA@mail.gmail.com>	<4E08AF48.9010008@draigBrady.com>
	<20110628072124.GA25171@sushi.unix-ag.uni-kl.de>
In-Reply-To: <20110628072124.GA25171@sushi.unix-ag.uni-kl.de>
X-Enigmail-Version: 1.0.1
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-detected-operating-system: by eggs.gnu.org: FreeBSD 4.6-4.9
X-Received-From: 84.203.253.98
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, 28 Jun 2011 08:57:43 -0000

On 28/06/11 08:21, Erik Auerswald wrote:
> Hi,
> 
> On Mon, Jun 27, 2011 at 05:26:48PM +0100, Pádraig Brady wrote:
>> On 27/06/11 10:11, Sami Kerola wrote:
>>>
>>> I have been lately making some util-linux patches and while doing
>>> so I found rename command.
>>> [...]
>>
>> I've never used rename actually, instead using find | sed | sh
>> in the rare times I've had to do something like this.
>> I find that easier and more general, for lower casing etc.
>> That is a process per file though.
> 
> FWIW, I usually use the rename perl script as distributed by Debian with
> the perl package (because it is available, convenient and works well).

Good point.

# dpkg -S $(readlink -f $(which rename))
perl: /usr/bin/prename

That one supports -f for "force" too,
but -n means "test" rather than "noclobber".

Of course the replacement syntax is different
and is more like my find | sed | sh pattern above,
except it's not a process per file.
So I'd prefer this one TBH.

So portable scripts should use `prename` I guess
for the perl syntax, and `rename` for the util-linux one.

cheers,
Pádraig.


From MAILER-DAEMON Tue Jun 28 05:48:21 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QbUu4-0005Si-HS
	for mharc-coreutils@gnu.org; Tue, 28 Jun 2011 05:48:20 -0400
Received: from eggs.gnu.org ([140.186.70.92]:43028)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <auerswal@unix-ag.uni-kl.de>) id 1QbUtz-0005RR-SZ
	for coreutils@gnu.org; Tue, 28 Jun 2011 05:48: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 1QbUty-0003fX-CZ
	for coreutils@gnu.org; Tue, 28 Jun 2011 05:48:15 -0400
Received: from mailgw1.uni-kl.de ([131.246.120.220]:48709)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <auerswal@unix-ag.uni-kl.de>) id 1QbUtx-0003fK-SL
	for coreutils@gnu.org; Tue, 28 Jun 2011 05:48: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
	p5S9mBov030155
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT)
	for <coreutils@gnu.org>; Tue, 28 Jun 2011 11:48:11 +0200
Received: from sushi.unix-ag.uni-kl.de (ip6-localhost [IPv6:::1])
	by sushi.unix-ag.uni-kl.de (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP
	id p5S9mAeP013249
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <coreutils@gnu.org>; Tue, 28 Jun 2011 11:48:10 +0200
Received: (from auerswal@localhost)
	by sushi.unix-ag.uni-kl.de (8.14.3/8.14.3/Submit) id p5S9mAdd013247
	for coreutils@gnu.org; Tue, 28 Jun 2011 11:48:10 +0200
Date: Tue, 28 Jun 2011 11:48:10 +0200
From: Erik Auerswald <auerswal@unix-ag.uni-kl.de>
To: coreutils@gnu.org
Subject: Re: rename command
Message-ID: <20110628094810.GA11801@sushi.unix-ag.uni-kl.de>
References: <BANLkTimnRiDUcE=UnyTXMEKjL9NA7yk5fA@mail.gmail.com>
	<4E08AF48.9010008@draigBrady.com>
	<20110628072124.GA25171@sushi.unix-ag.uni-kl.de>
	<4E09975E.4090709@draigBrady.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
In-Reply-To: <4E09975E.4090709@draigBrady.com>
User-Agent: Mutt/1.5.18 (2008-05-17)
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by mailgw1.uni-kl.de id
	p5S9mBov030155
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: Tue, 28 Jun 2011 09:48:17 -0000

Hi,

On Tue, Jun 28, 2011 at 09:57:02AM +0100, P=E1draig Brady wrote:
> On 28/06/11 08:21, Erik Auerswald wrote:
> > On Mon, Jun 27, 2011 at 05:26:48PM +0100, P=E1draig Brady wrote:
> >> On 27/06/11 10:11, Sami Kerola wrote:
> >>>
> >>> I have been lately making some util-linux patches and while doing
> >>> so I found rename command.
> >>> [...]
> >>
> >> I've never used rename actually, instead using find | sed | sh
> >> in the rare times I've had to do something like this.
> >> I find that easier and more general, for lower casing etc.
> >> That is a process per file though.
> >=20
> > FWIW, I usually use the rename perl script as distributed by Debian w=
ith
> > the perl package (because it is available, convenient and works well).
>=20
> Good point.
>=20
> # dpkg -S $(readlink -f $(which rename))
> perl: /usr/bin/prename
>=20
> That one supports -f for "force" too,
> but -n means "test" rather than "noclobber".
>=20
> Of course the replacement syntax is different
> and is more like my find | sed | sh pattern above,
> except it's not a process per file.
> So I'd prefer this one TBH.
>=20
> So portable scripts should use `prename` I guess
> for the perl syntax, and `rename` for the util-linux one.

I don't think this is really portable, the 'p' prefix was added to fix
Debian bug #304705. In fact I don't know if, where and under which name
this rename Perl script can be found in other distris or even the BSDs.

Regards,
Erik
--=20
Full disclosure is the only thing that forces vendors to fix security pro=
blems.
                        -- Bruce Schneier


From MAILER-DAEMON Tue Jun 28 06:21:12 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QbVPr-0004Lq-CO
	for mharc-coreutils@gnu.org; Tue, 28 Jun 2011 06:21:11 -0400
Received: from eggs.gnu.org ([140.186.70.92]:36933)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kerolasa@gmail.com>) id 1QbVPo-0004Ku-1w
	for coreutils@gnu.org; Tue, 28 Jun 2011 06:21:09 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <kerolasa@gmail.com>) id 1QbVPl-0000nn-Kt
	for coreutils@gnu.org; Tue, 28 Jun 2011 06:21:07 -0400
Received: from mail-qw0-f41.google.com ([209.85.216.41]:35718)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <kerolasa@gmail.com>) id 1QbVPl-0000nd-5C
	for coreutils@gnu.org; Tue, 28 Jun 2011 06:21:05 -0400
Received: by qwa26 with SMTP id 26so42324qwa.0
	for <coreutils@gnu.org>; Tue, 28 Jun 2011 03:21:04 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:reply-to:sender:in-reply-to:references:date
	:x-google-sender-auth:message-id:subject:from:to:cc:content-type
	:content-transfer-encoding;
	bh=fAq5sNpj4VY+X0AZMRWZQsBFlvkgIu/2eavrl3vbuCE=;
	b=aX8KtAjaG3uVa0Hm4bypXMh4LLrWWHJ5EFSST6O5hFFZenshfEJhR1sDygVwCdDyVX
	n2/xduD7f1pdTiLOF/HzEm5X1sLzeH3wBsxIfjTMar2IF7W2Tl56NBJqwY1wp05pIFqz
	D25Xg0IqUAdhcdbkOTYaGDFKlQNlsEO3T9/ek=
MIME-Version: 1.0
Received: by 10.229.137.19 with SMTP id u19mr5366482qct.173.1309256463621;
	Tue, 28 Jun 2011 03:21:03 -0700 (PDT)
Sender: kerolasa@gmail.com
Received: by 10.229.107.15 with HTTP; Tue, 28 Jun 2011 03:21:03 -0700 (PDT)
In-Reply-To: <20110628094810.GA11801@sushi.unix-ag.uni-kl.de>
References: <BANLkTimnRiDUcE=UnyTXMEKjL9NA7yk5fA@mail.gmail.com>
	<4E08AF48.9010008@draigBrady.com>
	<20110628072124.GA25171@sushi.unix-ag.uni-kl.de>
	<4E09975E.4090709@draigBrady.com>
	<20110628094810.GA11801@sushi.unix-ag.uni-kl.de>
Date: Tue, 28 Jun 2011 12:21:03 +0200
X-Google-Sender-Auth: Ltz3Q8AuH9RYv71UbtdI6TpZ_WM
Message-ID: <BANLkTi=OvVtrHkW45mZ=EYn0vWvVWi3oHg@mail.gmail.com>
Subject: Re: rename command
From: Sami Kerola <kerolasa@iki.fi>
To: Erik Auerswald <auerswal@unix-ag.uni-kl.de>
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.216.41
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, 28 Jun 2011 10:21:10 -0000

On Tue, Jun 28, 2011 at 11:48, Erik Auerswald
<auerswal@unix-ag.uni-kl.de> wrote:
> On Tue, Jun 28, 2011 at 09:57:02AM +0100, P=E1draig Brady wrote:
>> On 28/06/11 08:21, Erik Auerswald wrote:
>> > On Mon, Jun 27, 2011 at 05:26:48PM +0100, P=E1draig Brady wrote:
>> >> On 27/06/11 10:11, Sami Kerola wrote:
>> >>>
>> >>> I have been lately making some util-linux patches and while doing
>> >>> so I found rename command.
>> >>> [...]
>> >>
>> >> I've never used rename actually, instead using find | sed | sh
>> >> in the rare times I've had to do something like this.
>> >> I find that easier and more general, for lower casing etc.
>> >> That is a process per file though.
>> >
>> > FWIW, I usually use the rename perl script as distributed by Debian wi=
th
>> > the perl package (because it is available, convenient and works well).
>>
>> Good point.
>>
>> # dpkg -S $(readlink -f $(which rename))
>> perl: /usr/bin/prename
>>
>> That one supports -f for "force" too,
>> but -n means "test" rather than "noclobber".
>>
>> Of course the replacement syntax is different
>> and is more like my find | sed | sh pattern above,
>> except it's not a process per file.
>> So I'd prefer this one TBH.
>>
>> So portable scripts should use `prename` I guess
>> for the perl syntax, and `rename` for the util-linux one.
>
> I don't think this is really portable, the 'p' prefix was added to fix
> Debian bug #304705. In fact I don't know if, where and under which name
> this rename Perl script can be found in other distris or even the BSDs.

BSD has a bit more advanced rename.

http://rename.berlios.de/

I guess that is not much in use because the only version of on line
manual page I found was in Google cache.

http://webcache.googleusercontent.com/search?q=3Dcache:y1_wk6tYjCwJ:https:/=
/1command.com/man/index.cgi

The syntax seems to be a little bit different, which is something to
mind if a coreutils version aims to be general replacement of all of
them. So far the test option is only one which seems to vary.

--=20
=A0=A0 Sami Kerola
=A0=A0 http://www.iki.fi/kerolasa/


From MAILER-DAEMON Tue Jun 28 10:02:43 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QbYsE-0002Sh-LH
	for mharc-coreutils@gnu.org; Tue, 28 Jun 2011 10:02:42 -0400
Received: from eggs.gnu.org ([140.186.70.92]:59564)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <inpost@gmail.com>) id 1QbYsA-0002Rs-RA
	for coreutils@gnu.org; Tue, 28 Jun 2011 10:02:40 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <inpost@gmail.com>) id 1QbYs8-00007K-Vp
	for coreutils@gnu.org; Tue, 28 Jun 2011 10:02:38 -0400
Received: from mail-vw0-f41.google.com ([209.85.212.41]:48767)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <inpost@gmail.com>) id 1QbYs8-000072-OE
	for coreutils@gnu.org; Tue, 28 Jun 2011 10:02:36 -0400
Received: by vws4 with SMTP id 4so223549vws.0
	for <coreutils@gnu.org>; Tue, 28 Jun 2011 07:02:35 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=khrhKzD9fUWODk1Cr+SfNVzYZ+Sk8vajpnfJqTmlonI=;
	b=nEBm6z8KB/byZAAPvOqX9GCUkNt+0ErIRdTdRFiBce/oyYiG//Ep5qPWj4xQvuNG7V
	NANCYqdjZjvsXn185lN7YeE+HYr75sVqCTxwtzYY7yYEEo1e6mAyGHpj1klvq47Pjapt
	DzRvrttg/pmdEifNM2jEGbZCZwUqlaTxMLl/0=
MIME-Version: 1.0
Received: by 10.220.209.133 with SMTP id gg5mr2612344vcb.150.1309269755408;
	Tue, 28 Jun 2011 07:02:35 -0700 (PDT)
Received: by 10.220.72.147 with HTTP; Tue, 28 Jun 2011 07:02:35 -0700 (PDT)
Date: Tue, 28 Jun 2011 15:02:35 +0100
Message-ID: <BANLkTikVHyTKTsV3QH9uC3rzqN2xp2YhzA@mail.gmail.com>
Subject: recover data from corrupted tarball
From: e-letter <inpost@gmail.com>
To: coreutils@gnu.org
Content-Type: text/plain; charset=UTF-8
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.212.41
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, 28 Jun 2011 14:02:41 -0000

Readers,

A tar ball was received, created in m$ environment using 7zip. Using
gnu/linux mandriva (m$ not available) The normal tar extract command
was applied:

tar -xf ...

which was unsuccessful, returning command terminal response:

tar: This does not look like a tar archive
tar: Skipping to next header
tar: Error exit delayed from previous errors

Using the tool 'file', the tar files are classified as 'data', of
mime-type 'application/octet-stream', which I presume means that the
the tar ball was formatted in error to some binary format.

Any advice to obtain the files in the tar ball?


From MAILER-DAEMON Tue Jun 28 10:13:39 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QbZ2n-0005Cy-JW
	for mharc-coreutils@gnu.org; Tue, 28 Jun 2011 10:13:38 -0400
Received: from eggs.gnu.org ([140.186.70.92]:39086)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QbZ2k-0005C7-Is
	for coreutils@gnu.org; Tue, 28 Jun 2011 10:13:35 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QbZ2h-0002Am-SB
	for coreutils@gnu.org; Tue, 28 Jun 2011 10:13:34 -0400
Received: from mx1.redhat.com ([209.132.183.28]:44777)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <eblake@redhat.com>) id 1QbZ2h-0002AM-98
	for coreutils@gnu.org; Tue, 28 Jun 2011 10:13:31 -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 p5SEDRj2027440
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 28 Jun 2011 10:13:28 -0400
Received: from [10.3.113.74] (ovpn-113-74.phx2.redhat.com [10.3.113.74])
	by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP
	id p5SEDRQP028790; Tue, 28 Jun 2011 10:13:27 -0400
Message-ID: <4E09E187.9050400@redhat.com>
Date: Tue, 28 Jun 2011 08:13:27 -0600
From: Eric Blake <eblake@redhat.com>
Organization: Red Hat
User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US;
	rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14
	Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.10
MIME-Version: 1.0
To: e-letter <inpost@gmail.com>
Subject: Re: recover data from corrupted tarball
References: <BANLkTikVHyTKTsV3QH9uC3rzqN2xp2YhzA@mail.gmail.com>
In-Reply-To: <BANLkTikVHyTKTsV3QH9uC3rzqN2xp2YhzA@mail.gmail.com>
X-Enigmail-Version: 1.1.2
OpenPGP: url=http://people.redhat.com/eblake/eblake.gpg
Content-Type: multipart/signed; micalg=pgp-sha256;
	protocol="application/pgp-signature";
	boundary="------------enigBAC32AFCD38B5589B0DC2F27"
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: 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, 28 Jun 2011 14:13:36 -0000

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

On 06/28/2011 08:02 AM, e-letter wrote:
> Readers,
>=20
> A tar ball was received, created in m$ environment using 7zip. Using
> gnu/linux mandriva (m$ not available) The normal tar extract command
> was applied:
>=20
> tar -xf ...
>=20
> which was unsuccessful, returning command terminal response:
>=20
> tar: This does not look like a tar archive
> tar: Skipping to next header
> tar: Error exit delayed from previous errors
>=20
> Using the tool 'file', the tar files are classified as 'data', of
> mime-type 'application/octet-stream', which I presume means that the
> the tar ball was formatted in error to some binary format.
>=20
> Any advice to obtain the files in the tar ball?

This is the coreutils list, but coreutils is not responsible for tar,
nor even for file.  There's nothing coreutils can do for you.

You may have better luck for recovery ideas by asking on the tar mailing
list, but you should be aware that text-vs-binary corruption is not
always reversible.  It may be that your only recourse is to ask the
sender to resend the tarball but this time ensuring that they use binary
rather than text mode so that carriage returns aren't inserted to
corrupt the stream.

--=20
Eric Blake   eblake@redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org


--------------enigBAC32AFCD38B5589B0DC2F27
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.11 (GNU/Linux)
Comment: Public key at http://people.redhat.com/eblake/eblake.gpg
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iQEcBAEBCAAGBQJOCeGHAAoJEKeha0olJ0NqKsEH/RgRjPWWiXamFhp6fIaKKIHE
QsENg1K+CJx1lbUM69U9FJn970dGjPqfKLsLGzKL0EFjN87T3FhJTunoKQsYJIvq
BdL3vkFnWtVudFn7OMHjPOArpEo+HcbzqLlMJSIAzkfIW2ojA7HDWuA5i/6FScN2
VF/eO9hg7tGsPK1PW+ixC4sscKTXBBf6xwfYNYwg93JrkpTTK6jRMbub8TGIqrtx
r0Isps39uNFkUBygC1SWjcZLaSLv+iYaP5gBQcB4xfUS9a0QouQBrQvJ4DHoJCOV
u3xcg7qZ0DQtAsfW2LuwHqYGSZbSyXvtAiG+sne1KiujqgdHOEeZFlDlJVzm/f0=
=WMWd
-----END PGP SIGNATURE-----

--------------enigBAC32AFCD38B5589B0DC2F27--


From MAILER-DAEMON Tue Jun 28 17:37:39 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QbfyU-0000Yk-CL
	for mharc-coreutils@gnu.org; Tue, 28 Jun 2011 17:37:38 -0400
Received: from eggs.gnu.org ([140.186.70.92]:45848)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <james@youngman.org>) id 1QbfyQ-0000YF-W7
	for coreutils@gnu.org; Tue, 28 Jun 2011 17:37:35 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <james@youngman.org>) id 1QbfyP-000161-JN
	for coreutils@gnu.org; Tue, 28 Jun 2011 17:37:34 -0400
Received: from mail-vw0-f41.google.com ([209.85.212.41]:58239)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <james@youngman.org>) id 1QbfyP-00015x-9q
	for coreutils@gnu.org; Tue, 28 Jun 2011 17:37:33 -0400
Received: by vws4 with SMTP id 4so613871vws.0
	for <coreutils@gnu.org>; Tue, 28 Jun 2011 14:37:32 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.52.175.132 with SMTP id ca4mr75534vdc.98.1309297052261; Tue,
	28 Jun 2011 14:37:32 -0700 (PDT)
Sender: james@youngman.org
Received: by 10.52.158.167 with HTTP; Tue, 28 Jun 2011 14:37:32 -0700 (PDT)
In-Reply-To: <20110628072124.GA25171@sushi.unix-ag.uni-kl.de>
References: <BANLkTimnRiDUcE=UnyTXMEKjL9NA7yk5fA@mail.gmail.com>
	<4E08AF48.9010008@draigBrady.com>
	<20110628072124.GA25171@sushi.unix-ag.uni-kl.de>
Date: Tue, 28 Jun 2011 22:37:32 +0100
X-Google-Sender-Auth: WTZ1_GYn6pkDXVJ5CNJHEVGWHh4
Message-ID: <BANLkTikP0MF96xi0Y89_TrgJpS9iq3VUPg@mail.gmail.com>
Subject: Re: rename command
From: James Youngman <jay@gnu.org>
To: Erik Auerswald <auerswal@unix-ag.uni-kl.de>
Content-Type: text/plain; charset=UTF-8
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.212.41
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, 28 Jun 2011 21:37:36 -0000

If we're going to implement a "rename" command, can we make one that
copes with internal newlines (IIRC "rename" does not) and doesn't
force the user to assume path names are text[1]?

[1] UNIX-like kernels mostly think path names are byte sequences
terminated by '\0', possibly including one or more instances of '/'.
In particular, filesystems routinely contain files with a multiplicity
of character encodings.


From MAILER-DAEMON Wed Jun 29 07:05:35 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QbsaM-0007go-In
	for mharc-coreutils@gnu.org; Wed, 29 Jun 2011 07:05:34 -0400
Received: from eggs.gnu.org ([140.186.70.92]:56811)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jeff.liu@oracle.com>) id 1QbsaJ-0007fq-1D
	for coreutils@gnu.org; Wed, 29 Jun 2011 07:05:32 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <jeff.liu@oracle.com>) id 1QbsaH-0005ar-IF
	for coreutils@gnu.org; Wed, 29 Jun 2011 07:05:30 -0400
Received: from rcsinet10.oracle.com ([148.87.113.121]:49596)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <jeff.liu@oracle.com>) id 1QbsaH-0005af-6o
	for coreutils@gnu.org; Wed, 29 Jun 2011 07:05:29 -0400
Received: from acsinet22.oracle.com (acsinet22.oracle.com [141.146.126.238])
	by rcsinet10.oracle.com (Switch-3.4.4/Switch-3.4.2) with ESMTP id
	p5TB5LAo012746
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Wed, 29 Jun 2011 11:05:23 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id
	p5TB5KFG019023
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Wed, 29 Jun 2011 11:05:20 GMT
Received: from abhmt111.oracle.com (abhmt111.oracle.com [141.146.116.63])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	p5TB5EUJ002214; Wed, 29 Jun 2011 06:05:14 -0500
Received: from [10.191.12.227] (/10.191.12.227)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Wed, 29 Jun 2011 04:05:14 -0700
Message-ID: <4E0B070B.4010606@oracle.com>
Date: Wed, 29 Jun 2011 19:05:47 +0800
From: "jeff.liu" <jeff.liu@oracle.com>
User-Agent: Thunderbird 2.0.0.14 (X11/20080505)
MIME-Version: 1.0
To: Philipp Thomas <pth@suse.de>
Subject: Re: Supporting reflinked/cow files in coreutils
References: <20110414143352.GC5231@paradies.suse.de>
	<4DA71296.8040000@draigBrady.com>
	<20110616124842.GG11744@paradies.suse.de>
	<20110620104726.GB18107@paradies.suse.de>
In-Reply-To: <20110620104726.GB18107@paradies.suse.de>
Content-Type: text/plain; charset=iso-8859-1
X-Source-IP: acsinet22.oracle.com [141.146.126.238]
X-Auth-Type: Internal IP
X-CT-RefId: str=0001.0A090208.4E0B06F3.00CF:SCFMA922111,ss=1,re=-4.000,fgs=0
Content-Transfer-Encoding: quoted-printable
X-MIME-Autoconverted: from 8bit to quoted-printable by rcsinet10.oracle.com id
	p5TB5LAo012746
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1)
X-Received-From: 148.87.113.121
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, 29 Jun 2011 11:05:32 -0000

Hi Philipp,

Pretty sorry for the late reply! I have not checked this email somehow. :=
(

The latest post about OCFS2 reflink support for cp(1) can be found at the=
 following link:
http://www.mail-archive.com/coreutils@gnu.org/msg01247.html

P=E1draig,

Would you please take a look at it at your convenient?


Thanks,
-Jeff
Philipp Thomas wrote:
> P=E1draig, Jeff,
>=20
> [forget Jeff in the initial reply, thus the full quote]
>=20
> * Philipp Thomas (pth@suse.de) [20110616 15:32]:
>=20
>> I finally got the time to look into copy.c and found the code you're
>> speaking of. Looking at the ocfs2 code it seems to me that OCFS2_IOC_R=
EFLINK
>> is what is needed for but that is where my knowledge ends. Jeff could =
you
>> fill in the pieces needed to make clone_file also work on ocfs2?
>=20
> Philipp



From MAILER-DAEMON Thu Jun 30 12:37:47 2011
Received: from list by lists.gnu.org with archive (Exim 4.71)
	id 1QcKFO-0003CU-DI
	for mharc-coreutils@gnu.org; Thu, 30 Jun 2011 12:37:46 -0400
Received: from eggs.gnu.org ([140.186.70.92]:38596)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <svartman95@gmail.com>) id 1QcKFK-0003BR-Uq
	for coreutils@gnu.org; Thu, 30 Jun 2011 12:37:44 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <svartman95@gmail.com>) id 1QcKFJ-000721-7U
	for coreutils@gnu.org; Thu, 30 Jun 2011 12:37:42 -0400
Received: from mail-yw0-f41.google.com ([209.85.213.41]:56724)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <svartman95@gmail.com>) id 1QcKFI-00071m-SJ
	for coreutils@gnu.org; Thu, 30 Jun 2011 12:37:41 -0400
Received: by ywb26 with SMTP id 26so1199764ywb.0
	for <coreutils@gnu.org>; Thu, 30 Jun 2011 09:37:39 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
	h=mime-version:in-reply-to:references:date:message-id:subject:from:to
	:cc:content-type;
	bh=av0KKjAC7Jd2pikY86zxIh0RpEiUwEFjhgcbPMWgtCY=;
	b=lRyHUahkFMJgECoCiSlVGvyliTPSZxYMh6XTF16M0UalT90YhiuXlIS9lcnwPcnxtK
	aJmR5GeWxpz13K3/m4vH59njgDIqKDhyrBbmiE0YXLzevOsG0krgBf7LKnCS9tFrftGY
	kS+q9gI112c2D7BcHYR6+oATMc8ge5puxd3ng=
MIME-Version: 1.0
Received: by 10.236.173.33 with SMTP id u21mr2759520yhl.426.1309451859627;
	Thu, 30 Jun 2011 09:37:39 -0700 (PDT)
Received: by 10.236.107.161 with HTTP; Thu, 30 Jun 2011 09:37:39 -0700 (PDT)
In-Reply-To: <BANLkTi=6TNhz+_Bbg0dBaH4JcHT8JdgxhA@mail.gmail.com>
References: <mailman.780.1308326798.770.coreutils@gnu.org>
	<BANLkTi=6TNhz+_Bbg0dBaH4JcHT8JdgxhA@mail.gmail.com>
Date: Thu, 30 Jun 2011 16:37:39 +0000
Message-ID: <BANLkTin111snwHaoUYtexHaKdh-qYmVY3Q@mail.gmail.com>
Subject: Re: coreutils Digest, Vol 16, Issue 11
From: Bjartur Thorlacius <svartman95@gmail.com>
To: e-letter <inpost@gmail.com>
Content-Type: text/plain; charset=UTF-8
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 209.85.213.41
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, 30 Jun 2011 16:37:44 -0000

On 6/17/11, e-letter <inpost@gmail.com> wrote:
> On 17/06/2011, coreutils-request@gnu.org <coreutils-request@gnu.org> wrote:
>> Which part of
>>
>> base64 [OPTION]... [FILE]
>>
>> is not clear?
>>
> isn't option '-d' not correct?
>
Yes, it is.

> Therefore the syntax seems
>
> base64 -d ...
>
> If no file is to be specified then it seems logical to add the base64
> encoded text where the ellipsis are shown above.
>
But base64 thinks you've specified a file, namely '...'. You probably*
want to do something along the lines of base64 -d <<<'==hsgd....etc';
that is the command name, the -d flag for decoding, followed by three
less than signs to mark the following word as input for the command,
as opposed to a positional argument, i.e. a FILE and at last the input
(preferably enclosed in apostrophes to tell your shell (bash) not to
parse the input but pass it on as-is).
Also try typing base64 -d, a newline (by pressing return/enter) and
then typing your input. You may have to terminate your input with a ^D
(Control-D) after the last newline.
So:
$ base64 -d
...base64 coded input here...

* assuming you're using GNU bash.


