From owner-freebsd-cvsweb Fri Nov 22 8:35:42 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 C624937B401 for ; Fri, 22 Nov 2002 08:35:40 -0800 (PST) Received: from atrey.karlin.mff.cuni.cz (atrey.karlin.mff.cuni.cz [195.113.31.123]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9813E43EA9 for ; Fri, 22 Nov 2002 08:35:39 -0800 (PST) (envelope-from tnovak@atrey.karlin.mff.cuni.cz) Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 15349) id A850C4F91D; Fri, 22 Nov 2002 17:35:27 +0100 (CET) Date: Fri, 22 Nov 2002 17:35:27 +0100 From: Tomas Novak To: freebsd-cvsweb@FreeBSD.org Subject: Missing files in the list Message-ID: <20021122163527.GD21698@atrey.karlin.mff.cuni.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i 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 Hi. Sometimes (probably if there is too many files in the repository) some files are not listed by cvsweb. So I guess there is a problem with passing all the filenames as arguments to rlog. I have tried to fix it using xargs and it works well. Unfortunately this solution needs a tempfile. Patch follows. TNT PS: At first I have tried it on RedHat Linux 6.2 running Apache 1.3.14, but now on RH 8.0 with Apache 2.0.40 it seems OK (without my patch). So sorry if the problem is somewhere else... --- bigrepo.patch ------------------------------------------------------- diff -ur cvsweb-2.0.6.orig/cvsweb.cgi cvsweb-2.0.6/cvsweb.cgi --- cvsweb-2.0.6.orig/cvsweb.cgi Thu Sep 26 20:56:05 2002 +++ cvsweb-2.0.6/cvsweb.cgi Fri Nov 22 15:37:40 2002 @@ -2124,21 +2124,23 @@ return; } - if (defined($tag)) { - - #can't use -r as - is allowed in tagnames, but misinterpreated by rlog.. - if (!open($fh, "-|")) { # child - open(STDERR, '>/dev/null'); # rlog may complain; ignore. - openOutputFilter(); - exec($CMD{rlog}, @files) or exit -1; - } - } else { - - if (!open($fh, "-|")) { # child - open(STDERR, '>/dev/null'); # rlog may complain; ignore. - openOutputFilter(); - exec($CMD{rlog}, '-r', @files) or exit -1; - } + #can't use -r as - is allowed in tagnames, but misinterpreated by rlog.. + # too many files for command line - we need a tempfile and xargs it + my $tempfile = "/tmp/cvsweb-filelist-$$"; + open(TEMPF, ">$tempfile") or die "Cant open temp file: $tempfile\n"; + foreach my $f (@files) { + print TEMPF "$f\n"; + } + close(TEMPF); + + my $command = $CMD{rlog}; + $command .= " -r" if (!defined($tag)); + $command = "/usr/bin/xargs -r -n1 $command <$tempfile"; + + if (!open($fh, "-|")) { # child + open(STDERR, '>/dev/null'); # rlog may complain; ignore. + openOutputFilter(); + exec($command) or exit -1; } $state = "start"; To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-cvsweb" in the body of the message From owner-freebsd-cvsweb Fri Nov 22 15:35:44 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 8309337B401 for ; Fri, 22 Nov 2002 15:35:43 -0800 (PST) Received: from smtp3.pp.htv.fi (smtp3.pp.htv.fi [213.243.153.135]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0697A43EAA for ; Fri, 22 Nov 2002 15:35:43 -0800 (PST) (envelope-from scop@FreeBSD.org) Received: from posti.pp.htv.fi (posti.pp.htv.fi [212.90.64.50]) by smtp3.pp.htv.fi (Postfix) with ESMTP id B342427AC8B; Sat, 23 Nov 2002 01:35:36 +0200 (EET) Received: from cs78128237.pp.htv.fi ([62.78.128.237]) by posti.pp.htv.fi (8.11.1/8.11.1) with ESMTP id gAMNZaW19728; Sat, 23 Nov 2002 01:35:36 +0200 (EET) Subject: Re: Missing files in the list From: Ville =?ISO-8859-1?Q?Skytt=E4?= To: Tomas Novak Cc: freebsd-cvsweb@FreeBSD.org In-Reply-To: <20021122163527.GD21698@atrey.karlin.mff.cuni.cz> References: <20021122163527.GD21698@atrey.karlin.mff.cuni.cz> Content-Type: text/plain; charset=ISO-8859-1 Organization: FreeBSD Message-Id: <1038008235.24390.46.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.0 (1.2.0-ms1) Date: 23 Nov 2002 01:37:15 +0200 Content-Transfer-Encoding: 8bit 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 Fri, 2002-11-22 at 18:35, Tomas Novak wrote: > Sometimes (probably if there is too many files in the repository) some files > are not listed by cvsweb. So I guess there is a problem with passing all the > filenames as arguments to rlog. I have tried to fix it using xargs and it > works well. Unfortunately this solution needs a tempfile. > > Patch follows. > TNT > > PS: At first I have tried it on RedHat Linux 6.2 running Apache 1.3.14, > but now on RH 8.0 with Apache 2.0.40 it seems OK (without my patch). > So sorry if the problem is somewhere else... Thanks for the patch, Tomas. Do you have an environment where the bug is reproducible? I tried it out (also with RH8 and Apache 2.0.40) by adding some 5000'ish files to a CVS dir, but didn't see the problem you described. Instead I got an error in my Apache error log: Can't exec "/usr/bin/rlog": Argument list too long ...as well as a huge error page in my browser. If you do have a test environment which reproduces the bug, could you first try if commenting out the "open(STDERR, '>/dev/null')" lines near your patch makes something appear in the error log? I think the length of the argument list needs addressing anyway, I'll think a bit if I can come up with a non-temp-file solution to this (others welcome too). If not, I'll most likely apply your patch after a closer look. Oh, and this will go into the development branch (CVS HEAD). Cheers, -- \/ille Skyttä scop at FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-cvsweb" in the body of the message