From: Gert Wollny <[email protected]>

os.path.exists doesn't return True for stale symlinks, but they are in
the way later, when a link/file with the same name is to be created.
For instance it is conceivable that the pointed to file is replaced by
a file with a new name, and then the symlink is dead.

To handle this check specifically for all existing symlinks to be
removed. (This bugged me for some time with a link libXvMCr600.so
always being in the way of installing this file)

Signed-off-by: Gert Wollny <[email protected]>
---
It could also be that the problem is elsewhere, but at least here it 
manifests itself and this patch fixes it. 

 bin/install_megadrivers.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/install_megadrivers.py b/bin/install_megadrivers.py
index 8d9ed9c6dc..7bf0037a6e 100755
--- a/bin/install_megadrivers.py
+++ b/bin/install_megadrivers.py
@@ -49,7 +49,7 @@ def main():
     for driver in args.drivers:
         abs_driver = os.path.join(to, driver)
 
-        if os.path.exists(abs_driver):
+        if os.path.exists(abs_driver) or os.path.lexists(abs_driver):
             os.unlink(abs_driver)
         print('installing {} to {}'.format(args.megadriver, abs_driver))
         os.link(master, abs_driver)
-- 
2.16.4

_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to