summaryrefslogtreecommitdiffstats
path: root/bin/install_megadrivers.py
diff options
context:
space:
mode:
authorDylan Baker <[email protected]>2017-11-09 17:52:31 -0800
committerDylan Baker <[email protected]>2017-12-04 14:36:26 -0800
commitf7f1b30f81e842db6057591470ce3cb6d4fb2795 (patch)
tree947cb2a80c1011a57754c3311b003ca899375016 /bin/install_megadrivers.py
parentb065de05c6a83aeb4eabbc7141f7b56dbd641b00 (diff)
meson: extend install_megadrivers script to handle symmlinking
Which is required for the gallium media state trackers. v2: - Make symlinks local instead of absolute Signed-off-by: Dylan Baker <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
Diffstat (limited to 'bin/install_megadrivers.py')
-rwxr-xr-xbin/install_megadrivers.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/bin/install_megadrivers.py b/bin/install_megadrivers.py
index a98d7dd177b..86bfa359188 100755
--- a/bin/install_megadrivers.py
+++ b/bin/install_megadrivers.py
@@ -44,10 +44,24 @@ def main():
for each in args.drivers:
driver = os.path.join(to, each)
+
if os.path.exists(driver):
os.unlink(driver)
print('installing {} to {}'.format(args.megadriver, driver))
os.link(master, driver)
+
+ try:
+ ret = os.getcwd()
+ os.chdir(to)
+
+ name, ext = os.path.splitext(each)
+ while ext != '.so':
+ if os.path.exists(name):
+ os.unlink(name)
+ os.symlink(driver, name)
+ name, ext = os.path.splitext(name)
+ finally:
+ os.chdir(ret)
os.unlink(master)