aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/minstall.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2018-10-04 21:19:39 +0300
committerGitHub <noreply@github.com>2018-10-04 21:19:39 +0300
commit577d6bfdb483452b2a9434ba3a1d7031094b0cbd (patch)
tree1dac74f6e858db7c896e033062a125ac2048aacd /mesonbuild/minstall.py
parent019a627f047667ea04574cebb9a174156b2a7a67 (diff)
parentadae6b56de5d8dac7b2eddbb3b9924e440a28fd6 (diff)
downloadmeson-577d6bfdb483452b2a9434ba3a1d7031094b0cbd.zip
meson-577d6bfdb483452b2a9434ba3a1d7031094b0cbd.tar.gz
meson-577d6bfdb483452b2a9434ba3a1d7031094b0cbd.tar.bz2
Merge pull request #4204 from xclaesse/unify-cmd-line
Use a single ArgumentParser for all subcommands
Diffstat (limited to 'mesonbuild/minstall.py')
-rw-r--r--mesonbuild/minstall.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py
index 1d72179..b65abe0 100644
--- a/mesonbuild/minstall.py
+++ b/mesonbuild/minstall.py
@@ -14,7 +14,6 @@
import sys, pickle, os, shutil, subprocess, gzip, errno
import shlex
-import argparse
from glob import glob
from .scripts import depfixer
from .scripts import destdir_join
@@ -33,15 +32,13 @@ build definitions so that it will not break when the change happens.'''
selinux_updates = []
-def buildparser():
- parser = argparse.ArgumentParser(prog='meson install')
+def add_arguments(parser):
parser.add_argument('-C', default='.', dest='wd',
help='directory to cd into before running')
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',
help='Only overwrite files that are older than the copied file.')
- return parser
class DirMaker:
def __init__(self, lf):
@@ -501,9 +498,7 @@ class Installer:
else:
raise
-def run(args):
- parser = buildparser()
- opts = parser.parse_args(args)
+def run(opts):
datafilename = 'meson-private/install.dat'
private_dir = os.path.dirname(datafilename)
log_dir = os.path.join(private_dir, '../meson-logs')
@@ -520,6 +515,3 @@ def run(args):
append_to_log(lf, '# Does not contain files installed by custom scripts.')
installer.do_install(datafilename)
return 0
-
-if __name__ == '__main__':
- sys.exit(run(sys.argv[1:]))