From owner-freebsd-cvsweb Mon Jul 8 14:44:15 2002 Delivered-To: freebsd-cvsweb@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7094C37B400; Mon, 8 Jul 2002 14:44:12 -0700 (PDT) Received: from posti.pp.htv.fi (posti.pp.htv.fi [212.90.64.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id C630043E54; Mon, 8 Jul 2002 14:44:10 -0700 (PDT) (envelope-from scop@FreeBSD.org) Received: from cs78128057.pp.htv.fi ([62.78.128.57]) by posti.pp.htv.fi (8.11.1/8.11.1) with ESMTP id g68Li8523822; Tue, 9 Jul 2002 00:44:08 +0300 (EETDST) Subject: RE: FW: [PATCH] fileSortCmp() should properly weed out rogue non- dir files From: Ville =?ISO-8859-1?Q?Skytt=E4?= To: knu@FreeBSD.org, Vassilii.Khachaturov@comverse.com Cc: freebsd-cvsweb@FreeBSD.org In-Reply-To: <6B1DF6EEBA51D31182F200902740436803B24BBA@mail-in.comverse.com> References: <6B1DF6EEBA51D31182F200902740436803B24BBA@mail-in.comverse.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Mailer: Ximian Evolution 1.0.3 (1.0.3-6) Date: 09 Jul 2002 00:44:18 +0300 Message-Id: <1026164659.32411.680.camel@bobcat.ods.org> Mime-Version: 1.0 Sender: owner-freebsd-cvsweb@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Mon, 2002-07-08 at 18:26, Khachaturov Vassilii wrote: > > Could you shed a bit more light on this, I can't verify the problem > > here. I'm unable to get non-,v files in the repo dirs to show up in > > CVSweb's directory listings or the sort orders to break... >=20 > The rogue files never show in the directory listings by CVSweb, > but they do get fed to the comparison routine. [long and good patch description snipped] Allright, you're correct. Turns out to be that the initial data I tested this with wasn't good enough and didn't trigger the bug, sorry about that. But now I've verified both the bug and the fix. Still need knu's approval before committing... I did small tweaks to the original patch (comments only) and removed the TODO part that was already committed in CVS. Thanks, Vassilii, good catch! Index: ChangeLog =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/projects/cvsweb/ChangeLog,v retrieving revision 1.49 diff -a -u -r1.49 ChangeLog --- ChangeLog 6 Jul 2002 18:15:19 -0000 1.49 +++ ChangeLog 8 Jul 2002 21:34:07 -0000 @@ -1,5 +1,12 @@ $FreeBSD: projects/cvsweb/ChangeLog,v 1.49 2002/07/06 18:15:19 scop Exp $ =09 +2002-07-09 Ville Skytt=E4 + + * cvsweb.cgi (fileSortCmp): Fix dir sort order breakage when + there are rogue files in the repository dir and the sort order + is not by file name. + [Submitted by: "Khachaturov, Vassilii" ] + 2002-07-06 Ville Skytt=E4 =20 * cvsweb.conf (long_intro): Remove authors' email addresses. Index: cvsweb.cgi =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /home/ncvs/projects/cvsweb/cvsweb.cgi,v retrieving revision 1.112 diff -a -u -r1.112 cvsweb.cgi --- cvsweb.cgi 6 Jul 2002 18:15:19 -0000 1.112 +++ cvsweb.cgi 8 Jul 2002 21:34:09 -0000 @@ -3,14 +3,15 @@ # cvsweb - a CGI interface to CVS trees. # # Written in their spare time by -# Bill Fenner (original work) -# extended by Henner Zeller , -# Henrik Nordstrom -# Ken Coar -# Dick Balaska -# Akinori MUSHA -# Jens-Uwe Mager -# Ville Skytt=E4 +# Bill Fenner (original work) +# extended by Henner Zeller , +# Henrik Nordstrom +# Ken Coar +# Dick Balaska +# Akinori MUSHA +# Jens-Uwe Mager +# Ville Skytt=E4 +# Vassilii Khachaturov # # Based on: # * Bill Fenners cvsweb.cgi revision 1.28 available from: @@ -3376,10 +3377,14 @@ =20 if ($comp =3D=3D 0) { =20 - # Directories first, then sorted on name if no other sort critera - # available. - my $ad =3D ((-d "$fullname/$a") ? "D" : "F"); - my $bd =3D ((-d "$fullname/$b") ? "D" : "F"); + # Directories first, then files under version control, + # then other, "rogue" files. + # Sort by filename if no other criteria available. + + my $ad =3D ((-d "$fullname/$a") ? 'D' + : (defined($fileinfo{$af}) ? 'F' : 'R')); + my $bd =3D ((-d "$fullname/$b") ? 'D' + : (defined($fileinfo{$bf}) ? 'F' : 'R')); ($c =3D $a) =3D~ s|.*/||; ($d =3D $b) =3D~ s|.*/||; $comp =3D ("$ad$c" cmp "$bd$d"); --=20 \/ille Skytt=E4 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-cvsweb" in the body of the message