From nobody@FreeBSD.org  Sun Jan 30 18:52:52 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4E825106564A
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 30 Jan 2011 18:52:52 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 3E5BB8FC08
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 30 Jan 2011 18:52:52 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p0UIqqfE050979
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 30 Jan 2011 18:52:52 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p0UIqqdk050973;
	Sun, 30 Jan 2011 18:52:52 GMT
	(envelope-from nobody)
Message-Id: <201101301852.p0UIqqdk050973@red.freebsd.org>
Date: Sun, 30 Jan 2011 18:52:52 GMT
From: Chris Howey <howeyc@gmail.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [maintainer update] Updating port: sysutils/parallel - New Version
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>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:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 30 19:00:19 UTC 2011
>Closed-Date:    Mon Jan 31 11:39:08 UTC 2011
>Last-Modified:  Mon Jan 31 11:40:13 UTC 2011
>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:
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:
State-Changed-From-To: open->closed 
State-Changed-By: miwi 
State-Changed-When: Mon Jan 31 11:39:07 UTC 2011 
State-Changed-Why:  
Committed. Thanks! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=154398 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/154398: commit references a PR
Date: Mon, 31 Jan 2011 11:39:00 +0000 (UTC)

 miwi        2011-01-31 11:38:55 UTC
 
   FreeBSD ports repository
 
   Modified files:
     sysutils/parallel    Makefile distinfo 
   Added files:
     sysutils/parallel/files patch-src__parallel 
   Log:
   - Update to 20110122
   
   PR:             154398
   Submitted by:   maintainer
   Feature safe:   yes
   
   Revision  Changes    Path
   1.8       +1 -1      ports/sysutils/parallel/Makefile
   1.5       +2 -2      ports/sysutils/parallel/distinfo
   1.1       +87 -0     ports/sysutils/parallel/files/patch-src__parallel (new)
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
