diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2020-06-15 19:48:30 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2020-06-15 19:59:22 +0530 |
commit | 77cd988ac855a00fc3104623f1893a5a17f1a484 (patch) | |
tree | b962466b9693d2200f5d6c9e7b2dd9f61deac259 /gst-env.py | |
parent | d570c770adeb89ab5b954f4dadb89d6daadbd238 (diff) |
gst-env: Copy instead of symlink on Windows
os.symlink needs admin privs in most cases.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/160>
Diffstat (limited to 'gst-env.py')
-rwxr-xr-x | gst-env.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/gst-env.py b/gst-env.py index d91381a731..d95b2e9be2 100755 --- a/gst-env.py +++ b/gst-env.py @@ -160,8 +160,11 @@ def setup_gdb(options): python_paths.add(str(bdir / gdb_path)) python_paths.add(os.path.join(options.srcdir, gdb_path)) try: - os.symlink(gdb_helper, str(autoload_path / os.path.basename(gdb_helper))) - except FileExistsError: + if os.name == 'nt': + shutil.copy(gdb_helper, str(autoload_path / os.path.basename(gdb_helper))) + else: + os.symlink(gdb_helper, str(autoload_path / os.path.basename(gdb_helper))) + except (FileExistsError, shutil.SameFileError): pass gdbinit_line = 'add-auto-load-scripts-directory {}\n'.format(bdir / 'gdb-auto-load') |