From owner-freebsd-ports Wed Jun 30 8: 0:12 1999 Delivered-To: freebsd-ports@freebsd.org Received: from rr.iij4u.or.jp (h098.p060.iij4u.or.jp [210.130.60.98]) by hub.freebsd.org (Postfix) with SMTP id 83C3715054 for ; Wed, 30 Jun 1999 08:00:08 -0700 (PDT) (envelope-from sada@rr.iij4u.or.jp) Received: (qmail 3439 invoked by uid 1000); 1 Jul 1999 00:00:07 +0900 Date: 1 Jul 1999 00:00:07 +0900 Message-ID: <19990630150007.3438.sada@rr.iij4u.or.jp> To: asami@freebsd.org Cc: ports@freebsd.org Subject: Re: speeding up INDEX generation In-Reply-To: Your message of "Sun, 27 Jun 1999 17:37:04 JST". <199906270837.BAA49796@silvia.hip.berkeley.edu> From: sada@rr.IIJ4U.OR.JP (SADA Kenji) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Mailer: mnews [version 1.21] 1997-12/23(Tue) Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org 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