From owner-freebsd-cvsweb Mon Dec 9 8:25:52 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 6DF3437B404 for ; Mon, 9 Dec 2002 08:25:50 -0800 (PST) Received: from fapdns01.systor.com (fapdns01.systor.com [193.192.230.116]) by mx1.FreeBSD.org (Postfix) with SMTP id 5E4DE43F31 for ; Mon, 9 Dec 2002 08:25:49 -0800 (PST) (envelope-from peter.klausner@systor.com) Received: (qmail 25335 invoked from network); 9 Dec 2002 16:16:07 -0000 Received: from unknown (HELO henderson.systor.com) (172.17.247.196) by fapdns01.systor.com with SMTP; 9 Dec 2002 16:16:07 -0000 Subject: Patch for rlog: Argument list too long To: freebsd-cvsweb@FreeBSD.org X-Mailer: Lotus Notes Release 5.0.2c (Intl) 2 February 2000 Message-ID: From: "Peter Klausner" Date: Mon, 9 Dec 2002 17:25:41 +0100 X-MIMETrack: Serialize by Router on HENDERSON/SYSTOR(Release 5.0.5 |September 22, 2000) at 09.12.2002 17:25:42 MIME-Version: 1.0 Content-type: text/plain; charset=us-ascii 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 > 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 > Cannot reproduce this any more, but I *did* have an environment where this happened: * HP-UX 10.20 * Perl 5.004 built by HP-UX Software Archive & Porting Centre * 1000+ (generated) files Back then, I patched Zeller's cvsweb.cgi 1.112. The idea is to emulate xarg's behaviour within Perl, i.e. the arg list is split into manageable pieces and the external command re-run as often as needed. It does need a config variable $file_list_len, which depends on your current OS + Perl combo - I used 200 for above mention environment. The context diff for Zeller's 1.112: _______________________________________ *************** use vars qw ( *** 72,80 **** $navigationHeaderColor $tableBorderColor $markupLogColor $tabstop $state $annTable $sel $curbranch @HideModules @DissallowRead $module $use_descriptions %descriptions @mytz $dwhere $moddate ! $use_moddate $has_zlib $gzip_open ); ##### prototype declarations ######## sub printDiffSelect($); sub findLastModifiedSubdirs(@); --- 75,83 ---- $navigationHeaderColor $tableBorderColor $markupLogColor $tabstop $state $annTable $sel $curbranch @HideModules @DissallowRead $module $use_descriptions %descriptions @mytz $dwhere $moddate ! $use_moddate $has_zlib $gzip_open $file_list_len ); ##### prototype declarations ######## sub printDiffSelect($); sub findLastModifiedSubdirs(@); *************** sub getDirLogs($$@) { *** 1536,1541 **** --- 1541,1551 ---- my $kidpid = open($fh, "-|"); if (! $kidpid) { open(STDERR, "> /dev/null"); # rlog may complain; ignore. + while ($#files > $file_list_len) { # pkl: split files into chunks + my @files_chunk = (); + @files_chunk = splice(@files, 0, $file_list_len); + system("rlog","-r",@files_chunk); + } exec("rlog","-r",@files); } } _______________________________________ HTH + Bye, Peter Klausner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-cvsweb" in the body of the message