aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/scripts
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2017-05-29 20:29:28 +0530
committerJussi Pakkanen <jpakkane@gmail.com>2018-03-19 23:45:43 +0200
commitd012b5b997e917a971bca1236a065453493c780d (patch)
treeb7e0737ea9d22d2a6b0b3a0a29bdc7c78d824ea5 /mesonbuild/scripts
parente984e1072b28abfa4ac278992a8ef6d138c15608 (diff)
downloadmeson-d012b5b997e917a971bca1236a065453493c780d.zip
meson-d012b5b997e917a971bca1236a065453493c780d.tar.gz
meson-d012b5b997e917a971bca1236a065453493c780d.tar.bz2
Create a helper for checking if a string has a path component
This is used in a number of places, and in some places it is incomplete. Use a helper to ensure it's used properly.
Diffstat (limited to 'mesonbuild/scripts')
-rw-r--r--mesonbuild/scripts/yelphelper.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/mesonbuild/scripts/yelphelper.py b/mesonbuild/scripts/yelphelper.py
index ab99267..0f8b0b8 100644
--- a/mesonbuild/scripts/yelphelper.py
+++ b/mesonbuild/scripts/yelphelper.py
@@ -17,6 +17,7 @@ import subprocess
import shutil
import argparse
from .. import mlog
+from ..mesonlib import has_path_sep
from . import destdir_join
from .gettext import read_linguas
@@ -79,7 +80,7 @@ def install_help(srcdir, blddir, sources, media, langs, install_dir, destdir, pr
elif symlinks:
srcfile = os.path.join(c_install_dir, m)
mlog.log('Symlinking %s to %s.' % (outfile, srcfile))
- if '/' in m or '\\' in m:
+ if has_path_sep(m):
os.makedirs(os.path.dirname(outfile), exist_ok=True)
try:
try:
@@ -94,7 +95,7 @@ def install_help(srcdir, blddir, sources, media, langs, install_dir, destdir, pr
# Lang doesn't have media file so copy it over 'C' one
infile = os.path.join(srcdir, 'C', m)
mlog.log('Installing %s to %s' % (infile, outfile))
- if '/' in m or '\\' in m:
+ if has_path_sep(m):
os.makedirs(os.path.dirname(outfile), exist_ok=True)
shutil.copyfile(infile, outfile)
shutil.copystat(infile, outfile)