booh: add mproc autodetection
authorgc <gc>
Tue, 16 Oct 2007 19:51:44 +0000 (19:51 +0000)
committergc <gc>
Tue, 16 Oct 2007 19:51:44 +0000 (19:51 +0000)
bin/booh

index f5734375d2147f3df46a32d635e76d4e77157999..18861ee568edaf0fc777982c202c17ff27ac4f3d 100755 (executable)
--- a/bin/booh
+++ b/bin/booh
@@ -114,7 +114,15 @@ def read_config
     if !FileTest.directory?(File.expand_path('~/.booh'))
         system("mkdir ~/.booh")
     end
-
+    if $config['mproc'].nil?
+        cpus = 0
+        for line in IO.readlines('/proc/cpuinfo') do
+            line =~ /^processor/ and cpus += 1
+        end
+        if cpus > 1
+            $config['mproc'] = cpus
+        end
+    end
     $tempfiles = []
     $todelete = []
 end