summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkira TAGOH <akira@tagoh.org>2021-03-02 19:29:08 +0900
committerAkira TAGOH <akira@tagoh.org>2021-03-02 19:41:44 +0900
commit615e2cb844a7eb266aa562071a26093ae3ec4d28 (patch)
treebeb2cc656faa9aa0d6f0e801c844b07d8a15073f
parentdba3287bf5dcb2ba0b716749a9a15e7ad43a91f4 (diff)
Overwrite symlinks for config files
In Makefile, we are trying to remove old symlinks first and then create a symlink. do the same thing in meson too. Also, the line of the exception handling for FileExistsError is meaningless as the above line is taking care of it instead and we shouldn't ignore it if os.remove and os.symlink doesn't work somehow. Fixes https://gitlab.freedesktop.org/fontconfig/fontconfig/-/issues/275
-rw-r--r--conf.d/link_confs.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/conf.d/link_confs.py b/conf.d/link_confs.py
index 5a78d8d..e195095 100644
--- a/conf.d/link_confs.py
+++ b/conf.d/link_confs.py
@@ -21,6 +21,10 @@ if __name__=='__main__':
src = os.path.join(args.availpath, link)
dst = os.path.join(confpath, link)
try:
+ os.remove(dst)
+ except FileNotFoundError:
+ pass
+ try:
os.symlink(src, dst)
except NotImplementedError:
# Not supported on this version of Windows
@@ -30,5 +34,3 @@ if __name__=='__main__':
if platform.system().lower() == 'windows' and e.winerror == 1314:
break
raise
- except FileExistsError:
- pass