summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Claessens <xavier.claessens@collabora.com>2022-09-13 08:51:36 -0400
committerXavier Claessens <xavier.claessens@collabora.com>2022-09-13 08:57:42 -0400
commit0924a35b6755baaaa4af7c9c2c6001c4ff7bea3d (patch)
tree36050bc16f21ad87f694d0307148cf73ed972240
parent36f5b76640b73f5e0c6aa1ed19100d238e54d650 (diff)
downloadfontconfig-0924a35b6755baaaa4af7c9c2c6001c4ff7bea3d.tar.gz
link_confs.py: Fix prepending DESTDIR to absolute path
Stripping the first char of a path to make it relative only works with UNIX paths like '/prefix' but not with Windows paths like 'c:\prefix'. This copies the code Meson uses.
-rw-r--r--conf.d/link_confs.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/conf.d/link_confs.py b/conf.d/link_confs.py
index 52b8093..11e759a 100644
--- a/conf.d/link_confs.py
+++ b/conf.d/link_confs.py
@@ -4,6 +4,7 @@ import os
import sys
import argparse
import platform
+from pathlib import PurePath
if __name__=='__main__':
parser = argparse.ArgumentParser()
@@ -15,7 +16,8 @@ if __name__=='__main__':
if os.path.isabs(args.confpath):
destdir = os.environ.get('DESTDIR')
if destdir:
- confpath = os.path.join(destdir, args.confpath[1:])
+ # c:\destdir + c:\prefix must produce c:\destdir\prefix
+ confpath = str(PurePath(destdir, *PurePath(args.confpath).parts[1:]))
else:
confpath = args.confpath
else: