Commit Graph

189 Commits

Author SHA1 Message Date
Henk van der Laan 0e07f1a896 Remove all files outside the source directory from the coverage report
Cuurently, a set of directories is filtered out from the output based on
the location of system includes on most common linux distro's. This
commit does away with the blacklist and implements a whitelist approach:
only the files inside the source root are shown.
2018-02-08 00:39:37 +02:00
Aleksey Filippov 20c1cb7d02 Fix install_subdir() installation message
Print full destination path in 'Installing subdir ...' message,
including DESTDIR, consistent with other installation functions.
Use separate dst_dir and full_dst_dir variables to avoid mixing up
the order in the future and make code more readable.
Closes #3006.
2018-02-05 22:34:30 +02:00
Aleksey Filippov 8fe8161014 Refactor and simplify install_subdir()
- Pass exclude_files and exclude_directories relative to src_dir,
  same as specified by user and documented in public install_subdir().
- Make do_copydir() interface similar to do_copyfile():
  install src_dir contents to dst_dir.
- Remove src_prefix/src_dir code, it adds confusion and duplicates arguments.
  Use single src_dir parameter instead.
- Make callers specify that src_dir contents should be installed
  under dst_dir/basename(src_dir) if necessary.
- Use os.path.relpath() instead of string manipulations on paths.
- Add documentation to do_copydir(): specify types and add usage example.
2018-02-04 00:43:00 +02:00
Aleksey Filippov 2cf85ae16f Use os.path: basename() and dirname() instead of split()
According to Python documentation[1] dirname and basename
are defined as follows:
    os.path.dirname() = os.path.split()[0]
    os.path.basename() = os.path.split()[1]
For the purpose of better readability split() is replaced
by appropriate function if only one part of returned tuple
is used.

[1]: https://docs.python.org/3/library/os.path.html#os.path.split
2018-01-30 07:08:22 +11:00
Félix Piédallu 5f3c282e6e Echo coverage report uris after generation. Fixes #2805. 2018-01-30 06:35:03 +11:00
Ilia Mirkin d8967054d1 Avoid worrying about encodings when capturing child program output
The output may be a binary data stream, not subject to any locale
encoding. This avoids any encoding errors that might arise as a result.
Also fixes github issue #2868.
2018-01-14 14:07:55 +02:00
Ting-Wei Lan 9ec950c4ae gtkdochelper: Set LD_LIBRARY_PATH from -Wl,-rpath arguments
gnome.gtkdoc uses -Wl,-rpath to ensure the scanner executable built by
gtkdoc-scangobj will load shared libraries from the correct directories.
However, FreeBSD configures its linker to use --enable-new-dtags by
default, which converts RPATH to RUNPATH. If users have LD_LIBRARY_PATH
environment variable set, RUNPATH will be overrided by LD_LIBRARY_PATH
and libraries will be loaded from wrong directories, causing undefined
symbol error when running the executable.

