use the processors number instead of hard code 4 to build
authorZhang Qiang <qiang.z.zhang@intel.com>
Fri, 18 Jan 2013 03:34:07 +0000 (22:34 -0500)
committerZhang Qiang <qiang.z.zhang@intel.com>
Fri, 18 Jan 2013 03:47:27 +0000 (22:47 -0500)
'build' can accept --jobs option to set the %jobs and %_smp_mflags
macros for rpm build, so the proper value should be the max number
of (number of system processors, 4)

Change-Id: I55a8111baf3ed04b99aef6865c39ac6e054af48a

depanneur

index f573acf..8922ab9 100755 (executable)
--- a/depanneur
+++ b/depanneur
@@ -1071,7 +1071,9 @@ sub build_package {
         push @args, "--use-system-qemu";
     }
     push @args, "--uid $zuid:$zgid";
-    push @args, "--jobs 4";
+    my $nprocessors = int(`getconf _NPROCESSORS_ONLN`);
+    $nprocessors = 4 if ($nprocessors < 4);
+    push @args, "--jobs $nprocessors";
     push @args, "--no-init" if ($noinit == 1);
     push @args, "--keep-packs" if ($keep_packs == 1);
     push @args, "--cachedir $cache_dir";