[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.10-56-g3a62926



The following commit has been merged in the master branch:
commit 3a629265f43a68d10d41344fa9c075d24c21dfd9
Author: Niels Thykier <niels@thykier.net>
Date:   Tue Jul 17 11:58:16 2012 +0200

    lintian: move default_parallel to L::I::FrontendUtil
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/frontend/lintian b/frontend/lintian
index 7e5d390..327a36e 100755
--- a/frontend/lintian
+++ b/frontend/lintian
@@ -1875,22 +1875,6 @@ sub finished_coll {
     return $cmap->selectable;
 }
 
-sub default_parallel {
-    # check cpuinfo for the number of cores...
-    my $cpus;
-    chomp ( $cpus = `nproc 2>&1` );
-    if ($? == 0 and $cpus =~ m/^\d+$/ ) {
-        # Running up to twice the number of cores usually gets the most out
-        # of the CPUs and disks but it might be too aggresive to be the
-        # default for -j. Only use <cores>+1 then.
-        debug_msg (1, "Number of CPUs: $cpus");
-        return $cpus + 1;
-    }
-
-    # No decent number of jobs? Just use 2 as a default
-    return 2;
-}
-
 # }}}
 
 # {{{ Exit handler.
diff --git a/lib/Lintian/Internal/FrontendUtil.pm b/lib/Lintian/Internal/FrontendUtil.pm
index 4ef08a3..3fb8d0d 100644
--- a/lib/Lintian/Internal/FrontendUtil.pm
+++ b/lib/Lintian/Internal/FrontendUtil.pm
@@ -27,7 +27,7 @@ use Dpkg::Vendor;
 use Lintian::CollScript;
 use Lintian::Util qw(check_path fail);
 
-our @EXPORT = qw(check_test_feature find_default_profile load_collections);
+our @EXPORT = qw(check_test_feature default_parallel find_default_profile load_collections);
 
 # Check if we are testing a specific feature
 #  - e.g. vendor-libdpkg-perl
@@ -86,6 +86,22 @@ sub load_collections {
     closedir $dir;
 }
 
+# Return the default number of parallization to be used
+sub default_parallel {
+    # check cpuinfo for the number of cores...
+    my $cpus;
+    chomp ( $cpus = `nproc 2>&1` );
+    if ($? == 0 and $cpus =~ m/^\d+$/ ) {
+        # Running up to twice the number of cores usually gets the most out
+        # of the CPUs and disks but it might be too aggresive to be the
+        # default for -j. Only use <cores>+1 then.
+        return $cpus + 1;
+    }
+
+    # No decent number of jobs? Just use 2 as a default
+    return 2;
+}
+
 1;
 
 # Local Variables:

-- 
Debian package checker


Reply to: