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