Assaf Gordon <assafgordon@HIDDEN>
to control <at> debbugs.gnu.org
.
Full text available.Assaf Gordon <assafgordon@HIDDEN>
to control <at> debbugs.gnu.org
.
Full text available.Received: (at 8032) by debbugs.gnu.org; 15 Feb 2011 15:33:57 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Tue Feb 15 10:33:57 2011 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1PpMub-0005IM-1J for submit <at> debbugs.gnu.org; Tue, 15 Feb 2011 10:33:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from <eblake@HIDDEN>) id 1PpMuX-0005I9-QH for 8032 <at> debbugs.gnu.org; Tue, 15 Feb 2011 10:33:55 -0500 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 p1FFgrtK010695 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 15 Feb 2011 10:42:53 -0500 Received: from [10.3.113.118] (ovpn-113-118.phx2.redhat.com [10.3.113.118]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p1FFgo3e020770; Tue, 15 Feb 2011 10:42:50 -0500 Message-ID: <4D5A9EFA.7050201@HIDDEN> Date: Tue, 15 Feb 2011 08:42:50 -0700 From: Eric Blake <eblake@HIDDEN> Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7 MIME-Version: 1.0 To: Paul E Condon <pecondon@HIDDEN>, 8032 <at> debbugs.gnu.org Subject: Re: bug#8032: Suggestion in re. error reports from 'comm' References: <20110213202708.GA7100@HIDDEN> <4D596755.4090703@HIDDEN> <20110215025150.GC30082@HIDDEN> In-Reply-To: <20110215025150.GC30082@HIDDEN> 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="------------enigAB915015A7F6352F76FBF864" X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 X-Spam-Score: -10.2 (----------) X-Debbugs-Envelope-To: 8032 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Sender: debbugs-submit-bounces <at> debbugs.gnu.org Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org X-Spam-Score: -10.2 (----------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigAB915015A7F6352F76FBF864 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable [let's keep the list in the loop] On 02/14/2011 07:51 PM, Paul E Condon wrote: >> Thanks for the report. Yes, per POSIX, the following list of rules >> should apply to ALL utilities that perform sorting (first one that >> applies wins): >> >> If LC_ALL is non-empty, honor that >> If LC_COLLATE is non-empty, honor that >> If LANG is non-empty, honor that >> Use an implementation-defined default. >=20 > My facilities for testing these issue are limited. Thanks for > this information.=20 >=20 > My script is not yet well written. I had always supposed that the > actual existence of scripts that are not well written is the > justification for spending time writing useful error messages and > even the justification for the existence of syserr >=20 > I'm not surprised that my second suggestion is not OK. My first > suggestion was to modify the error message that is emitted by 'comm'. >=20 > Now that I better understand that there are four possible classes of > collating sequences involved, I can refine my suggestion: Change the > text of the error message about a file not being in sort order to > append "according to collation rule: <and place here the rule>" For > the fourth case (implementation dependent). it would be nice to invent > a wording that is shorter than 'implementation dependent'. >=20 > This could be useful to people debugging scripts on many platforms. > I can imagine a programmer getting major help from a message >=20 > "file 2 is not in sort order according to LC_COLLATE=3DC" Ah, so your suggestion is to make the error message smarter, by adding a clause which says which environment variable or system default determined the current collation order, as well as which locale is currently in use. That actually sounds like a nice idea! Would you care to help write the code? --=20 Eric Blake eblake@HIDDEN +1-801-349-2682 Libvirt virtualization library http://libvirt.org --------------enigAB915015A7F6352F76FBF864 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/ iQEcBAEBCAAGBQJNWp76AAoJEKeha0olJ0NqIV0H/ju2cYjdYikE5+1kUoOJNF85 XLceb/UQmFAzvrNRkssVI+fIAPHBnWSgGjndp2GC6w4/qXC33dkovl03qmLrpUYc iHZRmgJ+NHB8eBclOOcPpgSF0dzsjur5yGJiyt97UMORDVCLA40zH2nDmEZw+WxH uZyR+7TUAUczlhUb/IvLzz8W+rMEdFxIaSuRrMq7k9ia1TJpjicd3rYd1l4enO7c Zvi/zt6vazPqd8NyOsQUITVdoWZiM/dLjWb4Y3r/JIzU30pcfKm7mM5m1UU8q09H yGeVSlNd6QiiQhRN5OJkyvIFH/ZoWL4Ckl0VqPFvebNN2b69LM6iTeLdjAaoTtE= =+9aT -----END PGP SIGNATURE----- --------------enigAB915015A7F6352F76FBF864--
owner <at> debbugs.gnu.org, bug-coreutils@HIDDEN
:bug#8032
; Package coreutils
.
Full text available.Received: (at 8032) by debbugs.gnu.org; 14 Feb 2011 17:24:17 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Mon Feb 14 12:24:17 2011 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1Pp29o-0003B5-AM for submit <at> debbugs.gnu.org; Mon, 14 Feb 2011 12:24:16 -0500 Received: from mx1.redhat.com ([209.132.183.28]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from <eblake@HIDDEN>) id 1Pp29l-0003Aq-UU for 8032 <at> debbugs.gnu.org; Mon, 14 Feb 2011 12:24:15 -0500 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 p1EHXAF7017535 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 14 Feb 2011 12:33:11 -0500 Received: from [10.3.113.118] (ovpn-113-118.phx2.redhat.com [10.3.113.118]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p1EHX9wf001685; Mon, 14 Feb 2011 12:33:10 -0500 Message-ID: <4D596755.4090703@HIDDEN> Date: Mon, 14 Feb 2011 10:33:09 -0700 From: Eric Blake <eblake@HIDDEN> Organization: Red Hat User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.13) Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Mnenhy/0.8.3 Thunderbird/3.1.7 MIME-Version: 1.0 To: Paul E Condon <pecondon@HIDDEN> Subject: Re: bug#8032: Suggestion in re. error reports from 'comm' References: <20110213202708.GA7100@HIDDEN> In-Reply-To: <20110213202708.GA7100@HIDDEN> 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="------------enig7671BAEE2239F9DE0FD2AEE3" X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Spam-Score: -10.2 (----------) X-Debbugs-Envelope-To: 8032 Cc: 8032 <at> debbugs.gnu.org X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Sender: debbugs-submit-bounces <at> debbugs.gnu.org Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org X-Spam-Score: -10.2 (----------) This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig7671BAEE2239F9DE0FD2AEE3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 02/13/2011 01:27 PM, Paul E Condon wrote: > 'comm' uses LC_COLLATE or LC_ALL to establish the collation that it > uses in its check for proper sorting of input. (I think this is true.) Thanks for the report. Yes, per POSIX, the following list of rules should apply to ALL utilities that perform sorting (first one that applies wins): If LC_ALL is non-empty, honor that If LC_COLLATE is non-empty, honor that If LANG is non-empty, honor that Use an implementation-defined default. Some implementations set the implementation-defined default to the C locale, but that is not universally true. >=20 > The man page and info make no mention of LC_ALL (at least not as > delivered in Debian squeeze) but LC_ALL seems to affect 'comm' > behavior. You are correct that none of the coreutils man pages mention the effect of LC_* and LANG environment variables; our excuse is that they are so universally applicable that it is assumed that you are aware of their effect on all utilities. But patches are welcome to correct the man pages, if you think it would help. Also, a patch to the info pages to add a detailed section with chapter 2 Common Options, discussing the effect of all LC_*/LANG environment variables on all coreutils, would be appreciated. > When neither LC_COLLATE nor LC_ALL is defined, 'comm' reports that the > file is out of order. I think this is misleading. I think it should > instead report that no LC_* is defined.=20 How is coreutils supposed to know the difference between an environment variable not being defined being an error, vs. an environment variable not being defined meaning that you explicitly wanted the implementation-defined default? >=20 > Alteratively, it might be OK to silently assume the definition, > LC_COLLATE=3DC No, it is NOT silently okay to do that. Coreutils uses setlocale(LC_ALL,""), which is the POSIX-blessed means for determining the four-step collation choice documented above. Either you provide one of the three variables that affects sorting, or you get the implementation-defined default. >=20 > I discovered this situation while writing (and debugging) a shell > script that I wanted to work when invoked from /etc/cron.daily. =20 > The scipt leaves a sorted file in disk for use in the next day run. > Naturely, during testing I seeded that files from manual runs of > the script. Always, when I set up what I thought was a working version,= > the script, as run from cron failed with message that the file(s) > was/were out of order. Yes, I should have figured it out, and I=20 > finally have. But it would have been so much faster if ... Any well-written script that depends on not being interrupted by localization settings will explicitly set LC_ALL (or specific categories) as needed, rather than relying on defaults. That's a fact of life for modern script-writing, and a lesson that unfortunately is learned more often by experience than by documentation. Changing coreutils to fail when the variable is not set, rather than going with the implementation-defined default, would unfortunately violate POSIX. --=20 Eric Blake eblake@HIDDEN +1-801-349-2682 Libvirt virtualization library http://libvirt.org --------------enig7671BAEE2239F9DE0FD2AEE3 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/ iQEcBAEBCAAGBQJNWWdVAAoJEKeha0olJ0Nq/lwIAJBvYDE52eazmmg4MV/SGZAQ vELvd0pKVZ/TSIgxVOzIUok/A16K79Rj24frju2zo4himadUqj1haHBxZbdSg10i MbQBkjNKiJ8kVshQmHASChhwYfGHrPPxKFxxxkEo+VHA0pBcAAzl6hpDCt0mzFVR Brb2j6PLiLuIIw03+oj89Lv4ZoBeJWuQBOYoilPwH3bzwzL4lF/rXd7i6YRMA3sW kSeXQzV2WDnILBMwrkJn8SwzspcOxTjfHmcm6FYEG5+xJSi/sZDr6yQlUAx3pu7E kw5pkN3OWMWRSL6A4qVMC42Wl7WUMboIYjp4xA9at6SHup/YgGSTPZWL16bp91I= =9yT+ -----END PGP SIGNATURE----- --------------enig7671BAEE2239F9DE0FD2AEE3--
owner <at> debbugs.gnu.org, bug-coreutils@HIDDEN
:bug#8032
; Package coreutils
.
Full text available.Received: (at submit) by debbugs.gnu.org; 13 Feb 2011 20:22:46 +0000 From debbugs-submit-bounces <at> debbugs.gnu.org Sun Feb 13 15:22:46 2011 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>) id 1PoiSz-0004i2-Kj for submit <at> debbugs.gnu.org; Sun, 13 Feb 2011 15:22:45 -0500 Received: from eggs.gnu.org ([140.186.70.92]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from <pecondon@HIDDEN>) id 1PoiOi-0004bw-Fu for submit <at> debbugs.gnu.org; Sun, 13 Feb 2011 15:18:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <pecondon@HIDDEN>) id 1PoiXK-0003Tu-Sh for submit <at> debbugs.gnu.org; Sun, 13 Feb 2011 15:27:15 -0500 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, RCVD_IN_DNSWL_NONE, RFC_ABUSE_POST autolearn=unavailable version=3.3.1 Received: from lists.gnu.org ([199.232.76.165]:38853) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <pecondon@HIDDEN>) id 1PoiXK-0003Tn-PG for submit <at> debbugs.gnu.org; Sun, 13 Feb 2011 15:27:14 -0500 Received: from [140.186.70.92] (port=57812 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PoiXJ-0005Jx-MJ for bug-coreutils@HIDDEN; Sun, 13 Feb 2011 15:27:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <pecondon@HIDDEN>) id 1PoiXI-0003Sg-92 for bug-coreutils@HIDDEN; Sun, 13 Feb 2011 15:27:13 -0500 Received: from imta-38.everyone.net ([216.200.145.38]:42469) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <pecondon@HIDDEN>) id 1PoiXH-0003SN-IO for bug-coreutils@HIDDEN; Sun, 13 Feb 2011 15:27:11 -0500 Received: from pps.filterd (omta003 [127.0.0.1]) by imta-38.everyone.net (8.14.4/8.14.4) with SMTP id p1DKQiGr019144 for <bug-coreutils@HIDDEN>; Sun, 13 Feb 2011 12:27:09 -0800 Received: from dm0205.mta.everyone.net (lb009-10-float.sj2.proofpoint.com [172.16.0.1]) by imta-38.everyone.net with ESMTP id uep5y81sh-1 for <bug-coreutils@HIDDEN>; Sun, 13 Feb 2011 12:27:09 -0800 X-Eon-Dm: dm0205 Received: by dm0205.mta.everyone.net (EON-AUTHRELAY2 - 4813b144) id dm0205.4d561727.2e6028 for <bug-coreutils@HIDDEN>; Sun, 13 Feb 2011 12:27:09 -0800 X-Eon-Sig: AQMnnbRNWD6dylqnOwIAAAAB,6d4d8af650e59e4500bda43be811fbc5 Received: from pec by big.lan.gnu with local (Exim 4.72) (envelope-from <pecondon@HIDDEN>) id 1PoiXE-0001vR-Oa for bug-coreutils@HIDDEN; Sun, 13 Feb 2011 13:27:08 -0700 Date: Sun, 13 Feb 2011 13:27:08 -0700 From: Paul E Condon <pecondon@HIDDEN> To: bug-coreutils@HIDDEN Subject: Suggestion in re. error reports from 'comm' Message-ID: <20110213202708.GA7100@HIDDEN> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 ipscore=0 suspectscore=1 phishscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=6.0.2-1012030000 definitions=main-1102130100 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-Received-From: 216.200.145.38 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 199.232.76.165 X-Spam-Score: -6.6 (------) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 13 Feb 2011 15:22:45 -0500 X-BeenThere: debbugs-submit <at> debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: <debbugs-submit.debbugs.gnu.org> List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe> List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit> List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org> List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help> List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe> Sender: debbugs-submit-bounces <at> debbugs.gnu.org Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org X-Spam-Score: -6.6 (------) 'comm' uses LC_COLLATE or LC_ALL to establish the collation that it uses in its check for proper sorting of input. (I think this is true.) The man page and info make no mention of LC_ALL (at least not as delivered in Debian squeeze) but LC_ALL seems to affect 'comm' behavior. When neither LC_COLLATE nor LC_ALL is defined, 'comm' reports that the file is out of order. I think this is misleading. I think it should instead report that no LC_* is defined. Alteratively, it might be OK to silently assume the definition, LC_COLLATE=C I discovered this situation while writing (and debugging) a shell script that I wanted to work when invoked from /etc/cron.daily. The scipt leaves a sorted file in disk for use in the next day run. Naturely, during testing I seeded that files from manual runs of the script. Always, when I set up what I thought was a working version, the script, as run from cron failed with message that the file(s) was/were out of order. Yes, I should have figured it out, and I finally have. But it would have been so much faster if ... -- Paul E Condon pecondon@HIDDEN
Paul E Condon <pecondon@HIDDEN>
:bug-coreutils@HIDDEN
.
Full text available.owner <at> debbugs.gnu.org, bug-coreutils@HIDDEN
:bug#8032
; Package coreutils
.
Full text available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997 nCipher Corporation Ltd,
1994-97 Ian Jackson.