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   |
|     [EMAIL PROTECTED]    |  added to the periodic table as a noble       |
|   +81(90)2877-8845   |  gas. -- From Slashdot.org                    |

Attachment: pgpcjhbScd7mP.pgp
Description: PGP signature

Reply via email to