summaryrefslogtreecommitdiff
path: root/mesonbuild/scripts
AgeCommit message (Collapse)Author
2017-08-01Remove directories created by ninja installPeter Hutterer
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-01meson_install: rename 'data' to 'd' for consistencyPeter Hutterer
All other functions call it 'd', let's do it here too
2017-07-31install: restore the SELinux context on installPeter Hutterer
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-18Close files reliably.Jussi Pakkanen
2017-07-17gnome.gtkdoc: Handle absolute install_dirs correctlyNirbheek Chauhan
Must prepend DESTDIR in case it's absolute. Also document that by default it is relative to the gtk-doc html directory.
2017-07-16Return explicit 0 as it is used in a sys.exit statement (just like every ↵Jussi Pakkanen
other run function).
2017-07-16Use sys.exit rather than plain exit.Jussi Pakkanen
2017-06-21Merge pull request #1920 from QuLogic/hg-distJussi Pakkanen
Add Mercurial dist support
2017-06-13Add Mercurial dist support.Elliott Sales de Andrade
2017-06-13Remove extraneous os.path.split()s.Elliott Sales de Andrade
Since only one part is needed, they can be replaced by dirname, basename, or the originally joined file name.
2017-06-09gnome.yelp(): Handle file existing on symlinkPatrick Griffis
Fixes #1921
2017-06-09gnome.yelp(): Handle platforms where symlink not supportedPatrick Griffis
2017-06-09gnome.yelp(): Make copies of media files when symlink is falsePatrick Griffis
2017-06-07Merge pull request #1866 from ebassi/mkdb-argsJussi Pakkanen
Add mkdb_args support to gnome.gtkdoc()
2017-06-03Allow empty extra arguments in gettext scriptRene Lopez
2017-05-29Whitespace tweaks to reduce Flake8 warningsAlistair Thomas
2017-05-28Add mkdb_args support to gnome.gtkdoc()Emmanuele Bassi
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-21Create helper function for a rmtree that works reliably on Windows.Jussi Pakkanen
2017-05-17Delete the correct directory in dist check.Elliott Sales de Andrade
2017-05-17Remove dead code paths.Elliott Sales de Andrade
2017-05-17Remove unused variables.Elliott Sales de Andrade
2017-05-17Remove unused imports.Elliott Sales de Andrade
2017-05-13Strip system directories and show coverage for files not executed at all. ↵Jussi Pakkanen
Closes #1721.
2017-05-13Moved coverage commands to a standalone script.Jussi Pakkanen
2017-05-12Add test and release notes.Jussi Pakkanen
2017-05-11Initialise submodules.Jussi Pakkanen
2017-05-11Test created tarball by doing a full build + test + install cycle.Jussi Pakkanen
2017-05-11Created a dist target. Closes #877.Jussi Pakkanen
2017-05-04Use American English: behaviour -> behaviorPeter Hutterer
2017-05-03Merge pull request #1587 from mesonbuild/tingping/msgfmt-datadirJussi Pakkanen
i18n: Improve data_dirs support
2017-05-02Don't use len() to test emptiness vs not emptinessDylan Baker
Meson has a common pattern of using 'if len(foo) == 0:' or 'if len(foo) != 0:', however, this is a common anti-pattern in python. Instead tests for emptiness/non-emptiness should be done with a simple 'if foo:' or 'if not foo:' Consider the following: >>> import timeit >>> timeit.timeit('if len([]) == 0: pass') 0.10730923599840025 >>> timeit.timeit('if not []: pass') 0.030033907998586074 >>> timeit.timeit('if len(['a', 'b', 'c', 'd']) == 0: pass') 0.1154778649979562 >>> timeit.timeit("if not ['a', 'b', 'c', 'd']: pass") 0.08259823200205574 >>> timeit.timeit('if len("") == 0: pass') 0.089759664999292 >>> timeit.timeit('if not "": pass') 0.02340641999762738 >>> timeit.timeit('if len("foo") == 0: pass') 0.08848102600313723 >>> timeit.timeit('if not "foo": pass') 0.04032287199879647 And for the one additional case of 'if len(foo.strip()) == 0', which can be replaced with 'if not foo.isspace()' >>> timeit.timeit('if len(" ".strip()) == 0: pass') 0.15294511600222904 >>> timeit.timeit('if " ".isspace(): pass') 0.09413968399894657 >>> timeit.timeit('if len(" abc".strip()) == 0: pass') 0.2023209120015963 >>> timeit.timeit('if " abc".isspace(): pass') 0.09571301700270851 In other words, it's always a win to not use len(), when you don't actually want to check the length.
2017-04-29i18n: Add data_dirs kwarg to merge_file()Patrick Griffis
For parity with gettext() Fixes #1565
2017-04-19Drop terminating fullstop from "Installing blah to blah" messagesPeter Hutterer
Grammatically, this full stop isn't needed and with file names it has a potential to be confusing: Installing /foo/bar/filename.1 to /foo/bar/dirname. The full stop caused me to do a double-take more than once, so let's drop it.
2017-04-17Do not obliterate old rpath because it might be used due to read only data ↵Jussi Pakkanen
sharing. Closes #1619.
2017-04-13gtkdochelper: Fix type file name optionRafael Fontenelle
'gtkdoc-scangobj' script was recently ported to Python (it was Perl), and it now requires providing '--type' option to specify the name of the file to store the types in. Without this option, 'gtkdockelper' will exit with error status 2 and will throw a message "gtkdoc-scangobj: error: unrecognized arguments: <typefile>"
2017-04-08Merge pull request #1518 from centricular/mesonintrospect-evarJussi Pakkanen
Export MESONINTROSPECT to postconf/install/run_command scripts
2017-04-06Ignore install as non-existent user or groupJon Turney
'test cases/common/12 data' and 'test cases/common/66 install subdir' both try to install something as 'root'. This user doesn't exist on Cygwin. Perhaps we should automatically convert this to some other user, but it's not clear which. For real projects, it's possibly better for the meson.build to explicitly handle this... 'test cases/common/12 data' also tries to install something with GID 0. There's no guarantee this group exists.
2017-04-06Use '.exe' extension for executables for CygwinJon Turney
Use '.exe' extension for executables for Cygwin when building and installing
2017-03-28Export MESONINTROSPECT to postconf/install/run_command scriptsNirbheek Chauhan
Points to the `mesonintrospect.py` script corresponding to the currently-running version of Meson. Includes a test for all three methods of running scripts/commands. Closes https://github.com/mesonbuild/meson/issues/1385
2017-03-02Install PDB files. Closes #1442.Jussi Pakkanen
2017-02-27Use cross stripper when cross compiling and allow overriding native strip ↵Jussi Pakkanen
executable. Closes #1414.
2017-02-06Do not strip jar targets. Closes #1343.Jussi Pakkanen
2017-01-24Support file perms for install_data and install_subdirNirbheek Chauhan
With the 'install_mode' kwarg, you can now specify the file and directory permissions and the owner and the group to be used while installing. You can pass either: * A single string specifying just the permissions * A list of strings with: - The first argument a string of permissions - The second argument a string specifying the owner or an int specifying the uid - The third argument a string specifying the group or an int specifying the gid Specifying `false` as any of the arguments skips setting that one. The format of the permissions kwarg is the same as the symbolic notation used by ls -l with the first character that specifies 'd', '-', 'c', etc for the file type omitted since that is always obvious from the context. Includes unit tests for the same. Sadly these only run on Linux right now, but we want them to run on all platforms. We do set the mode in the integration tests for all platforms but we don't check if they were actually set correctly.
2017-01-18cleanup: Remove redundant parenthesesMike Sinkovsky
2017-01-11style: [E1**] IndentationMike Sinkovsky
2017-01-11style: [E303] too many blank lines (2)Mike Sinkovsky
2017-01-03Merge pull request #1272 from mesonbuild/ignatenko/lintJussi Pakkanen
fix some linting errors
2017-01-03fix 'unreachable code' warningsMike Sinkovsky
2017-01-02style: fix E127 violationsIgor Gnatenko
E127: continuation line over-indented for visual indent Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-01-01style: fix E703 violationsIgor Gnatenko
E703: statement ends with a semicolon Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>