aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/minstall.py
diff options
context:
space:
mode:
authorNicolas Schneider <nioncode+git@gmail.com>2019-01-01 20:47:04 +0100
committerJussi Pakkanen <jpakkane@gmail.com>2019-01-01 22:37:44 +0200
commit211a60dc99814766a8bb26cd15e795bbae545656 (patch)
treefc1aea32e1d59730901e753ee1c27b64600f3345 /mesonbuild/minstall.py
parent31e1a310309f6a3c46ff837414f70ee120397565 (diff)
downloadmeson-211a60dc99814766a8bb26cd15e795bbae545656.zip
meson-211a60dc99814766a8bb26cd15e795bbae545656.tar.gz
meson-211a60dc99814766a8bb26cd15e795bbae545656.tar.bz2
print 'Nothing to install.' if nothing was installed
Fixes #882.
Diffstat (limited to 'mesonbuild/minstall.py')
-rw-r--r--mesonbuild/minstall.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py
index 8ac6aab..4cdd3c6 100644
--- a/mesonbuild/minstall.py
+++ b/mesonbuild/minstall.py
@@ -211,6 +211,7 @@ def check_for_stampfile(fname):
class Installer:
def __init__(self, options, lf):
+ self.did_install_something = False
self.options = options
self.lf = lf
@@ -334,6 +335,7 @@ class Installer:
if d.install_umask is not None:
os.umask(d.install_umask)
+ self.did_install_something = False
try:
d.dirmaker = DirMaker(self.lf)
with d.dirmaker:
@@ -344,6 +346,8 @@ class Installer:
self.install_data(d)
restore_selinux_contexts()
self.run_install_script(d)
+ if not self.did_install_something:
+ print('Nothing to install.')
except PermissionError:
if shutil.which('pkexec') is not None and 'PKEXEC_UID' not in os.environ:
print('Installation failed due to insufficient permissions.')
@@ -355,6 +359,7 @@ class Installer:
def install_subdirs(self, d):
for (src_dir, dst_dir, mode, exclude) in d.install_subdirs:
+ self.did_install_something = True
full_dst_dir = get_destdir_path(d, dst_dir)
print('Installing subdir %s to %s' % (src_dir, full_dst_dir))
d.dirmaker.makedirs(full_dst_dir, exist_ok=True)
@@ -362,6 +367,7 @@ class Installer:
def install_data(self, d):
for i in d.data:
+ self.did_install_something = True
fullfilename = i[0]
outfilename = get_destdir_path(d, i[1])
mode = i[2]
@@ -372,6 +378,7 @@ class Installer:
def install_man(self, d):
for m in d.man:
+ self.did_install_something = True
full_source_filename = m[0]
outfilename = get_destdir_path(d, m[1])
outdir = os.path.dirname(outfilename)
@@ -382,6 +389,7 @@ class Installer:
def install_headers(self, d):
for t in d.headers:
+ self.did_install_something = True
fullfilename = t[0]
fname = os.path.basename(fullfilename)
outdir = get_destdir_path(d, t[1])
@@ -403,6 +411,7 @@ class Installer:
child_env.update(env)
for i in d.install_scripts:
+ self.did_install_something = True # Custom script must report itself if it does nothing.
script = i['exe']
args = i['args']
name = ' '.join(script + args)
@@ -417,6 +426,7 @@ class Installer:
def install_targets(self, d):
for t in d.targets:
+ self.did_install_something = True
if not os.path.exists(t.fname):
# For example, import libraries of shared modules are optional
if t.optional: