From ed2d8dfa7a75513afa4df3ee762782775c137af6 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Fri, 8 Mar 2019 12:43:06 +0800 Subject: [PATCH] artiq_flash: resolve openocd symbolic links On NixOS, openocd may be a symlink in /run/current-system/sw/bin when installed system-wide. --- artiq/frontend/artiq_flash.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/artiq/frontend/artiq_flash.py b/artiq/frontend/artiq_flash.py index a311a1647..7895d867d 100755 --- a/artiq/frontend/artiq_flash.py +++ b/artiq/frontend/artiq_flash.py @@ -76,7 +76,7 @@ def scripts_path(): if os.name == "nt": p.insert(0, "Library") p = os.path.abspath(os.path.join( - os.path.dirname(shutil.which("openocd")), + os.path.dirname(os.path.realpath(shutil.which("openocd"))), "..", *p)) return p @@ -84,7 +84,7 @@ def scripts_path(): def proxy_path(): p = ["share", "bscan-spi-bitstreams"] p = os.path.abspath(os.path.join( - os.path.dirname(shutil.which("openocd")), + os.path.dirname(os.path.realpath(shutil.which("openocd"))), "..", *p)) return p