mesonintrospect: Normalize install_filename in the output
Without this, we can output a mixture of '/' and '\' on platforms where os.path.sep is '\' and prefix or outdir uses '/'. Let's always return the path in the format of the platform we're running on. This is needed to make the test_install_introspection() unittest work properly on Windows.
This commit is contained in:
parent
8e36697617
commit
b3d5db49e8
|
@ -23,6 +23,7 @@ import json, pickle
|
||||||
from . import coredata, build
|
from . import coredata, build
|
||||||
import argparse
|
import argparse
|
||||||
import sys, os
|
import sys, os
|
||||||
|
import pathlib
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument('--targets', action='store_true', dest='list_targets', default=False,
|
parser.add_argument('--targets', action='store_true', dest='list_targets', default=False,
|
||||||
|
@ -56,7 +57,9 @@ def determine_installed_path(target, installdata):
|
||||||
fname = i[0]
|
fname = i[0]
|
||||||
outdir = i[1]
|
outdir = i[1]
|
||||||
outname = os.path.join(installdata.prefix, outdir, os.path.split(fname)[-1])
|
outname = os.path.join(installdata.prefix, outdir, os.path.split(fname)[-1])
|
||||||
return outname
|
# Normalize the path by using os.path.sep consistently, etc.
|
||||||
|
# Does not change the effective path.
|
||||||
|
return str(pathlib.PurePath(outname))
|
||||||
|
|
||||||
|
|
||||||
def list_installed(installdata):
|
def list_installed(installdata):
|
||||||
|
|
Loading…
Reference in New Issue