Date: Mon, 9 Dec 2002 17:25:41 +0100 From: "Peter Klausner" <peter.klausner@systor.com> To: freebsd-cvsweb@FreeBSD.org Subject: Patch for rlog: Argument list too long Message-ID: <OFF3281668.06B887E5-ON41256C8A.00574DF7@systor.com>
index | next in thread | raw e-mail
> 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
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?OFF3281668.06B887E5-ON41256C8A.00574DF7>
