aboutsummaryrefslogtreecommitdiffstats
path: root/host/python
diff options
context:
space:
mode:
authorsteviez <steve.czabaniuk@ni.com>2020-07-31 11:34:21 -0500
committerAaron Rossetto <aaron.rossetto@ni.com>2020-07-31 14:32:54 -0500
commitb5575603e1dd06efa2d0309b7efb0b92a7519316 (patch)
tree5197a20993fdc0c9b510b07dbf0cab8b1021d83c /host/python
parent5e0cebdc19eecad0cceac2d81bee0405a89cfe5a (diff)
downloaduhd-b5575603e1dd06efa2d0309b7efb0b92a7519316.tar.gz
uhd-b5575603e1dd06efa2d0309b7efb0b92a7519316.tar.bz2
uhd-b5575603e1dd06efa2d0309b7efb0b92a7519316.zip
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.
Diffstat (limited to 'host/python')
-rwxr-xr-xhost/python/uhd/imgbuilder/image_builder.py4
1 files 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):