aboutsummaryrefslogtreecommitdiff
path: root/tools/tfm_parse_manifest_list.py
diff options
context:
space:
mode:
authorMartinaHanusovaNXP <martina.hanusova@nxp.com>2021-07-14 15:30:15 +0200
committerDavid Hu <david.hu@arm.com>2021-07-16 11:59:58 +0200
commit35957f1506a1558484fd002bed8f097047457c26 (patch)
tree09aec05845e676327b913437b0c79c4f4673b57b /tools/tfm_parse_manifest_list.py
parentb83b7bc93f11844544f5001757262a69b951b6a1 (diff)
downloadtrusted-firmware-m-35957f1506a1558484fd002bed8f097047457c26.tar.gz
Tools: Fixed slashes mismatch in manifest parsing tool
When generating manifest files on Windows and the output option (-o) is specified, there are different types of slashes in the include paths of generated files (the part of specified folder uses Windows slashes (\) whereas the rest of path uses Unix slashes (/)). This patch unified it to use only Unix slashes. Also it was deleted converting to absolute paths functionality when specifying output folder, now it uses relative paths as it was originally. This allows to update files in their locations even outside the root folder of the directory. Signed-off-by: MartinaHanusovaNXP <martina.hanusova@nxp.com> Change-Id: I9469d658afbce001ce45abe2e61ccc2dc4b5a02d
Diffstat (limited to 'tools/tfm_parse_manifest_list.py')
-rw-r--r--tools/tfm_parse_manifest_list.py33
1 files changed, 14 insertions, 19 deletions
diff --git a/tools/tfm_parse_manifest_list.py b/tools/tfm_parse_manifest_list.py
index 11c0690363..53faa281ba 100644
--- a/tools/tfm_parse_manifest_list.py
+++ b/tools/tfm_parse_manifest_list.py
@@ -124,21 +124,21 @@ def process_partition_manifests(manifest_list_files):
intermedia_file = os.path.join(manifest_dir, "auto_generated", 'intermedia_' + manifest_out_basename + '.c').replace('\\', '/')
load_info_file = os.path.join(manifest_dir, "auto_generated", 'load_info_' + manifest_out_basename + '.c').replace('\\', '/')
- """
- Remove the `source_path` portion of the filepaths, so that it can be
- interpreted as a relative path from the OUT_DIR.
- """
- if 'source_path' in manifest_item:
- # Replace environment variables in the source path
- source_path = os.path.expandvars(manifest_item['source_path'])
- manifest_head_file = os.path.relpath(manifest_head_file, start = source_path)
- intermedia_file = os.path.relpath(intermedia_file, start = source_path)
- load_info_file = os.path.relpath(load_info_file, start = source_path)
-
if OUT_DIR is not None:
- manifest_head_file = os.path.join(OUT_DIR, manifest_head_file)
- intermedia_file = os.path.join(OUT_DIR, intermedia_file)
- load_info_file = os.path.join(OUT_DIR, load_info_file)
+ """
+ Remove the `source_path` portion of the filepaths, so that it can be
+ interpreted as a relative path from the OUT_DIR.
+ """
+ if 'source_path' in manifest_item:
+ # Replace environment variables in the source path
+ source_path = os.path.expandvars(manifest_item['source_path'])
+ manifest_head_file = os.path.relpath(manifest_head_file, start = source_path)
+ intermedia_file = os.path.relpath(intermedia_file, start = source_path)
+ load_info_file = os.path.relpath(load_info_file, start = source_path)
+
+ manifest_head_file = os.path.join(OUT_DIR, manifest_head_file).replace('\\', '/')
+ intermedia_file = os.path.join(OUT_DIR, intermedia_file).replace('\\', '/')
+ load_info_file = os.path.join(OUT_DIR, load_info_file).replace('\\', '/')
partition_list.append({"manifest": manifest, "attr": manifest_item,
"manifest_out_basename": manifest_out_basename,
@@ -387,11 +387,6 @@ def main():
manifest_list = [os.path.abspath(x) for x in args.manifest_args]
gen_file_list = [os.path.abspath(x) for x in args.gen_file_args]
- # Arguments could be relative path.
- # Convert to absolute path as we are going to change diretory later
- if OUT_DIR is not None:
- OUT_DIR = os.path.abspath(OUT_DIR)
-
"""
Relative path to TF-M root folder is supported in the manifests
and default value of manifest list and generated file list are relative to TF-M root folder as well,