Date: Sun, 6 Feb 2011 22:08:03 GMT From: Chris Howey <howeyc@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/154560: [maintainer update] sysutils/parallel - New patch Message-ID: <201102062208.p16M83Ip004960@red.freebsd.org> Resent-Message-ID: <201102062210.p16MA96c051260@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 154560 >Category: ports >Synopsis: [maintainer update] sysutils/parallel - New patch >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Sun Feb 06 22:10:09 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Chris Howey >Release: 8.1-RELEASE >Organization: N/A >Environment: FreeBSD tinny-desktop 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Mon Jul 19 02:36:49 UTC 2010 root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: The previous patch I made alters a function to call "getconf ARG_MAX" to get the maximum command line length. However I failed to realize that the rest of the program called this function a lot. I have now altered the patch file to call getconf once on program run instead of multiple times, greatly reducing execution time. >How-To-Repeat: N/A >Fix: Patch included. Patch attached with submission follows: diff -ruN parallel.bak/Makefile parallel/Makefile --- parallel.bak/Makefile 2011-01-31 04:38:55.000000000 -0700 +++ parallel/Makefile 2011-02-06 14:53:06.000000000 -0700 @@ -7,6 +7,7 @@ PORTNAME= parallel PORTVERSION= 20110122 +PORTREVISION= 1 CATEGORIES= sysutils MASTER_SITES= GNU diff -ruN parallel.bak/files/patch-src__parallel parallel/files/patch-src__parallel --- parallel.bak/files/patch-src__parallel 2011-01-31 04:38:55.000000000 -0700 +++ parallel/files/patch-src__parallel 2011-02-06 14:56:49.000000000 -0700 @@ -1,5 +1,5 @@ --- ./src/parallel.orig 2011-01-22 15:37:41.000000000 -0700 -+++ ./src/parallel 2011-01-30 11:39:53.000000000 -0700 ++++ ./src/parallel 2011-02-06 14:56:46.000000000 -0700 @@ -2077,14 +2077,20 @@ sub no_of_cpus_freebsd { # Returns: @@ -23,14 +23,15 @@ return $no_of_cores; } -@@ -3455,28 +3461,40 @@ +@@ -3455,28 +3461,42 @@ # Maximal command line length (for -m and -X) sub max_length { - # Find the max_length of a command line - # Returns: - # number of chars on the longest command line allowed -- if(not $Limits::Command::line_max_len) { ++ # FreeBSD code: + if(not $Limits::Command::line_max_len) { - if($::opt_s) { - if(is_acceptable_command_line_length($::opt_s)) { - $Limits::Command::line_max_len = $::opt_s; @@ -47,17 +48,16 @@ - } else { - $Limits::Command::line_max_len = real_max_length(); - } -+ # FreeBSD code: -+ my $limit = `getconf ARG_MAX` - 1024; -+ if ($::opt_s) { -+ if ($::opt_s > $limit) { -+ print STDERR "$Global::progname: ", -+ "you are setting value for -s greater than $limit\n"; ++ $Limits::Command::line_max_len = `getconf ARG_MAX` - 1024; ++ if ($::opt_s) { ++ if ($::opt_s > $Limits::Command::line_max_len) { ++ print STDERR "$Global::progname: ", ++ "you are setting value for -s greater than $Limits::Command::line_max_len\n"; ++ } ++ $Limits::Command::line_max_len = $::opt_s; + } -+ $limit = $::opt_s; } -- return $Limits::Command::line_max_len; -+ return $limit; + return $Limits::Command::line_max_len; + +# ORIGINAL code: +# # Find the max_length of a command line >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201102062208.p16M83Ip004960>