From b5575603e1dd06efa2d0309b7efb0b92a7519316 Mon Sep 17 00:00:00 2001 From: steviez Date: Fri, 31 Jul 2020 11:34:21 -0500 Subject: utils: Use absolute paths in image builder build() A segment of the build() function updates the working directory. This change converts several paths to absolute paths to avoid having a relative path (such as one containing up-level references) deviate from its' intended meaning after the directory change. --- host/python/uhd/imgbuilder/image_builder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/host/python/uhd/imgbuilder/image_builder.py b/host/python/uhd/imgbuilder/image_builder.py index fba87361b..9c26f2726 100755 --- a/host/python/uhd/imgbuilder/image_builder.py +++ b/host/python/uhd/imgbuilder/image_builder.py @@ -726,7 +726,7 @@ def build(fpga_path, device, image_core_path, edge_file, **args): """ ret_val = 0 cwd = os.path.dirname(__file__) - build_dir = os.path.join(get_top_path(fpga_path), target_dir(device)) + build_dir = os.path.join(get_top_path(os.path.abspath(fpga_path)), target_dir(device)) if not os.path.isdir(build_dir): logging.error("Not a valid directory: %s", build_dir) return 1 @@ -804,7 +804,7 @@ def generate_image_core_path(output_path, source): """ if output_path is not None: return output_path - source = os.path.splitext(os.path.normpath(source))[0] + source = os.path.splitext(os.path.abspath(os.path.normpath(source)))[0] return source + '.v' def generate_edge_file_path(output_path, device, source): -- cgit v1.2.3