mirror of
https://git.freebsd.org/ports.git
synced 2025-07-10 05:49:22 -04:00
- While I'm here, convert to new options helper and support STAGEDIR Changes: https://savannah.gnu.org/forum/forum.php?forum_id=7761 PR: ports/183249 Submitted by: Chris Howey <howeyc@gmail.com> (maintainer)
35 lines
1.3 KiB
Text
35 lines
1.3 KiB
Text
--- ./src/parallel.orig 2013-10-21 15:31:40.000000000 -0500
|
|
+++ ./src/parallel 2013-10-23 15:11:54.000000000 -0500
|
|
@@ -5538,29 +5538,13 @@
|
|
# Returns:
|
|
# number of chars on the longest command line allowed
|
|
if(not $Limits::Command::line_max_len) {
|
|
- # Disk cache of max command line length
|
|
- my $len_cache = $ENV{'HOME'} . "/.parallel/tmp/linelen-" . ::hostname();
|
|
- my $cached_limit;
|
|
- if(-e $len_cache) {
|
|
- open(my $fh, "<", $len_cache) || ::die_bug("Cannot read $len_cache");
|
|
- $cached_limit = <$fh>;
|
|
- close $fh;
|
|
- } else {
|
|
- $cached_limit = real_max_length();
|
|
- # If $HOME is write protected: Do not fail
|
|
- mkdir($ENV{'HOME'} . "/.parallel");
|
|
- mkdir($ENV{'HOME'} . "/.parallel/tmp");
|
|
- open(my $fh, ">", $len_cache);
|
|
- print $fh $cached_limit;
|
|
- close $fh;
|
|
- }
|
|
- $Limits::Command::line_max_len = $cached_limit;
|
|
+ $Limits::Command::line_max_len = `getconf ARG_MAX` - 1024;
|
|
if($opt::max_chars) {
|
|
- if($opt::max_chars <= $cached_limit) {
|
|
+ if($opt::max_chars <= $Limits::Command::line_max_len) {
|
|
$Limits::Command::line_max_len = $opt::max_chars;
|
|
} else {
|
|
::warning("Value for -s option ",
|
|
- "should be < $cached_limit.\n");
|
|
+ "should be < $Limits::Command::line_max_len.\n");
|
|
}
|
|
}
|
|
}
|