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
This commit is contained in:
Akira TAGOH 2021-03-02 19:29:08 +09:00
parent dba3287bf5
commit 615e2cb844
1 changed files with 4 additions and 2 deletions

View File

@ -20,6 +20,10 @@ if __name__=='__main__':
for link in args.links:
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:
@ -30,5 +34,3 @@ if __name__=='__main__':
if platform.system().lower() == 'windows' and e.winerror == 1314:
break
raise
except FileExistsError:
pass