In order to solve the problem, we have to prepend directories specified
with -Wl,-rpath to LD_LIBRARY_PATH to avoid relying on the deprecated
RPATH attribute.
2018-01-07 01:56:05 +08:00
snsmac 27d5c1c3f9 The scanbuild script does now also look for executables with a version in the name 2017-12-30 23:22:39 +02:00
snsmac 2b12d3b20f Exclude llvm/clang lib headers from test coverage
Excludes the /usr/lib/llvm-*/include/ directory from coverage.
This directory is used on Ubuntu for the libclang-dev packages
2017-12-17 13:26:40 +02:00
behlec 4217a9ca7e Check for more errors when executing subprocess. (#2746) 2017-12-09 01:52:13 +02:00
behlec 5992ab1c72 Improve error handling when failing to execute program. (#2743) 2017-12-07 21:31:24 +02:00
Jussi Pakkanen 22adda1617 Review fixes. 2017-11-21 23:29:06 +02:00
Jussi Pakkanen 5d51bc79c7 Replaced sys.executable use with the mesonlib equivalent. 2017-11-20 23:08:17 +02:00
Zbigniew Jędrzejewski-Szmek fadce7f9b4 Silence failed restorecon calls when $DESTDIR is set
This avoids hundres of warnings like:
Warning no default label for /var/tmp/instroot.hUbtYJ/path/to/some/binary

$DESTDIR is usually set to a temporary path, in which case the path is
unknown to selinux. For that case we could just skip the restorecon
calls.  But sometimes it is used with a path to container. In that
case, most of the time, selinux has no context for that path. But we
can't rule that out somebody added custom context rules for the
container. So let's still call restorecon, but silence the warning.
2017-11-19 18:26:46 +02:00
Elliott Sales de Andrade f91c4805b1 Pass restorecon file list through stdin.
This should avoid any issues with command-line argument limits.
2017-11-11 03:10:29 -05:00
Elliott Sales de Andrade 5f8b37d0e7 Coalesce restorecon calls into one.
Fixes #2596.
2017-11-09 19:45:28 -05:00
Xavier Claessens 7121eb8c51 gtkdoc: Pass the linker down to gtkdoc-scangobj
Closes #2540
2017-11-07 23:56:18 +02:00
Niklas Claesson 3fcf4ad272 MSI: Fix regenerate with visual studio
Fixes #2461
2017-10-19 20:18:46 +03:00
Corentin Noël 93d2ced31f Create the .po file with the `update_po` subcommand if it doesn't exist 2017-10-07 18:03:22 +03:00
Jussi Pakkanen 876b2475dd Made man page gzip creation deterministic. Closes #2363. 2017-09-23 11:31:59 +03:00
Jussi Pakkanen 19e22ac88a Merge pull request #2216 from ebassi/yelp-linguas
Support LINGUAS for gnome.yelp() languages
2017-09-14 21:35:50 +03:00
Nirbheek Chauhan c63aa0372b install: Also ignore PermissionError for selinux
When the user does not have permissions to run `selinuxenabled`, a
PermissionError is raised instead of FileNotFoundError.

Closes https://github.com/mesonbuild/meson/issues/2257
2017-09-04 19:24:31 +03:00
Gabríel Arthúr Pétursson 24ff7da0d2 Remove leftover debug print statement in meson_install.py 2017-08-20 23:16:42 +03:00
Emmanuele Bassi 0545228fdd Re-use gettext.read_linguas in yelphelper 2017-08-18 19:06:22 +01:00
Emmanuele Bassi 06fdabb7ac Support LINGUAS for gnome.yelp() languages
Listing all languages inside meson.build for the Yelp-based manual
localisation is error-prone, and it also requires parsing and modifying
Meson files from external tools.

Just like we do for i18n, we can use an ancillary `LINGUAS` file in the
help source sub-directory to list all the help languages.
2017-08-18 15:22:37 +01:00
Jussi Pakkanen 50fb7d37ab Make all functionality invokable via the main Meson binary,
which can be a Windows .exe file.
2017-08-18 12:08:20 +03:00
Stefan Sonski 462813f8f1 Exclude system sources from test coverage
Exclude /usr/src/ from code coverage, this is included for e.g. gtest/gmock.
2017-08-11 00:39:59 +03:00
Elliott Sales de Andrade 5cb1d00537 Allow excluding files from `install_subdir`
The install_subdir command now accepts a new `exclude` keyword argument
that allows specified files to be excluded from the installed
subdirectory.
2017-08-06 03:58:35 -04:00
Peter Hutterer d436869a89 Remove directories created by ninja install
Introduce a DirMaker class that disassembles the path up to '/' and stores all
directories in a list. That list is in creation order and pre-existing
directories are ignored, i.e. creating the two paths
'/usr/share/foo/bar/baz' and '/usr/share/foo/bar/boo' is stored as
    [ '/usr/share/foo',
      '/usr/share/foo/bar',
      '/usr/share/foo/bar/baz',
      '/usr/share/foo/bar/boo' ]
This is on the assumption that /usr/share already existed.

After all files have been installed, the list of created directories is
appended in reverse order to the install log. The uninstall script then
triggers rmdir on all directories.

If a custom install script drops files into the directories, removing those
will fail. This matches the current expectation, see the existing warning
"Remember that files created by custom scripts have not been removed."

Unfortunately, this makes the behavior on uninstall inconsistent. Assuming a
non-existing prefix,
        ninja install && ninja uninstall
removes all traces of the install.
However,
        ninja install && ninja install && ninja uninstall
removes the files only, not the directories as they already existed.

This could be fixed by just unconditionally removing any (emtpy) directories
that we drop files into, at the risk of removing system directories if empty.
For example, one could imagine /etc/foo.conf.d/ to be removed in that case if
it is empty.

https://github.com/mesonbuild/meson/issues/2032
2017-08-01 11:40:28 +01:00
Peter Hutterer 36e58e8865 meson_install: rename 'data' to 'd' for consistency
All other functions call it 'd', let's do it here too
2017-08-01 11:40:28 +01:00
Peter Hutterer 1826872fd2 install: restore the SELinux context on install
Try to restore the context for SELinux. If we fail on running
'selinuxenabled', quietly ignore the error and continue. If we fail on the
actual restorecon call, we print a message but disable SELinux - chances are
high that if one restorecon fails, others will too and that's likely a system
setup issue.

Fixes #1967
2017-07-31 18:45:38 -04:00
Jussi Pakkanen db34a3a701 Close files reliably. 2017-07-18 00:33:08 +02:00
Nirbheek Chauhan 04ac7a4844 gnome.gtkdoc: Handle absolute install_dirs correctly
Must prepend DESTDIR in case it's absolute. Also document that by
default it is relative to the gtk-doc html directory.
2017-07-17 12:40:41 +05:30
Jussi Pakkanen b5db2d3128 Return explicit 0 as it is used in a sys.exit statement (just like every other run function). 2017-07-16 12:06:46 +03:00
Jussi Pakkanen 1617634214 Use sys.exit rather than plain exit. 2017-07-16 12:05:09 +03:00
Jussi Pakkanen 624709bfc1 Merge pull request #1920 from QuLogic/hg-dist
Add Mercurial dist support
2017-06-21 04:48:29 -04:00
Elliott Sales de Andrade 79d005364f Add Mercurial dist support. 2017-06-13 00:32:43 -04:00
Elliott Sales de Andrade 1aa1d0d9ad Remove extraneous os.path.split()s.
Since only one part is needed, they can be replaced by dirname,
basename, or the originally joined file name.
2017-06-13 00:12:19 -04:00
Patrick Griffis 7764c0a7fa gnome.yelp(): Handle file existing on symlink
Fixes #1921
2017-06-09 22:03:28 -04:00
Patrick Griffis b2d9e4c1c0 gnome.yelp(): Handle platforms where symlink not supported 2017-06-09 21:59:45 -04:00
Patrick Griffis cacc8d99ce gnome.yelp(): Make copies of media files when symlink is false 2017-06-09 21:56:34 -04:00
Jussi Pakkanen 4ed68e7934 Merge pull request #1866 from ebassi/mkdb-args
Add mkdb_args support to gnome.gtkdoc()
2017-06-07 21:01:49 +03:00
Rene Lopez 94f46447bb Allow empty extra arguments in gettext script 2017-06-03 21:31:27 +03:00
Alistair Thomas a195b78c8d Whitespace tweaks to reduce Flake8 warnings 2017-05-29 19:32:47 +03:00
Emmanuele Bassi f3aa309fa1 Add mkdb_args support to gnome.gtkdoc()
There are cases where we need to specify arguments to gtkdoc-mkdb, like
telling it to scan extensions that are not '.h' and '.c'. Let's add a
new named argument to gnome.gtkdoc(), as well as the plumbing needed for
the gtk-doc helper script.
2017-05-28 23:58:54 +01:00
Jussi Pakkanen effe4fb134 Create helper function for a rmtree that works reliably on Windows. 2017-05-21 21:47:24 +03:00
Elliott Sales de Andrade c69d82795c Delete the correct directory in dist check. 2017-05-17 19:43:23 -04:00
Elliott Sales de Andrade 34e4d32ac7 Remove dead code paths. 2017-05-17 19:43:23 -04:00
Elliott Sales de Andrade ea636fcd51 Remove unused variables. 2017-05-17 04:41:54 -04:00
Elliott Sales de Andrade 65b1d33931 Remove unused imports. 2017-05-17 03:42:16 -04:00