diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2020-02-12 02:19:33 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek.chauhan@gmail.com> | 2020-02-17 23:58:20 +0530 |
commit | fa036a2127fb8a1ed4c6257e6e341a2c7360164a (patch) | |
tree | 3970ec997a66311cb796a31d1f84057618bc5e45 | |
parent | b7c70c47a6473ee81b744b37da5a9f16b69d57a1 (diff) | |
download | meson-fa036a2127fb8a1ed4c6257e6e341a2c7360164a.zip meson-fa036a2127fb8a1ed4c6257e6e341a2c7360164a.tar.gz meson-fa036a2127fb8a1ed4c6257e6e341a2c7360164a.tar.bz2 |
minstall: Add new hidden argument --profile-self
Same purpose as `meson setup`.
-rw-r--r-- | mesonbuild/minstall.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py index cc6ea0a..4bcb327 100644 --- a/mesonbuild/minstall.py +++ b/mesonbuild/minstall.py @@ -13,6 +13,7 @@ # limitations under the License. import sys, pickle, os, shutil, subprocess, errno +import argparse import shlex from glob import glob from .scripts import depfixer @@ -35,6 +36,8 @@ selinux_updates = [] def add_arguments(parser): parser.add_argument('-C', default='.', dest='wd', help='directory to cd into before running') + parser.add_argument('--profile-self', action='store_true', dest='profile', + help=argparse.SUPPRESS) parser.add_argument('--no-rebuild', default=False, action='store_true', help='Do not rebuild before installing.') parser.add_argument('--only-changed', default=False, action='store_true', @@ -515,5 +518,10 @@ def run(opts): installer = Installer(opts, lf) append_to_log(lf, '# List of files installed by Meson') append_to_log(lf, '# Does not contain files installed by custom scripts.') - installer.do_install(datafilename) + if opts.profile: + import cProfile as profile + fname = os.path.join(private_dir, 'profile-installer.log') + profile.runctx('installer.do_install(datafilename)', globals(), locals(), filename=fname) + else: + installer.do_install(datafilename) return 0 |