Commit Graph

26 Commits

Author SHA1 Message Date
Ernestas Kulik a13bde821f wrap: initialize submodules when updating
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-04-25 19:39:56 +03:00
Nirbheek Chauhan fa09b122b0 wrap: Also capture stderr while running quiet_git()
We want to return the stderr if the command failed.
2017-03-27 15:09:18 +05:30
Nirbheek Chauhan d5975cc683 wrap: Implement special wrap modes for use by packagers
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-25 06:57:30 +05:30
Nirbheek Chauhan a60d688973 wrap: Initialize subprojects that are git submodules
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-25 06:47:04 +05:30
Nirbheek Chauhan fb809e79e5 wrap: Check that the package dir contains 'meson'build'
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-03-25 03:47:55 +05:30
Marc Becker 92d18b9256 Fix directory context for git wrap check 2017-02-27 13:04:20 -05:00
Mike Sinkovsky 84902cb93a style: [E301] expected 1 blank line, found 0 2017-01-11 12:33:27 -05:00
Igor Gnatenko ef3cc6b3fa style: fix E127 violations
E127: continuation line over-indented for visual indent

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-01-02 19:16:56 +01:00
Igor Gnatenko 116da33cdd style: fix E128 violations
E128: continuation line under-indented for visual indent

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-01-01 12:02:05 -05:00
Igor Gnatenko 2017d8578a style: fix E226 violations
E226: missing whitespace around arithmetic operator

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
2017-01-01 12:02:05 -05:00
Igor Gnatenko d5ccd20aac fix some of pylint's undefined-variable
************* 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-19 17:09:35 +02:00
Jussi Pakkanen b389f43060 Revert "Merge pull request #1145 from AlexandreFoley/wrap-fix"
This reverts commit 541dd92ef7, reversing
changes made to 155617e539.
2016-12-15 22:33:25 +02:00
Alexandre Foley 27cd8c1e28 The “directory present and not empty” return condition was necessary for 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-06 12:32:39 -05:00
Alexandre Foley 61d5934e63 Added a few missing whitespace as noted by Ignatenkobrain. Replaced a comment by the piece of code it said was needed. 2016-12-06 09:45:20 -05:00
Alexandre Foley 228adaa287 Wrap.py: Made it so using an already downloaded subproject is only for the 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-05 17:25:36 -05:00
Thibault Saunier f1366ba425 wrap: Fix getting push-url 2016-12-01 20:40:24 +01:00
Thibault Saunier 0ebf033f31 wrap: Allow specifying push URL in wrap files using git 2016-11-22 14:24:36 -03:00
Thibault Saunier 28cd23ab6e wrap: Make sure that the cloned git repo is properly cloned 2016-11-22 14:24:36 -03:00
AlexandreFoley 263cb6a5f0 add support of mercurial repo for wrap,… (#937)
* 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-10-20 00:10:00 +03:00
Jussi Pakkanen 3d8876bf59 Download without status updates if server does not report file size. Closes #771. 2016-09-14 19:09:57 +03:00
Elliott Sales de Andrade 181d9a891d Ensure URLs are closed with a context manager. 2016-08-27 18:29:56 -04:00
Elliott Sales de Andrade 4c71695e41 Use context manager for file I/O.
There are a few cases where a context manager cannot be used, such as
the logger.
2016-08-27 18:29:55 -04:00
Jussi Pakkanen 808451b5c7 Do not error out if git pull fails on subprojects. Closes #720. 2016-08-25 22:29:40 +03:00
Jussi Pakkanen eb6548a816 Created an emergency wraptool that downloads directly from Github. 2016-05-05 23:18:05 +03:00
Jussi Pakkanen c87835080d Restore warning state variable that got lost in refactoring. 2016-01-27 21:53:14 +02:00
Jussi Pakkanen 23b98cd6e6 Renamed meson package to mesonbuild so that we can have a script named meson in the same toplevel dir. 2016-01-16 17:35:29 +02:00