From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 15 19:40:28 2011 Received: (at submit) by debbugs.gnu.org; 15 Mar 2011 23:40:29 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pzdqm-0006hO-49 for submit@debbugs.gnu.org; Tue, 15 Mar 2011 19:40:28 -0400 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Pzdph-0006fY-0J for submit@debbugs.gnu.org; Tue, 15 Mar 2011 19:39:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Pzdpb-0002L2-61 for submit@debbugs.gnu.org; Tue, 15 Mar 2011 19:39:16 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:34297) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Pzdpb-0002Ky-3o for submit@debbugs.gnu.org; Tue, 15 Mar 2011 19:39:15 -0400 Received: from [140.186.70.92] (port=58672 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Pzdpa-0006Gd-2p for bug-coreutils@gnu.org; Tue, 15 Mar 2011 19:39:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PzdpY-0002KO-KC for bug-coreutils@gnu.org; Tue, 15 Mar 2011 19:39:13 -0400 Received: from aibo.runbox.com ([87.238.52.70]:35832) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PzdpY-0002K1-9X for bug-coreutils@gnu.org; Tue, 15 Mar 2011 19:39:12 -0400 Received: from [10.9.9.130] (helo=fenris.runbox.com) by greyhound.runbox.com with esmtp (Exim 4.50) id 1PzdpV-00070R-K0 for bug-coreutils@gnu.org; Wed, 16 Mar 2011 00:39:09 +0100 Received: from mail by fenris.runbox.com with local (Exim 4.50) id 1PzdpV-0007PR-IZ for bug-coreutils@gnu.org; Wed, 16 Mar 2011 00:39:09 +0100 Content-Type: text/plain; charset="iso-8859-15" Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Received: from [173.79.216.137] by secure.runbox.com with http (uid:258406) (RMM 4.0); for ; Tue, 15 Mar 2011 23:39:09 GMT From: "David A. Wheeler" To: bug-coreutils@gnu.org Subject: [PATCH] Allow == as synonym for = in test Date: Tue, 15 Mar 2011 19:39:09 -0400 (EDT) X-Mailer: RMM Message-Id: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 15 Mar 2011 19:40:27 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Reply-To: dwheeler@dwheeler.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) The following trivial patch makes GNU coreutils' test recognize "=3D=3D" as a synonym for "=3D". This is already the case in GNU coreutils' expr, bash, ksh, busybox ash, FreeBSD-current /bin/sh and /bin/test, and OpenBSD's /bin/sh. These are only a few lines, so I don't think any paperwork is needed. The following implements "=3D=3D" and documents i= t. --- David A. Wheeler --- ./src/test.c.orig 2011-03-15 00:49:11.000000000 -0400 +++ ./src/test.c 2011-03-15 09:11:04.000000000 -0400 @@ -173,7 +173,8 @@ static bool binop (char const *s) { - return ((STREQ (s, "=3D")) || (STREQ (s, "!=3D")) || (STREQ (s, "-nt"= )) || + return ((STREQ (s, "=3D")) || (STREQ (s, "!=3D")) || (STREQ (s, "=3D= =3D")) || + (STREQ (s, "-nt")) || (STREQ (s, "-ot")) || (STREQ (s, "-ef")) || (STREQ (s, "-eq")) || (STREQ (s, "-ne")) || (STREQ (s, "-lt")) || (STREQ (s, "-le")) || (STREQ (s, "-gt")) || (STREQ (s, "-ge"))); @@ -360,7 +361,8 @@ test_syntax_error (_("unknown binary operator"), argv[op]); } =20 - if (argv[op][0] =3D=3D '=3D' && !argv[op][1]) + if (argv[op][0] =3D=3D '=3D' && (!argv[op][1] || + ((argv[op][1] =3D=3D '=3D') && !argv[op][2]))) { bool value =3D STREQ (argv[pos], argv[pos + 2]); pos +=3D 3; --- ./doc/coreutils.texi.orig 2011-03-15 00:49:10.000000000 -0400 +++ ./doc/coreutils.texi 2011-03-15 20:10:44.000000000 -0400 @@ -11535,7 +11535,7 @@ * File type tests:: -[bcdfhLpSt] * Access permission tests:: -[gkruwxOG] * File characteristic tests:: -e -s -nt -ot -ef -* String tests:: -z -n =3D !=3D +* String tests:: -z -n =3D =3D=3D !=3D * Numeric tests:: -eq -ne -lt -le -gt -ge * Connectives for test:: ! -a -o @end menu @@ -11726,6 +11726,11 @@ @cindex equal string check True if the strings are equal. =20 +@item @var{string1} =3D=3D @var{string2} +@opindex =3D=3D +@cindex equal string check +True if the strings are equal (synonym for =3D). + @item @var{string1} !=3D @var{string2} @opindex !=3D @cindex not-equal string check From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 21 08:27:53 2011 Received: (at 8263) by debbugs.gnu.org; 21 Mar 2011 12:27:53 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q1eDA-0003zT-Lb for submit@debbugs.gnu.org; Mon, 21 Mar 2011 08:27:53 -0400 Received: from mail1.slb.deg.dub.stisp.net ([84.203.253.98]) by debbugs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1Q1eD9-0003zE-Bm for 8263@debbugs.gnu.org; Mon, 21 Mar 2011 08:27:52 -0400 Received: (qmail 32755 invoked from network); 21 Mar 2011 12:27:45 -0000 Received: from unknown (HELO ?192.168.2.25?) (84.203.137.218) by mail1.slb.deg.dub.stisp.net with SMTP; 21 Mar 2011 12:27:45 -0000 Message-ID: <4D8743C2.801@draigBrady.com> Date: Mon, 21 Mar 2011 12:25:38 +0000 From: =?ISO-8859-15?Q?P=E1draig_Brady?= 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: dwheeler@dwheeler.com Subject: Re: bug#8263: [PATCH] Allow == as synonym for = in test References: In-Reply-To: X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 8bit X-Spam-Score: -2.7 (--) X-Debbugs-Envelope-To: 8263 Cc: 8263@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -2.7 (--) On 15/03/11 23:39, David A. Wheeler wrote: > The following trivial patch makes GNU coreutils' test recognize "==" > as a synonym for "=". This is already the case in GNU coreutils' expr, > bash, ksh, busybox ash, FreeBSD-current /bin/sh and /bin/test, and > OpenBSD's /bin/sh. These are only a few lines, so I don't think > any paperwork is needed. The following implements "==" and documents it. Related http://austingroupbugs.net/view.php?id=375 I'm leaning towards accepting this. Note dash does not support ==, nor does older busybox ash. dash seem to be waiting for the POSIX acceptance before changing? cheers, Pádraig. From debbugs-submit-bounces@debbugs.gnu.org Mon Mar 21 09:14:30 2011 Received: (at 8263) by debbugs.gnu.org; 21 Mar 2011 13:14:30 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q1ewI-00053y-An for submit@debbugs.gnu.org; Mon, 21 Mar 2011 09:14:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q1ewF-00053m-6b for 8263@debbugs.gnu.org; Mon, 21 Mar 2011 09:14:28 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2LDELhO029402 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 21 Mar 2011 09:14:21 -0400 Received: from [10.3.113.61] (ovpn-113-61.phx2.redhat.com [10.3.113.61]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p2LDEKSB027582; Mon, 21 Mar 2011 09:14:20 -0400 Message-ID: <4D874F26.6030703@redhat.com> Date: Mon, 21 Mar 2011 07:14:14 -0600 From: Eric Blake Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.9 MIME-Version: 1.0 To: =?ISO-8859-15?Q?P=E1draig_Brady?= Subject: Re: bug#8263: [PATCH] Allow == as synonym for = in test References: <4D8743C2.801@draigBrady.com> In-Reply-To: <4D8743C2.801@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="------------enigF8600E5BCBE6B9D3D5049039" X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-Spam-Score: -10.3 (----------) X-Debbugs-Envelope-To: 8263 Cc: dwheeler@dwheeler.com, 8263@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -10.3 (----------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigF8600E5BCBE6B9D3D5049039 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable On 03/21/2011 06:25 AM, P=E1draig Brady wrote: > On 15/03/11 23:39, David A. Wheeler wrote: >> The following trivial patch makes GNU coreutils' test recognize "=3D=3D= " >> as a synonym for "=3D". This is already the case in GNU coreutils' ex= pr, >> bash, ksh, busybox ash, FreeBSD-current /bin/sh and /bin/test, and >> OpenBSD's /bin/sh. These are only a few lines, so I don't think >> any paperwork is needed. The following implements "=3D=3D" and docume= nts it. >=20 > Related http://austingroupbugs.net/view.php?id=3D375 > I'm leaning towards accepting this. >=20 > Note dash does not support =3D=3D, nor does older busybox ash. > dash seem to be waiting for the POSIX acceptance before changing? Yes, that's my read of the similar thread on the dash list - dash is waiting for the Austin Group ruling to take place first. But coreutils already has several extensions not in dash (it's closer to bash), so we might as well go with it now. I'm in favor of this patch. --=20 Eric Blake eblake@redhat.com +1-801-349-2682 Libvirt virtualization library http://libvirt.org --------------enigF8600E5BCBE6B9D3D5049039 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/ iQEcBAEBCAAGBQJNh08sAAoJEKeha0olJ0Nq9GUH/iqAuRDdxVSl841DT2ltVcxU cgGxP2edIRXVfmOlUmOiJ5VFHBVlj0FVzhoHPe8fgWBt6rXxPbLL6Rcc+vI7wEDQ ppypgD7sJ/vCNpK0bv2T2JY0bliZuY8V48EaCMn831jX/0ishB8WEwkZCg2fQOhs nnKJBTJEyVxgUuIUfL27ebaro+sI7s0rpLCqHMyqf10JHdDIO1lQ2IZV6y1Uud4t ptWJwydjIt96Lc6gsejGPDs5Ius1jvgAvZRyuKlYhVBepJGo5chWzBXIBUCEaAZC /SfXuCne1AU5G3qKG4UR/YcA3i6KXw5IgqPWpEjW/ZIWFPh42ctXp1wqnqXMpjc= =sIyY -----END PGP SIGNATURE----- --------------enigF8600E5BCBE6B9D3D5049039-- From debbugs-submit-bounces@debbugs.gnu.org Tue Mar 22 02:15:28 2011 Received: (at 8263-done) by debbugs.gnu.org; 22 Mar 2011 06:15:28 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q1usJ-0008Am-IK for submit@debbugs.gnu.org; Tue, 22 Mar 2011 02:15:27 -0400 Received: from mx.meyering.net ([82.230.74.64]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q1usG-0008AX-5X for 8263-done@debbugs.gnu.org; Tue, 22 Mar 2011 02:15:25 -0400 Received: by rho.meyering.net (Acme Bit-Twister, from userid 1000) id 0FCDF600DA; Tue, 22 Mar 2011 07:15:17 +0100 (CET) From: Jim Meyering To: Eric Blake Subject: Re: bug#8263: [PATCH] Allow == as synonym for = in test In-Reply-To: <4D874F26.6030703@redhat.com> (Eric Blake's message of "Mon, 21 Mar 2011 07:14:14 -0600") References: <4D8743C2.801@draigBrady.com> <4D874F26.6030703@redhat.com> Date: Tue, 22 Mar 2011 07:15:16 +0100 Message-ID: <8739mfk7ez.fsf@rho.meyering.net> Lines: 164 MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -5.9 (-----) X-Debbugs-Envelope-To: 8263-done Cc: dwheeler@dwheeler.com, =?iso-8859-1?Q?P=E1draig?= Brady , 8263-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -5.9 (-----) Eric Blake wrote: > On 03/21/2011 06:25 AM, P=E1draig Brady wrote: >> On 15/03/11 23:39, David A. Wheeler wrote: >>> The following trivial patch makes GNU coreutils' test recognize "=3D=3D" >>> as a synonym for "=3D". This is already the case in GNU coreutils' exp= r, >>> bash, ksh, busybox ash, FreeBSD-current /bin/sh and /bin/test, and >>> OpenBSD's /bin/sh. These are only a few lines, so I don't think >>> any paperwork is needed. The following implements "=3D=3D" and documen= ts it. >> >> Related http://austingroupbugs.net/view.php?id=3D375 >> I'm leaning towards accepting this. >> >> Note dash does not support =3D=3D, nor does older busybox ash. >> dash seem to be waiting for the POSIX acceptance before changing? > > Yes, that's my read of the similar thread on the dash list - dash is > waiting for the Austin Group ruling to take place first. But coreutils > already has several extensions not in dash (it's closer to bash), so we > might as well go with it now. I'm in favor of this patch. I agree. Here are three c-sets I expect to push later today: - David's patch with an adjusted log message - NEWS+test - gnulib update (unrelated) I'm closing this ticket, too. >From 3f31ec950b78309a0d12d92d87a735b8870a2289 Mon Sep 17 00:00:00 2001 From: David A. Wheeler Date: Tue, 22 Mar 2011 06:03:55 +0100 Subject: [PATCH 1/3] test: accept "=3D=3D" as a synonym for "=3D" Make GNU coreutils' test recognize "=3D=3D" as a synonym for "=3D". This is already the case in GNU coreutils' expr, bash, ksh, busybox ash, FreeBSD-current /bin/sh and /bin/test, and OpenBSD's /bin/sh. Before, env test a '=3D=3D' a would fail with this diagnostic: "test: =3D=3D: binary operator expected". Now, it succeeds. * src/test.c: Accept "=3D=3D" as a synonym for "=3D". * doc/coreutils.texi (String tests): Document it. Reported as http://debbugs.gnu.org/8263 Also see http://austingroupbugs.net/view.php?id=3D375 --- doc/coreutils.texi | 7 ++++++- src/test.c | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 8dd1ed8..46deeed 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -11535,7 +11535,7 @@ test invocation * File type tests:: -[bcdfhLpSt] * Access permission tests:: -[gkruwxOG] * File characteristic tests:: -e -s -nt -ot -ef -* String tests:: -z -n =3D !=3D +* String tests:: -z -n =3D =3D=3D !=3D * Numeric tests:: -eq -ne -lt -le -gt -ge * Connectives for test:: ! -a -o @end menu @@ -11726,6 +11726,11 @@ String tests @cindex equal string check True if the strings are equal. +@item @var{string1} =3D=3D @var{string2} +@opindex =3D=3D +@cindex equal string check +True if the strings are equal (synonym for =3D). + @item @var{string1} !=3D @var{string2} @opindex !=3D @cindex not-equal string check diff --git a/src/test.c b/src/test.c index 2d7aa67..362df65 100644 --- a/src/test.c +++ b/src/test.c @@ -173,7 +173,8 @@ get_mtime (char const *filename, struct timespec *mtime) static bool binop (char const *s) { - return ((STREQ (s, "=3D")) || (STREQ (s, "!=3D")) || (STREQ (s, "-nt"= )) || + return ((STREQ (s, "=3D")) || (STREQ (s, "!=3D")) || (STREQ (s, "=3D= =3D")) || + (STREQ (s, "-nt")) || (STREQ (s, "-ot")) || (STREQ (s, "-ef")) || (STREQ (s, "-eq")) || (STREQ (s, "-ne")) || (STREQ (s, "-lt")) || (STREQ (s, "-le")) || (STREQ (s, "-gt")) || (STREQ (s, "-ge"))); @@ -360,7 +361,8 @@ binary_operator (bool l_is_l) test_syntax_error (_("unknown binary operator"), argv[op]); } - if (argv[op][0] =3D=3D '=3D' && !argv[op][1]) + if (argv[op][0] =3D=3D '=3D' && (!argv[op][1] || + ((argv[op][1] =3D=3D '=3D') && !argv[op][2]))) { bool value =3D STREQ (argv[pos], argv[pos + 2]); pos +=3D 3; -- 1.7.4.1.514.ga171c >From b3f6b33e4b31667b9b43708730f6f75f25e8ff57 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 22 Mar 2011 06:07:35 +0100 Subject: [PATCH 2/3] tests: exercise tests new "=3D=3D" operator * tests/misc/test: Exercise the new operator. * NEWS (Changes in behavior): Mention it. --- NEWS | 4 ++++ tests/misc/test | 2 ++ 2 files changed, 6 insertions(+), 0 deletions(-) diff --git a/NEWS b/NEWS index 9ceaa06..b2674c0 100644 --- a/NEWS +++ b/NEWS @@ -26,6 +26,10 @@ GNU coreutils NEWS -*= - outline -*- which will discard any cache associated with the files, or processed portion thereof. +** Changes in behavior + + test now accepts "=3D=3D" as a synonym for "=3D" + * Noteworthy changes in release 8.10 (2011-02-04) [stable] diff --git a/tests/misc/test b/tests/misc/test index 396660b..f515b7f 100755 --- a/tests/misc/test +++ b/tests/misc/test @@ -132,6 +132,8 @@ my @Tests =3D ['streq-1', qw(t =3D t)], ['streq-2', qw(t =3D f), {EXIT=3D>1}], + ['streqeq-1', qw(t =3D=3D t)], + ['streqeq-2', qw(t =3D=3D f), {EXIT=3D>1}], ['streq-3', qw(! =3D !)], ['streq-4', qw(=3D =3D =3D)], ['streq-5', "'(' =3D '('"], -- 1.7.4.1.514.ga171c >From 437fcf713c237f45f9504bb8bdc6041f65663b36 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 22 Mar 2011 06:09:06 +0100 Subject: [PATCH 3/3] build: update gnulib submodule to latest --- gnulib | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/gnulib b/gnulib index 0baae9c..1a22d91 160000 --- a/gnulib +++ b/gnulib @@ -1 +1 @@ -Subproject commit 0baae9cadd08c9704e3c704dd69fb75640293e9d +Subproject commit 1a22d910adea20751cc5649b224574d07ba72815 -- 1.7.4.1.514.ga171c From unknown Mon Aug 18 02:32:46 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 19 Apr 2011 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator