Skip site navigation (1)Skip section navigation (2)
Date:      1 Jul 1999 00:00:07 +0900
From:      sada@rr.IIJ4U.OR.JP (SADA Kenji)
To:        asami@freebsd.org
Cc:        ports@freebsd.org
Subject:   Re: speeding up INDEX generation
Message-ID:  <19990630150007.3438.sada@rr.iij4u.or.jp>
In-Reply-To: Your message of "Sun, 27 Jun 1999 17:37:04 JST". <199906270837.BAA49796@silvia.hip.berkeley.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
This is sada from Nagoya.

>> The order of INDEX lines are totally scrambled so we need to change
>> Tools/make_index to sort it by the second field or something.  (Steve,
>> did we ever find out a way to sort it so that "x11/foo" comes before
>> "x11-toolkits/bar"?)

Does this work well ?

#!/usr/bin/perl
while (<>) {
	my $line = $_;
	@F = split(/\|/);
	my $k = $F[1];
	$index{$k} = $line;
}
foreach $key (sort compare (keys %index)) {
	print $index{$key};
}
sub compare {
	my @a = split(/\//, $a);
	my @b = split(/\//, $b);
	my $a0, $b0;
	do {
		$a0 = shift(@a);
		$b0 = shift(@b);
	} until $a0 ne $b0;
	$a0 cmp $b0;
}


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19990630150007.3438.sada>