Add options and refactoring
diff --git a/coverage-tool/coverage-reporting/clone_sources.py b/coverage-tool/coverage-reporting/clone_sources.py
index fb1807d..ec38acd 100644
--- a/coverage-tool/coverage-reporting/clone_sources.py
+++ b/coverage-tool/coverage-reporting/clone_sources.py
@@ -18,7 +18,7 @@
from random import random
-def call_cmd(cmd, print_cmd=False):
+def call_cmd(cmd, print_cmd=True):
"""
Function that execute an os command and returns its output
@@ -135,6 +135,7 @@
else:
call_cmd("cd {};git checkout -q FETCH_HEAD".format(
output_loc))
+ call_cmd("cd {};git submodule update --init --recursive || true".format(output_loc))
elif source['type'] == 'http':
site = source
output_loc = os.path.join(output_dir, site["LOCATION"])
@@ -146,6 +147,7 @@
site['URL'], tmp_folder))
call_cmd("mkdir -p {}".format(output_loc))
if site['COMPRESSION'] == "xz":
- call_cmd("cd {};tar -xzf $(basename {}) -C {}".format(
- tmp_folder, site['URL'], output_loc))
+ call_cmd("cd {};tar -xzf $(basename {}) -C {} {}".format(
+ tmp_folder, site['URL'], output_loc,
+ source.get("EXTRA_PARAMS", "")))
call_cmd("rm -rf {}".format(tmp_folder))