ports/154398: [maintainer update] Updating port: sysutils/parallel - New Version
Chris Howey
howeyc at gmail.com
Sun Jan 30 19:00:20 UTC 2011
>Number: 154398
>Category: ports
>Synopsis: [maintainer update] Updating port: sysutils/parallel - New Version
>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 Jan 30 19:00:19 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 at mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64
>Description:
Release News:
http://savannah.gnu.org/forum/forum.php?forum_id=6696
The default behavior of running jobs based on the number of cores has changed. Now it finds the number of cores to know how many jobs to run. I noticed this was not working correctly on FreeBSD and submitted a patch upstream, it will be in the next release.
I also noticed that the function to find the max length of a command line did not seem to be working correctly. I altered the function to ust "getconf ARG_MAX" instead.
The above two changes are now a patch file in the port.
>How-To-Repeat:
N/A
>Fix:
Patch included.
Patch attached with submission follows:
diff -ruN parallel.bak/Makefile parallel/Makefile
--- parallel.bak/Makefile 2010-12-22 10:50:11.000000000 -0700
+++ parallel/Makefile 2011-01-29 16:38:08.000000000 -0700
@@ -6,7 +6,7 @@
#
PORTNAME= parallel
-PORTVERSION= 20101222
+PORTVERSION= 20110122
CATEGORIES= sysutils
MASTER_SITES= GNU
diff -ruN parallel.bak/distinfo parallel/distinfo
--- parallel.bak/distinfo 2010-12-22 10:50:11.000000000 -0700
+++ parallel/distinfo 2011-01-29 16:38:36.000000000 -0700
@@ -1,2 +1,2 @@
-SHA256 (parallel-20101222.tar.bz2) = 6465f0eacaa133819bafe02eac14669a2c4eeedd67be21798f3f29ecacc49596
-SIZE (parallel-20101222.tar.bz2) = 151264
+SHA256 (parallel-20110122.tar.bz2) = 6c5a6f245d2ce3b315f878b22472c620fbf1906e65dd3b223a5be79ca1085634
+SIZE (parallel-20110122.tar.bz2) = 157049
diff -ruN parallel.bak/files/patch-src__parallel parallel/files/patch-src__parallel
--- parallel.bak/files/patch-src__parallel 1969-12-31 17:00:00.000000000 -0700
+++ parallel/files/patch-src__parallel 2011-01-30 11:39:57.000000000 -0700
@@ -0,0 +1,87 @@
+--- ./src/parallel.orig 2011-01-22 15:37:41.000000000 -0700
++++ ./src/parallel 2011-01-30 11:39:53.000000000 -0700
+@@ -2077,14 +2077,20 @@
+ sub no_of_cpus_freebsd {
+ # Returns:
+ # Number of physical CPUs on FreeBSD
+- my $no_of_cpus = `sysctl hw.ncpu 2>/dev/null | awk '{ print \$2 }'`;
++ my $no_of_cpus =
++ (`sysctl -a dev.cpu | grep \%parent | awk '{ print \$2 }' | uniq | wc -l | awk '{ print \$1 }'`
++ or
++ `sysctl hw.ncpu 2>/dev/null | awk '{ print \$2 }'`);
+ return $no_of_cpus;
+ }
+
+ sub no_of_cores_freebsd {
+ # Returns:
+ # Number of CPU cores on FreeBSD
+- my $no_of_cores = `sysctl -a hw 2>/dev/null | grep -w logicalcpu | awk '{ print \$2 }'`;
++ my $no_of_cores =
++ (`sysctl hw.ncpu 2>/dev/null | awk '{ print \$2 }'`
++ or
++ `sysctl -a hw 2>/dev/null | grep -w logicalcpu | awk '{ print \$2 }'`);
+ return $no_of_cores;
+ }
+
+@@ -3455,28 +3461,40 @@
+
+ # 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) {
+- if($::opt_s) {
+- if(is_acceptable_command_line_length($::opt_s)) {
+- $Limits::Command::line_max_len = $::opt_s;
+- } else {
+- # -s is too long: Find the correct
+- $Limits::Command::line_max_len = binary_find_max_length(0,$::opt_s);
+- }
+- if($::opt_s <= $Limits::Command::line_max_len) {
+- $Limits::Command::line_max_len = $::opt_s;
+- } else {
+- print STDERR "$Global::progname: ",
+- "value for -s option should be < $Limits::Command::line_max_len\n";
+- }
+- } 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";
++ }
++ $limit = $::opt_s;
+ }
+- return $Limits::Command::line_max_len;
++ return $limit;
++
++# ORIGINAL code:
++# # 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) {
++# if($::opt_s) {
++# if(is_acceptable_command_line_length($::opt_s)) {
++# $Limits::Command::line_max_len = $::opt_s;
++# } else {
++# # -s is too long: Find the correct
++# $Limits::Command::line_max_len = binary_find_max_length(0,$::opt_s);
++# }
++# if($::opt_s <= $Limits::Command::line_max_len) {
++# $Limits::Command::line_max_len = $::opt_s;
++# } else {
++# print STDERR "$Global::progname: ",
++# "value for -s option should be < $Limits::Command::line_max_len\n";
++# }
++# } else {
++# $Limits::Command::line_max_len = real_max_length();
++# }
++# }
++# return $Limits::Command::line_max_len;
+ }
+
+ sub real_max_length {
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list