From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from tiger.gg3.net (142.13.111.219.st.bbexcite.jp [219.111.13.142]) by robin.gentoo.org (8.13.4/8.13.4) with ESMTP id j5B03NLq018806 for ; Sat, 11 Jun 2005 00:03:24 GMT Received: (qmail 11626 invoked by uid 89); 11 Jun 2005 09:04:25 +0900 Received: from lion.gg3.net (HELO lion) (10.0.0.2) by 0 with SMTP; 11 Jun 2005 09:04:25 +0900 Received: by lion (sSMTP sendmail emulation); Sat, 11 Jun 2005 09:04:25 +0900 Date: Sat, 11 Jun 2005 09:04:25 +0900 From: Georgi Georgiev To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] ekeyword and ordering Message-ID: <20050611000425.GA8461@lion.gg3.net> Mail-Followup-To: gentoo-dev@lists.gentoo.org References: <20050606222623.GI9084@kaf.zko.hp.com> <200506061841.11356.vapier@gentoo.org> <42A4D308.9030104@gentoo.org> <42A59038.4060108@gentoo.org> <42A60A72.10200@gentoo.org> <1118323176.29369.26.camel@rivendell> <42A8653F.3060409@gentoo.org> <1118415317.13269.31.camel@rivendell> <20050610171930.GD7429@olive.flatmonk> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Reply-to: gentoo-dev@lists.gentoo.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="IS0zKkzwUGydFO0o" Content-Disposition: inline In-Reply-To: <20050610171930.GD7429@olive.flatmonk> User-Agent: Mutt/1.5.8i X-Archives-Salt: 2b687049-aa43-430f-acef-1dad444665cd X-Archives-Hash: 6f84f32c172f9386c57da26c1c3e99f9 --IS0zKkzwUGydFO0o Content-Type: text/plain; charset=us-ascii Content-Disposition: inline maillog: 10/06/2005-13:19:30(-0400): Aron Griffis types > Btw, here's an interesting statistic which really doesn't add to (or > detract from, I hope) this discussion... > > grep -hr --include=\*.ebuild '^KEYWORDS=' /usr/portage | perl -ne ' > s/[^[:lower:]\s]//; @F = split; @S = sort @F; $sorted++ if "@F" eq "@S"; > END { printf "%d%% of ebuilds are sorted (%d/%d)\n", 100*$sorted/$., $sorted, $. }' > > 49% of ebuilds are sorted (9435/19174) Your statistic seems to be flawed on a number of occasions. Assume KEYWORDS="x86 ppc" s/[^[:lower:]\s]//; The above would only remove the "K" from "KEYWORDS" so you're left with "EYWORDS="x86 ppc"; @F = split; and you get an array of elements like: $F[0] = 'EYWORDS="x86'; $F[1] = 'ppc"'; The sorted @S, would always have the capital "E" (and the first keyword) as first element, because it's a capital letter. Keywords that start with "~" will be grouped together after the stable keywords, and I am guessing the idea is to have "~ppc" before "x86". The above three statements do not depend on your locale, as perl does not use locales by default: $ echo 'a b A B ~a ~b ~A ~B' | LC_ALL=en_US perl -ne '@s = sort split; print "@s\n"' A B a b ~A ~B ~a ~b $ echo 'a b A B ~a ~b ~A ~B' | LC_ALL=en_US perl -ne 'use locale; @s = sort split; print "@s\n"' a ~a A ~A b ~b B ~B -- | Georgi Georgiev | NT 5.0 so vaporous it's in danger of being | | chutz@gg3.net | added to the periodic table as a noble | | +81(90)2877-8845 | gas. -- From Slashdot.org | --IS0zKkzwUGydFO0o Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) iD8DBQFCqiqJfXO2NUT1EmYRAj/rAJ0cMokUE4iiN1tdINUbeZVVZav42QCg5DGh 3KlGLMEqbDLSCy8DK6UnLxI= =GeXu -----END PGP SIGNATURE----- --IS0zKkzwUGydFO0o-- -- gentoo-dev@gentoo.org mailing list