Skip site navigation (1)Skip section navigation (2)
Date:      09 Jul 2002 00:44:18 +0300
From:      Ville =?ISO-8859-1?Q?Skytt=E4?= <scop@FreeBSD.org>
To:        knu@FreeBSD.org, Vassilii.Khachaturov@comverse.com
Cc:        freebsd-cvsweb@FreeBSD.org
Subject:   RE: FW: [PATCH] fileSortCmp() should properly weed out rogue non- dir  files
Message-ID:  <1026164659.32411.680.camel@bobcat.ods.org>
In-Reply-To: <6B1DF6EEBA51D31182F200902740436803B24BBA@mail-in.comverse.com>
References:  <6B1DF6EEBA51D31182F200902740436803B24BBA@mail-in.comverse.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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  <scop@FreeBSD.org>
+
+	* 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" <vassilii@tarunz.org>]
+
 2002-07-06  Ville Skytt=E4  <scop@FreeBSD.org>
=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      <fenner@FreeBSD.org>   (original work)
-# extended by Henner Zeller    <zeller@think.de>,
-#             Henrik Nordstrom <hno@hem.passagen.se>
-#             Ken Coar         <coar@Apache.Org>
-#             Dick Balaska     <dick@buckosoft.com>
-#             Akinori MUSHA    <knu@FreeBSD.org>
-#             Jens-Uwe Mager   <jum@helios.de>
-#             Ville Skytt=E4     <scop@FreeBSD.org>
+#             Bill Fenner          <fenner@FreeBSD.org>   (original work)
+# extended by Henner Zeller        <zeller@think.de>,
+#             Henrik Nordstrom     <hno@hem.passagen.se>
+#             Ken Coar             <coar@Apache.Org>
+#             Dick Balaska         <dick@buckosoft.com>
+#             Akinori MUSHA        <knu@FreeBSD.org>
+#             Jens-Uwe Mager       <jum@helios.de>
+#             Ville Skytt=E4         <scop@FreeBSD.org>
+#             Vassilii Khachaturov <vassilii@tarunz.org>
 #
 # 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




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