daca2: allow -j option
This commit is contained in:
parent
31d8cac8c9
commit
33f384c48e
|
@ -121,7 +121,7 @@ def removeLargeFiles(path):
|
||||||
os.remove(g)
|
os.remove(g)
|
||||||
|
|
||||||
|
|
||||||
def scanarchive(filepath):
|
def scanarchive(filepath, jobs):
|
||||||
# remove all files/folders except results.txt
|
# remove all files/folders except results.txt
|
||||||
removeAllExceptResults()
|
removeAllExceptResults()
|
||||||
|
|
||||||
|
@ -160,7 +160,7 @@ def scanarchive(filepath):
|
||||||
'-D__GCC__',
|
'-D__GCC__',
|
||||||
'--enable=style',
|
'--enable=style',
|
||||||
'--error-exitcode=0',
|
'--error-exitcode=0',
|
||||||
'--suppressions-list=../suppressions.txt',
|
jobs,
|
||||||
'.'],
|
'.'],
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
|
@ -175,10 +175,13 @@ def scanarchive(filepath):
|
||||||
results.close()
|
results.close()
|
||||||
|
|
||||||
FOLDER = None
|
FOLDER = None
|
||||||
|
JOBS = '-j1'
|
||||||
REV = None
|
REV = None
|
||||||
for arg in sys.argv[1:]:
|
for arg in sys.argv[1:]:
|
||||||
if arg[:6] == '--rev=':
|
if arg[:6] == '--rev=':
|
||||||
REV = arg[6:]
|
REV = arg[6:]
|
||||||
|
elif arg[:2] == '-j':
|
||||||
|
JOBS = arg
|
||||||
else:
|
else:
|
||||||
FOLDER = arg
|
FOLDER = arg
|
||||||
|
|
||||||
|
@ -196,12 +199,6 @@ time.sleep(10)
|
||||||
|
|
||||||
workdir = os.path.expanduser('~/daca2/')
|
workdir = os.path.expanduser('~/daca2/')
|
||||||
|
|
||||||
print('~/daca2/suppressions.txt')
|
|
||||||
if not os.path.isfile(workdir + 'suppressions.txt'):
|
|
||||||
suppressions = open(workdir + 'suppressions.txt', 'wt')
|
|
||||||
suppressions.write('\n')
|
|
||||||
suppressions.close()
|
|
||||||
|
|
||||||
print('~/daca2/' + FOLDER)
|
print('~/daca2/' + FOLDER)
|
||||||
if not os.path.isdir(workdir + FOLDER):
|
if not os.path.isdir(workdir + FOLDER):
|
||||||
os.makedirs(workdir + FOLDER)
|
os.makedirs(workdir + FOLDER)
|
||||||
|
@ -216,7 +213,7 @@ try:
|
||||||
results.close()
|
results.close()
|
||||||
|
|
||||||
for archive in archives:
|
for archive in archives:
|
||||||
scanarchive(archive)
|
scanarchive(archive, JOBS)
|
||||||
|
|
||||||
results = open('results.txt', 'at')
|
results = open('results.txt', 'at')
|
||||||
results.write('DATE ' + str(datetime.date.today()) + '\n')
|
results.write('DATE ' + str(datetime.date.today()) + '\n')
|
||||||
|
|
Loading…
Reference in New Issue