summaryrefslogtreecommitdiff
path: root/mesonbuild/scripts/meson_install.py
Commit message (Collapse)AuthorAgeFilesLines
* Silence failed restorecon calls when $DESTDIR is setZbigniew Jędrzejewski-Szmek2017-11-191-1/+3
| | | | | | | | | | | | 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.
* Pass restorecon file list through stdin.Elliott Sales de Andrade2017-11-111-5/+7
| | | | This should avoid any issues with command-line argument limits.
* Coalesce restorecon calls into one.Elliott Sales de Andrade2017-11-091-16/+12
| | | | Fixes #2596.
* Made man page gzip creation deterministic. Closes #2363.Jussi Pakkanen2017-09-231-1/+3
|
* install: Also ignore PermissionError for selinuxNirbheek Chauhan2017-09-041-1/+1
| | | | | | | 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
* Remove leftover debug print statement in meson_install.pyGabrĂ­el ArthĂșr PĂ©tursson2017-08-201-1/+1
|
* Make all functionality invokable via the main Meson binary,Jussi Pakkanen2017-08-181-1/+4
| | | | which can be a Windows .exe file.
* Allow excluding files from `install_subdir`Elliott Sales de Andrade2017-08-061-5/+15
| | | | | | The install_subdir command now accepts a new `exclude` keyword argument that allows specified files to be excluded from the installed subdirectory.
* Remove directories created by ninja installPeter Hutterer2017-08-011-16/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* meson_install: rename 'data' to 'd' for consistencyPeter Hutterer2017-08-011-3/+3
| | | | All other functions call it 'd', let's do it here too
* install: restore the SELinux context on installPeter Hutterer2017-07-311-0/+24
| | | | | | | | | | 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
* Remove unused variables.Elliott Sales de Andrade2017-05-171-1/+1
|
* Drop terminating fullstop from "Installing blah to blah" messagesPeter Hutterer2017-04-191-4/+4
| | | | | | | | 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.
* Merge pull request #1518 from centricular/mesonintrospect-evarJussi Pakkanen2017-04-081-1/+1
|\ | | | | Export MESONINTROSPECT to postconf/install/run_command scripts
| * Export MESONINTROSPECT to postconf/install/run_command scriptsNirbheek Chauhan2017-03-281-1/+1
| | | | | | | | | | | | | | | | | | 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
* | Ignore install as non-existent user or groupJon Turney2017-04-061-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | '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.
* | Use '.exe' extension for executables for CygwinJon Turney2017-04-061-1/+1
|/ | | | Use '.exe' extension for executables for Cygwin when building and installing
* Install PDB files. Closes #1442.Jussi Pakkanen2017-03-021-0/+5
|
* Use cross stripper when cross compiling and allow overriding native strip ↔Jussi Pakkanen2017-02-271-2/+2
| | | | executable. Closes #1414.
* Do not strip jar targets. Closes #1343.Jussi Pakkanen2017-02-061-0/+3
|
* Support file perms for install_data and install_subdirNirbheek Chauhan2017-01-241-2/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* style: fix E124 violationsIgor Gnatenko2017-01-011-1/+1
| | | | | | E124: closing bracket does not match visual indentation Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* style: fix E226 violationsIgor Gnatenko2017-01-011-2/+2
| | | | | | E226: missing whitespace around arithmetic operator Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* Fix space before :.Jussi Pakkanen2016-12-311-4/+4
|
* Fix shared library symlink aliasing on installNirbheek Chauhan2016-12-221-2/+2
| | | | | | Set the rules for the symlinking on the target itself, and then reuse that information while generating aliases during the build, and then pass it to the install script too.
* tree-wide: remove unused importsIgor Gnatenko2016-12-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ./setup.py:17:1: F401 'os' imported but unused import os ^ ./setup.py:37:1: F401 'stat.ST_MODE' imported but unused from stat import ST_MODE ^ ./run_tests.py:17:1: F401 'os' imported but unused import subprocess, sys, os ^ ./run_tests.py:18:1: F401 'shutil' imported but unused import shutil ^ ./run_unittests.py:23:1: F401 'mesonbuild.dependencies.Qt5Dependency' imported but unused from mesonbuild.dependencies import PkgConfigDependency, Qt5Dependency ^ ./mesonbuild/build.py:15:1: F401 '.coredata' imported but unused from . import coredata ^ ./mesonbuild/interpreter.py:32:1: F401 'subprocess' imported but unused import os, sys, subprocess, shutil, uuid, re ^ ./mesonbuild/interpreter.py:32:1: F401 're' imported but unused import os, sys, subprocess, shutil, uuid, re ^ ./mesonbuild/dependencies.py:23:1: F401 'subprocess' imported but unused import os, stat, glob, subprocess, shutil ^ ./mesonbuild/mesonlib.py:17:1: F401 'sys' imported but unused import platform, subprocess, operator, os, shutil, re, sys ^ ./mesonbuild/modules/qt5.py:15:1: F401 'subprocess' imported but unused import os, subprocess ^ ./mesonbuild/modules/pkgconfig.py:15:1: F401 '..coredata' imported but unused from .. import coredata, build ^ ./mesonbuild/scripts/scanbuild.py:15:1: F401 'sys' imported but unused import sys, os ^ ./mesonbuild/scripts/meson_exe.py:20:1: F401 'subprocess' imported but unused import subprocess ^ ./mesonbuild/scripts/meson_exe.py:22:1: F401 '..mesonlib.MesonException' imported but unused from ..mesonlib import MesonException, Popen_safe ^ ./mesonbuild/scripts/symbolextractor.py:23:1: F401 'subprocess' imported but unused import os, sys, subprocess ^ ./mesonbuild/scripts/symbolextractor.py:25:1: F401 '..mesonlib.MesonException' imported but unused from ..mesonlib import MesonException, Popen_safe ^ ./mesonbuild/scripts/meson_install.py:19:1: F401 '..mesonlib.MesonException' imported but unused from ..mesonlib import MesonException, Popen_safe ^ ./mesonbuild/scripts/yelphelper.py:15:1: F401 'sys' imported but unused import sys, os ^ ./mesonbuild/scripts/yelphelper.py:20:1: F401 '..mesonlib.MesonException' imported but unused from ..mesonlib import MesonException ^ ./mesonbuild/backend/vs2010backend.py:17:1: F401 're' imported but unused import re ^ ./test cases/vala/8 generated sources/src/copy_file.py:3:1: F401 'os' imported but unused import os ^ ./test cases/common/107 postconf/postconf.py:3:1: F401 'sys' imported but unused import sys, os ^ ./test cases/common/129 object only target/obj_generator.py:5:1: F401 'shutil' imported but unused import sys, shutil, subprocess ^ ./test cases/common/57 custom target chain/usetarget/subcomp.py:3:1: F401 'os' imported but unused import sys, os ^ ./test cases/common/95 dep fallback/subprojects/boblib/genbob.py:3:1: F401 'os' imported but unused import os ^ ./test cases/common/98 gen extra/srcgen.py:4:1: F401 'os' imported but unused import os ^ ./test cases/common/113 generatorcustom/gen.py:3:1: F401 'os' imported but unused import sys, os ^ ./test cases/common/113 generatorcustom/catter.py:3:1: F401 'os' imported but unused import sys, os ^ ./test cases/common/59 object generator/obj_generator.py:5:1: F401 'shutil' imported but unused import sys, shutil, subprocess ^ Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* Merge pull request #1216 from mesonbuild/ignatenko/shebangsJussi Pakkanen2016-12-181-2/+0
|\ | | | | Remove shebangs on files inside module
| * remove shebangs from scriptsIgor Gnatenko2016-12-181-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/regen_checker.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/meson_test.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/meson_benchmark.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/meson_exe.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/symbolextractor.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/commandrunner.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/gtkdochelper.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/meson_install.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/depfixer.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/dirchanger.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/delwithsuffix.py 644 /usr/bin/python3 meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/scripts/vcstagger.py 644 /usr/bin/python3 Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
* | custom_target: Make directory outputs installableNirbheek Chauhan2016-12-181-45/+68
| | | | | | | | | | | | | | | | | | | | | | This is useful in many cases where the list of files cannot be known in advance and is just dumped inside a directory. For example when generating documentation with doxygen and other tools that we don't have built-in support for. Includes a test for the same. Closes #893
* | Allow passing arguments to install scriptsNirbheek Chauhan2016-12-181-19/+8
|/ | | | Closes #1213
* Use universal_newlines=True for all Popen callsNirbheek Chauhan2016-12-111-4/+4
| | | | | | | | | | | Instead of adding it everywhere manually, create a wrapper called mesonlib.Popen_safe and use that everywhere that we call an executable and extract its output. This will also allow us to tweak it to do more/different things if needed for some locales and/or systems. Closes #1079
* misc: Use relative imports everywhereNirbheek Chauhan2016-12-071-2/+2
| | | | | | Using 'mesonbuild' as the module can cause it to use the system-installed module and can also break if we rename the directory, so avoid that by always using relative imports.
* Remove shebangs on files that are not runnable and add execute bits to those ↔Jussi Pakkanen2016-10-071-0/+0
| | | | that are.
* Merge branch 'QuLogic-context-managers'Jussi Pakkanen2016-09-011-4/+7
|\
| * Use context manager for file I/O.Elliott Sales de Andrade2016-08-271-4/+7
| | | | | | | | | | There are a few cases where a context manager cannot be used, such as the logger.
* | Refactor DESTDIR determination into a single function.Elliott Sales de Andrade2016-08-271-25/+14
| |
* | Always obey DESTDIR even with absolute install_dir.Elliott Sales de Andrade2016-08-271-3/+12
|/ | | | | | Passing an absolute path to `install_dir` would previously always attempt to install there, instead of obeying DESTDIR, since os.path.join will 'reset' on absolute paths.
* Merge pull request #417 from nirbheek/dll-pathsJussi Pakkanen2016-07-131-1/+1
|\ | | | | Fix filenames and paths used in DLL shared library generation
| * scripts/install: Also strip '\' from the end of a pathNirbheek Chauhan2016-07-011-1/+1
| | | | | | | | Fixes installation of subdirs on Windows
* | Create a log file of all files installed.Jussi Pakkanen2016-07-121-1/+21
|/
* scripts: Use destdir_join fix for all DESTDIR prefixing (#598)Nirbheek Chauhan2016-06-161-12/+2
|
* Try to delete target files before installing. Closes #578.Jussi Pakkanen2016-06-051-8/+14
|
* Handle case of install_subdirring a subdir.Jussi Pakkanen2016-05-301-1/+4
|
* Installing subdirs now merges with existing files in the target dir.Jussi Pakkanen2016-05-301-12/+32
|
* Always initialise final_command.Jussi Pakkanen2016-05-281-2/+1
|
* Since we only care about shebang line and sane ones use plain ASCII, use an ↔Jussi Pakkanen2016-05-281-2/+1
| | | | encoding that can not fail. Closes #561.
* Join windows-style destdir paths correctly. Closes #567.Jussi Pakkanen2016-05-281-4/+11
|
* Merge pull request #479 from mesonbuild/i18nJussi Pakkanen2016-05-251-14/+0
|\ | | | | Moved gettext into i18n module.
| * Remove all special casing for gettext and use elementary operations instead.Jussi Pakkanen2016-05-211-14/+0
| |
* | Use individual tempdirs for building and installing in unit tests.Jussi Pakkanen2016-04-011-1/+1
| |