diff options
author | Kjell Ahlstedt <kjellahlstedt@gmail.com> | 2021-04-19 14:45:38 +0200 |
---|---|---|
committer | Kjell Ahlstedt <kjellahlstedt@gmail.com> | 2021-04-19 14:45:38 +0200 |
commit | 727241758e46b14cda6940e62651674d8748dc3f (patch) | |
tree | 31cf3e9be3b9b8e8dc53f013b1f4974ccf570540 | |
parent | 5224ea90bb1a8811763f43d1d51e906a84181b71 (diff) | |
download | mm-common-727241758e46b14cda6940e62651674d8748dc3f.tar.gz |
Make quiet installations possible
* util/build_scripts/doc-reference.py:
* util/build_scripts/generate-binding.py:
* util/meson_aux/extra-install-cmd.py: Don't print names of installed
files or other informative messages if the environment variable
MESON_INSTALL_QUIET is set.
It is set by "meson install --quiet" in Meson 0.54.0 and newer.
-rwxr-xr-x | util/build_scripts/doc-reference.py | 9 | ||||
-rwxr-xr-x | util/build_scripts/generate-binding.py | 7 | ||||
-rwxr-xr-x | util/meson_aux/extra-install-cmd.py | 2 |
3 files changed, 12 insertions, 6 deletions
diff --git a/util/build_scripts/doc-reference.py b/util/build_scripts/doc-reference.py index 8edd6ba..c9a3a80 100755 --- a/util/build_scripts/doc-reference.py +++ b/util/build_scripts/doc-reference.py @@ -100,14 +100,17 @@ def install_doc(): os.makedirs(destdir_htmlrefdir, exist_ok=True) os.makedirs(destdir_devhelpdir, exist_ok=True) + verbose = [] + if not os.getenv('MESON_INSTALL_QUIET'): + verbose = ['--verbose'] + # Install html files. cmd = [ 'perl', '--', os.path.join(MMDOCTOOLDIR, 'doc-install.pl'), - '--verbose', '--mode=0644', - ] + sys.argv[6:] + [ + ] + verbose + sys.argv[6:] + [ '-t', destdir_htmlrefdir, '--glob', '--', @@ -121,8 +124,8 @@ def install_doc(): 'perl', '--', os.path.join(MMDOCTOOLDIR, 'doc-install.pl'), - '--verbose', '--mode=0644', + ] + verbose + [ '--book-base=' + prefix_htmlrefdir.rstrip('/'), '-t', destdir_devhelpdir, '--', diff --git a/util/build_scripts/generate-binding.py b/util/build_scripts/generate-binding.py index b412521..c88bc5c 100755 --- a/util/build_scripts/generate-binding.py +++ b/util/build_scripts/generate-binding.py @@ -96,15 +96,18 @@ def install_built_h_files(): # Create the installation directory, if it does not exist. os.makedirs(os.path.join(install_dir, 'private'), exist_ok=True) + quiet = bool(os.getenv('MESON_INSTALL_QUIET')) for file in sys.argv[4:]: path_h = os.path.join(built_h_dir, file+'.h') - print('Installing ', path_h, ' to ', install_dir) + if not quiet: + print('Installing ', path_h, ' to ', install_dir) # shutil.copy2() copies timestamps and some other file metadata. shutil.copy2(path_h, install_dir) path_h = os.path.join(built_h_dir, 'private', file+'_p.h') install_priv_dir = os.path.join(install_dir, 'private') - print('Installing ', path_h, ' to ', install_priv_dir) + if not quiet: + print('Installing ', path_h, ' to ', install_priv_dir) shutil.copy2(path_h, install_priv_dir) return 0 diff --git a/util/meson_aux/extra-install-cmd.py b/util/meson_aux/extra-install-cmd.py index 2b6d4e2..b79c2fe 100755 --- a/util/meson_aux/extra-install-cmd.py +++ b/util/meson_aux/extra-install-cmd.py @@ -9,7 +9,7 @@ import os import sys import subprocess -if not os.getenv('DESTDIR'): +if not (os.getenv('DESTDIR') or os.getenv('MESON_INSTALL_QUIET')): # Inform the installer that M4 macro files installed in a directory # not known to aclocal will not be picked up automatically. # (Starting with Python 3.7 text=True is a more understandable equivalent to |