aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/wrap
AgeCommit message (Collapse)AuthorFilesLines
2018-06-06wraptool: Convert to argparseXavier Claessens1-62/+39
2018-04-06new wrap-mode: forcefallbackMathieu Duponchelle1-1/+6
This can be useful to make sure that a project builds when its fallbacks are used on systems where external dependencies satisfy the version requirements, or to easily hack on the sources of a dependency for which a fallback exists.
2018-02-20wrap: Fix broken logic when initializing submodulesNirbheek Chauhan1-6/+10
Also be more lenient when doing git checkout, and continue even if it failed. Closes https://github.com/mesonbuild/meson/issues/3088
2018-02-11wrap: Handle more submodule status casesNirbheek Chauhan1-5/+8
The '+' and 'U' cases should not happen normally because we don't run any git commands if the subproject directory exists and contains a meson build file. However, if the user accidentally messed up the subproject checkout to a version that had no build files, we would error out with an assertion.
2018-01-30Use os.path: basename() and dirname() instead of split()Aleksey Filippov1-2/+2
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-06Add promote to list of wrap commands.Jussi Pakkanen1-0/+1
2017-12-17Also promote wrap files.Jussi Pakkanen1-5/+9
2017-12-17Print instructions on how to promote subsubprojects.Jussi Pakkanen1-20/+3
2017-12-17Add functionality to promote nested dependencies to top level.Jussi Pakkanen1-0/+50
2017-10-01Merge pull request #2373 from leiflm/svn-wrapsJussi Pakkanen1-0/+26
introduce svn wrap support
2017-09-30adds missing import of `Popen_safe`Leif Middelschulte1-0/+1
2017-09-30As per jpakkane's suggestion use `Popen_safe` instead of `subprocess.getoutput`Leif Middelschulte1-1/+2
Jussi suggested to use `Popen_safe` from meson's library for portability reasons.
2017-09-29Don't download patch archive if already downloadliugang1-9/+13
the behavior of download patch should keep same as download package.
2017-09-26fixup 993a12c5: use right variableLeif Middelschulte1-1/+1
2017-09-26avoid errornous type conversion. Compare strings insteadLeif Middelschulte1-1/+0
2017-09-26fixes offline working (if desired revision is already present).Leif Middelschulte1-4/+6
2017-09-26fixes initial checkout command independend of provided revisionLeif Middelschulte1-4/+1
2017-09-25introduce svn wrap supportLeif Middelschulte1-0/+26
2017-09-23Improve download packageliugang1-12/+20
Using wrap mechanism in enterprise environment, Some package is very large, example, sdk package from BSP vendor. so: - open file in the output directory with a temporary name - download a chunk, update hash calculation, write chunk to file - when finished close file and check the hash - if hash is incorrect, delete temp file and raise error - if hash is correct, atomically rename temp file to final file fix issue: #2358
2017-09-23Fix unpack patch archive failliugang1-2/+26
fix shutil.unpack_archive() failure when the destination files already exists and is read-only. Example: all files in opensource package live555 is `-r--r--r--`, if some file in patch archive try to patch original files of live555, shutil.unpack_archive will raise `[Errno 13] Permission denied`
2017-09-23fix patch archive never download on some caseliugang1-10/+10
Fix issue #2359
2017-09-21flake8: Clean up complained-about unused importsLuke Shumaker1-1/+1
This also adds a "# noqa: F401" comment on an unused "import lzma", which we are using it in a try/except block that is being used to check if the lzma module is importable; of course it is unused. v2: This turned out to be a little tricky. mesonbuild/modules/__init__.py had the "unused" import: from ..interpreterbase import permittedKwargs, noKwargs However, that meant that the various modules could do things like: from . import noKwargs # "." is "mesonbuild.modules" Which breaks when you remove __init__.py's "unused" import. I could have tagged that import with "# noqa: F401", but instead I chose to have each of the module import directly from "..interpreterbase" instead of ".".
2017-05-29Whitespace tweaks to reduce Flake8 warningsAlistair Thomas1-1/+1
2017-05-26fix typoGoncalo Carvalho1-1/+1
2017-05-17Rearrange trys to avoid possible undefined vars.Elliott Sales de Andrade1-2/+3
2017-05-17Remove unused variables.Elliott Sales de Andrade1-1/+0
2017-05-02Don't use len() to test emptiness vs not emptinessDylan Baker1-2/+2
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-25wrap: pass -C to git when resolving submodulesErnestas Kulik1-5/+6
Using Meson from outside a git repo results in an error when trying to resolve submodule subprojects. Running git from inside subproject root should be enough to fix it. Partially fixes #1679 Signed-off-by: Ernestas Kulik <ernestas.kulik@gmail.com>
2017-04-25wrap: initialize submodules when updatingErnestas Kulik1-1/+1
After an initial checkout, submodules aren’t initialized and thus trying to update them fails. Partially fixes #1679 Signed-off-by: Ernestas Kulik <ernestas.kulik@gmail.com>
2017-03-27wrap: Also capture stderr while running quiet_git()Nirbheek Chauhan1-1/+1
We want to return the stderr if the command failed.
2017-03-25wrap: Implement special wrap modes for use by packagersNirbheek Chauhan2-1/+40
Special wrap modes: nofallback: Don't download wraps for dependency() fallbacks nodownload: Don't download wraps for all subproject() calls Subprojects are used for two purposes: 1. To download and build dependencies by using .wrap files if they are not provided by the system. This is usually expressed via dependency(..., fallback: ...). 2. To download and build 'copylibs' which are meant to be used by copying into your project. This is always done with an explicit subproject() call. --wrap-mode=nofallback will never do (1) --wrap-mode=nodownload will do neither (1) nor (2) If you are building from a release tarball, you should be able to safely use 'nodownload' since upstream is expected to ship all required sources with the tarball. If you are building from a git repository, you will want to use 'nofallback' so that any 'copylib' wraps will be download as subprojects. Note that these options do not affect subprojects that are git submodules since those are only usable in git repositories, and you almost always want to download them.
2017-03-25wrap: Initialize subprojects that are git submodulesNirbheek Chauhan1-7/+43
This will benefit projects such as GNOME Recipes that prefer using submodules over wraps because it's easier to maintain since git is aware of it, and because it integrates with their existing workflow. Without this, these projects have to manually initialize the submodules which is completely unnecessary. Closes https://github.com/mesonbuild/meson/issues/1449
2017-03-25wrap: Check that the package dir contains 'meson'build'Nirbheek Chauhan1-13/+16
Also use a pathlib.Path object for the checks since it does I/O only once and is much more efficient anyway. Path objects are available since Python 3.4, so this is fine.
2017-02-27Fix directory context for git wrap checkMarc Becker1-1/+1
2017-01-18cleanup: Remove redundant parenthesesMike Sinkovsky1-2/+2
2017-01-11style: [E301] expected 1 blank line, found 0Mike Sinkovsky1-0/+1
2017-01-02style: fix E127 violationsIgor Gnatenko1-3/+3
E127: continuation line over-indented for visual indent Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-01-01style: fix E128 violationsIgor Gnatenko1-1/+1
E128: continuation line under-indented for visual indent Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-01-01style: fix E226 violationsIgor Gnatenko1-2/+2
E226: missing whitespace around arithmetic operator Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-19fix some of pylint's undefined-variableIgor Gnatenko1-1/+1
************* Module mesonbuild.modules.rpm E:106,29: Unsupported format character '{' (0x7b) at index 16 (bad-format-character) ************* Module mesonbuild.modules E: 12,14: Undefined variable 'MesonException' (undefined-variable) ************* Module mesonbuild.modules.gnome E:699,69: Undefined variable 'sargs' (undefined-variable) ************* Module mesonbuild.wrap.wrap E:103,25: Undefined variable 'checkoutdir' (undefined-variable) ************* Module mesonbuild.backend.backends E: 83,16: Undefined variable 'mlog' (undefined-variable) ************* Module mesonbuild.backend.ninjabackend E:254,105: Undefined variable 't' (undefined-variable) Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-18remove shebang from wraptoolIgor Gnatenko1-2/+0
meson.noarch: E: non-executable-script /usr/lib/python3.5/site-packages/mesonbuild/wrap/wraptool.py 644 /usr/bin/python3 Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2016-12-15Revert "Merge pull request #1145 from AlexandreFoley/wrap-fix"Jussi Pakkanen1-20/+9
This reverts commit 541dd92ef7a10b0f657f3c8532ffb71a8d921f54, reversing changes made to 155617e539a9aeccda6bd186398123b9d5521ed4.
2016-12-06The “directory present and not empty” return condition was necessary for ↔Alexandre Foley1-1/+6
subproject to work without a wrap file. Put it back with that added condition that there mustn’t be a wrap file present for returning the package immediately.
2016-12-06Added a few missing whitespace as noted by Ignatenkobrain. Replaced a ↔Alexandre Foley1-5/+6
comment by the piece of code it said was needed.
2016-12-05Wrap.py: Made it so using an already downloaded subproject is only for the ↔Alexandre Foley1-10/+15
wrap-file case. Git and Mercurial can update the repository if it the wrap is one. Also did a bit of cleanup. interpreter.py: There’s a catch all except clause at the line 1928, it didn’t give the user any information whatsoever about the exception it caught. Now it at least print it to the log as a warning.
2016-12-01wrap: Fix getting push-urlThibault Saunier1-1/+1
2016-11-22wrap: Allow specifying push URL in wrap files using gitThibault Saunier1-0/+5
2016-11-22wrap: Make sure that the cloned git repo is properly clonedThibault Saunier1-3/+22
2016-10-20add support of mercurial repo for wrap,
 (#937)AlexandreFoley1-1/+25
* add support for wrap of mercurial repo, and a test with a clone of the sample subproject used for the git test into a mercuriel repo. * Added myself to author list, and switched the URL of the sample subproject in the wrap file to one under the control of the project's maintainers.
2016-09-14Download without status updates if server does not report file size. Closes ↔Jussi Pakkanen1-1/+7
#771.