aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/scripts')
-rw-r--r--mesonbuild/scripts/dist.py2
-rw-r--r--mesonbuild/scripts/gtkdochelper.py14
-rw-r--r--mesonbuild/scripts/meson_exe.py2
-rw-r--r--mesonbuild/scripts/symbolextractor.py4
4 files changed, 11 insertions, 11 deletions
diff --git a/mesonbuild/scripts/dist.py b/mesonbuild/scripts/dist.py
index 309a032..47fde23 100644
--- a/mesonbuild/scripts/dist.py
+++ b/mesonbuild/scripts/dist.py
@@ -133,7 +133,7 @@ def create_dist_hg(dist_name, src_root, bld_root, dist_sub, dist_scripts):
tarname = os.path.join(dist_sub, dist_name + '.tar')
xzname = tarname + '.xz'
subprocess.check_call(['hg', 'archive', '-R', src_root, '-S', '-t', 'tar', tarname])
- if len(dist_scripts) > 0:
+ if dist_scripts:
mlog.warning('dist scripts are not supported in Mercurial projects')
with lzma.open(xzname, 'wb') as xf, open(tarname, 'rb') as tf:
shutil.copyfileobj(tf, xf)
diff --git a/mesonbuild/scripts/gtkdochelper.py b/mesonbuild/scripts/gtkdochelper.py
index 01ced5b..11d31b6 100644
--- a/mesonbuild/scripts/gtkdochelper.py
+++ b/mesonbuild/scripts/gtkdochelper.py
@@ -175,7 +175,7 @@ def build_gtkdoc(source_root, build_root, doc_subdir, src_subdirs,
mkdb_cmd.append('--name-space=' + namespace)
if modeflag:
mkdb_cmd.append(modeflag)
- if len(main_file) > 0:
+ if main_file:
# Yes, this is the flag even if the file is in xml.
mkdb_cmd.append('--main-sgml-file=' + main_file)
# Add user-specified arguments
@@ -187,7 +187,7 @@ def build_gtkdoc(source_root, build_root, doc_subdir, src_subdirs,
'--path=' + ':'.join((doc_src, abs_out)),
module,
] + html_args
- if len(main_file) > 0:
+ if main_file:
mkhtml_cmd.append('../' + main_file)
else:
mkhtml_cmd.append('%s-docs.xml' % module)
@@ -212,23 +212,23 @@ def install_gtkdoc(build_root, doc_subdir, install_prefix, datadir, module):
def run(args):
options = parser.parse_args(args)
- if len(options.htmlargs) > 0:
+ if options.htmlargs:
htmlargs = options.htmlargs.split('@@')
else:
htmlargs = []
- if len(options.scanargs) > 0:
+ if options.scanargs:
scanargs = options.scanargs.split('@@')
else:
scanargs = []
- if len(options.scanobjsargs) > 0:
+ if options.scanobjsargs:
scanobjsargs = options.scanobjsargs.split('@@')
else:
scanobjsargs = []
- if len(options.fixxrefargs) > 0:
+ if options.fixxrefargs:
fixxrefargs = options.fixxrefargs.split('@@')
else:
fixxrefargs = []
- if len(options.mkdbargs) > 0:
+ if options.mkdbargs:
mkdbargs = options.mkdbargs.split('@@')
else:
mkdbargs = []
diff --git a/mesonbuild/scripts/meson_exe.py b/mesonbuild/scripts/meson_exe.py
index 23c7334..a862ec5 100644
--- a/mesonbuild/scripts/meson_exe.py
+++ b/mesonbuild/scripts/meson_exe.py
@@ -60,7 +60,7 @@ def run_exe(exe):
cmd = exe.fname
child_env = os.environ.copy()
child_env.update(exe.env)
- if len(exe.extra_paths) > 0:
+ if exe.extra_paths:
child_env['PATH'] = (os.pathsep.join(exe.extra_paths + ['']) +
child_env['PATH'])
if exe.exe_runner and mesonlib.substring_is_in_list('wine', exe.exe_runner.get_command()):
diff --git a/mesonbuild/scripts/symbolextractor.py b/mesonbuild/scripts/symbolextractor.py
index 95ea0ec..410cb33 100644
--- a/mesonbuild/scripts/symbolextractor.py
+++ b/mesonbuild/scripts/symbolextractor.py
@@ -69,7 +69,7 @@ def linux_syms(libfilename, outfilename):
if pnm.returncode != 0:
raise RuntimeError('nm does not work.')
for line in output.split('\n'):
- if len(line) == 0:
+ if not line:
continue
line_split = line.split()
entry = line_split[0:2]
@@ -91,7 +91,7 @@ def osx_syms(libfilename, outfilename):
pnm, output = Popen_safe(['nm', '-g', '-P', libfilename])[0:2]
if pnm.returncode != 0:
raise RuntimeError('nm does not work.')
- result += [' '.join(x.split()[0:2]) for x in output.split('\n') if len(x) > 0 and not x.endswith('U')]
+ result += [' '.join(x.split()[0:2]) for x in output.split('\n') if x and not x.endswith('U')]
write_if_changed('\n'.join(result) + '\n', outfilename)
def gen_symbols(libfilename, outfilename, cross_host):