Update of /cvsroot/fink/fink/perlmod/Fink
In directory fdv4jf1.ch3.sourceforge.com:/tmp/cvs-serv32300

Modified Files:
        ChangeLog Configure.pm PkgVersion.pm 
Log Message:
Call $config-param() only once and warn user if MaxBuildJobs is not a positive
integer.



Index: PkgVersion.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/PkgVersion.pm,v
retrieving revision 1.640
retrieving revision 1.641
diff -u -d -r1.640 -r1.641
--- PkgVersion.pm       21 Nov 2009 21:20:18 -0000      1.640
+++ PkgVersion.pm       23 Nov 2009 17:06:46 -0000      1.641
@@ -4995,14 +4995,17 @@
        }
 
        # UseMaxBuildJobs: true overrides SetNoMAKEFLAGS
-       if ($self->param_boolean('UseMaxBuildJobs')
-               && $config->has_param('MaxBuildJobs')
-               && $config->param('MaxBuildJobs') =~ /^\d+$/
-               && $config->param('MaxBuildJobs') > 1) {
-               if (defined $script_env{'MAKEFLAGS'}) {
-                       $script_env{'MAKEFLAGS'} .= ' -j' . 
$config->param('MaxBuildJobs');
+       if ($self->param_boolean('UseMaxBuildJobs') && 
$config->has_param('MaxBuildJobs')) {
+               my $mbj = $config->param('MaxBuildJobs');
+               if ($mbj =~ /^\d+$/  && $mbj > 0) {
+                       if (defined $script_env{'MAKEFLAGS'}) {
+                               $script_env{'MAKEFLAGS'} .= " -j$mbj";
+                       } else {
+                               $script_env{'MAKEFLAGS'} = "-j$mbj";
+                       }
                } else {
-                       $script_env{'MAKEFLAGS'} = '-j' . 
$config->param('MaxBuildJobs');
+                       warn "Ignoring invalid MaxBuildJobs value in fink.conf: 
" .
+                               "$mbj is not a positive integer\n";
                }
        }
 

Index: Configure.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/Configure.pm,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -d -r1.62 -r1.63
--- Configure.pm        12 Nov 2009 00:23:20 -0000      1.62
+++ Configure.pm        23 Nov 2009 17:06:46 -0000      1.63
@@ -318,6 +318,7 @@
                }
        }
 
+       print "\n";
        my $maxbuildjobs_prompt = "Enter the maximum number of simultaneous " .
                "build jobs. In general, Fink will build packages faster on 
systems " .
                "with multiple CPUs/cores if you allow it to spawn jobs in 
parallel.";
@@ -332,12 +333,13 @@
        }
        $maxbuildjobs_prompt .= "\nMaximum number of simultaneous build jobs:";
        my $maxbuildjobs = $config->param_default("MaxBuildJobs", $activecpus);
-       my $choice_prompt = $maxbuildjobs;
-       $maxbuildjobs = &prompt($maxbuildjobs_prompt, default => 
$choice_prompt);
+       my $maxbuildjobs_default = $maxbuildjobs;
+       $maxbuildjobs = &prompt($maxbuildjobs_prompt,
+               default => $maxbuildjobs_default);
 
        while (!($maxbuildjobs =~ /^\d+$/ && $maxbuildjobs > 0)) {
                $maxbuildjobs = &prompt("Invalid choice. Please try again",
-                       default => $choice_prompt);
+                       default => $maxbuildjobs_default);
        }
 
        $config->set_param("MaxBuildJobs", $maxbuildjobs);

Index: ChangeLog
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/ChangeLog,v
retrieving revision 1.1646
retrieving revision 1.1647
diff -u -d -r1.1646 -r1.1647
--- ChangeLog   21 Nov 2009 21:27:44 -0000      1.1646
+++ ChangeLog   23 Nov 2009 17:06:45 -0000      1.1647
@@ -1,3 +1,9 @@
+2009-11-23  Augusto Devegili  <moni...@users.sourceforge.net>
+
+       * Configure.pm: Comsetics
+       * PkgVersion.pm: Call $config-param() only once and warn user if
+       MaxBuildJobs is not a positive integer
+
 2009-11-21  Augusto Devegili  <moni...@users.sourceforge.net>
 
        * PkgVersion.pm: Handle the Commercial licence


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
http://news.gmane.org/gmane.os.apple.fink.cvs

Reply via email to