Repository: mesonbuild/meson

Issue:
print some message when installing that there is nothing to install
```
$ meson --prefix=/tmp/tmp
The Meson build system
Version: 0.34.0
Source dir: /home/zeenix/progs/meson
Build dir: /home/zeenix/progs/meson/build
Build type: native build
Build machine cpu family: x86_64
Build machine cpu: x86_64
Project name: tutorial
Native c compiler: ccache cc (gcc 6.2.1)
Appending LDFLAGS from environment: '-L/jhbuild/lib '
Found pkg-config: /usr/bin/pkg-config (0.29)
Native dependency gtk+-3.0 found: YES 3.22.1
Build targets in project: 1
[zeenix@zeelaptop build]$ ninja-build install -v
[1/3] ccache cc  '-Idemo@exe' '-fdiagnostics-color=always' '-I..' '-I.' '-pipe' '-Wall' '-Winvalid-pch' '-O0' '-g' '-pthread' '-I/jhbuild/include/gtk-3.0' '-I/jhbuild/include/at-spi2-atk/2.0' '-I/jhbuild/include/at-spi-2.0' '-I/jhbuild/include/gtk-3.0' '-I/jhbuild/include/gio-unix-2.0/' '-I/jhbuild/include/pango-1.0' '-I/jhbuild/include/harfbuzz' '-I/jhbuild/include/pango-1.0' '-I/jhbuild/include/atk-1.0' '-I/jhbuild/include/gdk-pixbuf-2.0' '-I/jhbuild/include/glib-2.0' '-I/jhbuild/lib/glib-2.0/include' '-I/usr/include/dbus-1.0' '-I/usr/lib64/dbus-1.0/include' '-I/usr/include/cairo' '-I/usr/include/pixman-1' '-I/usr/include/freetype2' '-I/usr/include/libpng16' '-I/usr/include/freetype2' '-I/usr/include/libdrm' '-I/usr/include/libpng16' '-MMD' '-MQ' 'demo@exe/main.c.o' '-MF' 'demo@exe/main.c.o.d' -o 'demo@exe/main.c.o' -c ../main.c
[2/3] ccache cc    -o demo 'demo@exe/main.c.o' '-Wl,--no-undefined' '-Wl,--as-needed' '-L/jhbuild/lib' '-L/jhbuild/lib' '-lgtk-3' '-lgdk-3' '-lpangocairo-1.0' '-lpango-1.0' '-latk-1.0' '-lcairo-gobject' '-lcairo' '-lgdk_pixbuf-2.0' '-lgio-2.0' '-lgobject-2.0' '-lglib-2.0' 
[2/3] '/usr/bin/python3' '/usr/bin/meson' '--internal' 'install' '/home/zeenix/progs/meson/build/meson-private/install.dat'
[zeenix@zeelaptop build]$ ls /tmp/tmp/
```

This doesn't help.



Discussion:
Are you working on this @ignatenkobrain?

What do we gain by printing something like 'Nothing to install'? Everything that is declared to be installed (in this case nothing) was properly installed.
One suspects that this would help the person who believes that something should have been installed to discover that they were mistaken, and that they need to investigate further.
If you were to type
`$ sudo cp ~/foo/build/foo.exe /bin`
and foo.exe didn't exist, you would receive some notification.

Resolving patch:
diff --git a/mesonbuild/minstall.py b/mesonbuild/minstall.py
--- 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 @@ def do_install(self, datafilename):
         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 @@ def do_install(self, datafilename):
                 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 @@ def do_install(self, datafilename):
 
     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 @@ def install_subdirs(self, d):
 
     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 @@ def install_data(self, d):
 
     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 @@ def install_man(self, d):
 
     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 @@ def run_install_script(self, d):
         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 @@ def run_install_script(self, d):
 
     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:


Test patch: