summaryrefslogtreecommitdiff
path: root/gentree.py
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2017-09-08 12:40:48 +0200
committerJohannes Berg <johannes.berg@intel.com>2017-09-08 13:25:31 +0200
commit709e720caa66816f32c6adc6050549fa40b9cf52 (patch)
treede2b4e844b0cf65047fec30efb7473f63df39462 /gentree.py
parent8de4a835ebf57eabe0166cb41d4f61fb52b9fb80 (diff)
use spatch's built-in concurrency
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'gentree.py')
-rwxr-xr-xgentree.py16
1 files changed, 11 insertions, 5 deletions
diff --git a/gentree.py b/gentree.py
index 026afdc2..7d3f4a4f 100755
--- a/gentree.py
+++ b/gentree.py
@@ -5,6 +5,7 @@
import argparse, sys, os, errno, shutil, re, subprocess
import tarfile, gzip
+from multiprocessing import cpu_count
# find self
source_dir = os.path.abspath(os.path.dirname(__file__))
@@ -584,13 +585,18 @@ def apply_patches(args, desc, source_dir, patch_src, target_dir, logwrite=lambda
prefix_len = len(os.path.join(source_dir, patch_src)) + 1
for cocci_file in sempatches:
- # Until Coccinelle picks this up
- pycocci = os.path.join(source_dir, 'devel/pycocci')
- cmd = [pycocci, cocci_file]
+ cmd = ['spatch',
+ '--sp-file', cocci_file,
+ '--in-place',
+ '--recursive-includes',
+ '--relax-include-path',
+ '--use-coccigrep',
+ '--timeout', '120',
+ '-j', '%d' % cpu_count(),
+ '--dir', os.path.abspath(target_dir) ]
extra_spatch_args = []
if args.profile_cocci:
- cmd.append('--profile-cocci')
- cmd.append(os.path.abspath(target_dir))
+ cmd.append('--profile')
print_name = cocci_file[prefix_len:]
if args.verbose:
logwrite("Applying SmPL patch %s" % print_name)