aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mintro.py
diff options
context:
space:
mode:
authorThibault Saunier <tsaunier@gnome.org>2016-12-15 09:44:30 -0300
committerJussi Pakkanen <jpakkane@gmail.com>2016-12-15 22:19:43 +0200
commit925f880e6ba4155a9a2d9b075cde20eff25039ca (patch)
treea6d7444b80492e23dc5813fa7af11401670e636c /mesonbuild/mintro.py
parentb80f8b2dc2d1ca838c814ae1b8842860a39de175 (diff)
downloadmeson-925f880e6ba4155a9a2d9b075cde20eff25039ca.zip
meson-925f880e6ba4155a9a2d9b075cde20eff25039ca.tar.gz
meson-925f880e6ba4155a9a2d9b075cde20eff25039ca.tar.bz2
introspect: Allow listing all installed files
Diffstat (limited to 'mesonbuild/mintro.py')
-rw-r--r--mesonbuild/mintro.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py
index f902d3d..3f1d209 100644
--- a/mesonbuild/mintro.py
+++ b/mesonbuild/mintro.py
@@ -27,6 +27,8 @@ import sys, os
parser = argparse.ArgumentParser()
parser.add_argument('--targets', action='store_true', dest='list_targets', default=False,
help='List top level targets.')
+parser.add_argument('--installed', action='store_true', dest='list_installed', default=False,
+ help='List all installed files and directories.')
parser.add_argument('--target-files', action='store', dest='target_files', default=None,
help='List source files for a given target.')
parser.add_argument('--buildsystem-files', action='store_true', dest='buildsystem_files', default=False,
@@ -56,6 +58,15 @@ def determine_installed_path(target, installdata):
outname = os.path.join(installdata.prefix, outdir, os.path.split(fname)[-1])
return outname
+
+def list_installed(installdata):
+ res = {}
+ for path, installpath in installdata.data:
+ res[path] = os.path.join(installdata.prefix, installpath)
+
+ print(json.dumps(res))
+
+
def list_targets(coredata, builddata, installdata):
tlist = []
for (idname, target) in builddata.get_targets().items():
@@ -219,6 +230,8 @@ def run(args):
installdata = pickle.load(f)
if options.list_targets:
list_targets(coredata, builddata, installdata)
+ elif options.list_installed:
+ list_installed(installdata)
elif options.target_files is not None:
list_target_files(options.target_files, coredata, builddata)
elif options.buildsystem_files: