1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
Date: Sun, 1 Mar 2020 17:33:12 +0000
Subject: meson_vapi_link.py: Use python's own utils instead of calling 'ln'
Replace the use of 'ln' with os.symlink. Since subprocess.call does not
raise any exception when the called process fails, this script likely
silently did nothing on Windows. Instead, fall back to using shutil.copy
to copy instead of symlinking.
Origin: upstream, 0.99.1, commit:29db98df0f65519bbcc9827253b0849ce7fb741c
---
meson_vapi_link.py | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/meson_vapi_link.py b/meson_vapi_link.py
index d7fc729..db1e4e8 100644
--- a/meson_vapi_link.py
+++ b/meson_vapi_link.py
@@ -1,7 +1,7 @@
#!/usr/bin/env python3
import os
-import subprocess
+import shutil
import sys
datadir = sys.argv[1]
@@ -22,4 +22,7 @@ new = 'libgit2-glib-1.0'
for ext in ['vapi', 'deps']:
src = '{}.{}'.format(new, ext)
dest = '{}.{}'.format(old, ext)
- subprocess.call(['ln', '-s', '-f', src, dest])
+ try:
+ os.symlink(src, dest)
+ except OSError:
+ shutil.copy(src, dest)
|