Commit b13a1dea authored by Nirbheek Chauhan's avatar Nirbheek Chauhan 🐜
Browse files

fontconfig.recipe: Fix post-install on rebuild

The symlink will already exist, and we'll get an error that it
already exists. Backport fixes from fontconfig master that fix it.

Part-of: <!705>
parent 7c44ff9a
......@@ -19,7 +19,10 @@ class Recipe(recipe.Recipe):
# https://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/138/
'fontconfig/0001-handle-absolute-sysconfdir-when-installing-symlinks.patch',
# https://gitlab.freedesktop.org/fontconfig/fontconfig/-/merge_requests/165
'fontconfig/0001-meson-fix-cross-compilation-issues-with-gperf-header.patch'
'fontconfig/0001-meson-fix-cross-compilation-issues-with-gperf-header.patch',
# From git master post-2.13.93
'fontconfig/0001-Windows-Fix-symlink-privilege-error-detection.patch',
'fontconfig/0001-Overwrite-symlinks-for-config-files.patch',
]
files_libs = ['libfontconfig']
......
From 615e2cb844a7eb266aa562071a26093ae3ec4d28 Mon Sep 17 00:00:00 2001
From: Akira TAGOH <akira@tagoh.org>
Date: Tue, 2 Mar 2021 19:29:08 +0900
Subject: [PATCH] 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
---
conf.d/link_confs.py | 6 ++++--
1 file 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
@@ -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
--
2.31.1.windows.1
From 7bfbaecf819a8b1630dfc8f56126e31f985d5fb3 Mon Sep 17 00:00:00 2001
From: Xavier Claessens <xavier.claessens@collabora.com>
Date: Fri, 29 Jan 2021 19:17:38 -0500
Subject: [PATCH] Windows: Fix symlink privilege error detection
The message is in e.args[1] and not e.args[0] at least with python 3.8.
Should be more future proof like this in case it change again.
---
conf.d/link_confs.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/conf.d/link_confs.py b/conf.d/link_confs.py
index 0c42efb..5a78d8d 100644
--- a/conf.d/link_confs.py
+++ b/conf.d/link_confs.py
@@ -3,6 +3,7 @@
import os
import sys
import argparse
+import platform
if __name__=='__main__':
parser = argparse.ArgumentParser()
@@ -26,7 +27,7 @@ if __name__=='__main__':
break
except OSError as e:
# Symlink privileges are not available
- if len(e.args) == 1 and 'privilege' in e.args[0]:
+ if platform.system().lower() == 'windows' and e.winerror == 1314:
break
raise
except FileExistsError:
--
2.31.1.windows.1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment