diff options
author | Xavier Claessens <xavier.claessens@collabora.com> | 2022-09-13 08:51:36 -0400 |
---|---|---|
committer | Xavier Claessens <xavier.claessens@collabora.com> | 2022-09-13 08:57:42 -0400 |
commit | 0924a35b6755baaaa4af7c9c2c6001c4ff7bea3d (patch) | |
tree | 36050bc16f21ad87f694d0307148cf73ed972240 | |
parent | 36f5b76640b73f5e0c6aa1ed19100d238e54d650 (diff) | |
download | fontconfig-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.py | 4 |
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: |