summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-04-26 02:42:15 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2017-05-19 03:43:31 +0200
commit25ea5a7a561045f8a7f20bb9028701a95b029699 (patch)
tree5244c38b34f9409aeae6e3a3d0077aff96004bad /bin
parent93b0c5bcc7db818125c081c62db004e70b27552a (diff)
extract mar file name generation
Change-Id: If928cae4c722354d5c3e415e7cb8426a3a4412f7
Diffstat (limited to 'bin')
-rwxr-xr-xbin/update/create_full_mar.py9
-rw-r--r--bin/update/tools.py4
2 files changed, 6 insertions, 7 deletions
diff --git a/bin/update/create_full_mar.py b/bin/update/create_full_mar.py
index ebe2a01cd2cf..f4990304857e 100755
--- a/bin/update/create_full_mar.py
+++ b/bin/update/create_full_mar.py
@@ -5,15 +5,11 @@ import os
import subprocess
import json
-from tools import uncompress_file_to_dir, get_file_info
+from tools import uncompress_file_to_dir, get_file_info, make_complete_mar_name
from config import parse_config
current_dir_path = os.path.dirname(os.path.realpath(__file__))
-def make_mar_name(target_dir, filename_prefix):
- filename = filename_prefix + "_complete.mar"
- return os.path.join(target_dir, filename)
-
def main():
print(sys.argv)
if len(sys.argv) < 7:
@@ -38,8 +34,7 @@ def main():
uncompress_dir = uncompress_file_to_dir(tar_file, temp_dir)
- mar_executable = os.environ.get('MAR', 'mar')
- mar_file = make_mar_name(target_dir, filename_prefix)
+ mar_file = make_complete_mar_name(target_dir, filename_prefix)
subprocess.call([os.path.join(current_dir_path, 'make_full_update.sh'), mar_file, uncompress_dir])
signed_mar_file = make_mar_name(target_dir, filename_prefix + '_signed')
diff --git a/bin/update/tools.py b/bin/update/tools.py
index 84c7ae6fb0ab..5a3e34521b40 100644
--- a/bin/update/tools.py
+++ b/bin/update/tools.py
@@ -49,3 +49,7 @@ def replace_variables_in_string(string, **kwargs):
new_string = new_string.replace('$(%s)'%key, val)
return new_string
+
+def make_complete_mar_name(target_dir, filename_prefix):
+ filename = filename_prefix + "_complete.mar"
+ return os.path.join(target_dir, filename)