Commit Graph

127 Commits

Author SHA1 Message Date
Bernhard Reutner-Fischer 0e3fc6dff2 *: cosmetic whitespace removal
(Bitbake rev: 2ed36a3d57de25e1af31d657a7b0b14857e5056a)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-03 14:06:40 +01:00
Richard Purdie 36cfff8ed5 bitbake: fetch: Only mark srcrev recipes as uncached when outside of SRCREV caching mode
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-25 11:32:42 +01:00
Chris Larson ecbd5ca720 3.0 prep
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:37 +01:00
Chris Larson ef1de9ecaf Apply some 2to3 refactorings
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:37 +01:00
Chris Larson 0c5b5b21f7 Start ditching fatal() calls in favor of raising appropriate exceptions
(Bitbake rev: 681b73fcc04e22e692ed61650ad53c800b64cace)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:36 +01:00
Ryan Phillips 40d7de8f06 Change wget fetcher to use the runfetchcmd
* Fixes proxy support to honor standard proxy environment variables.
* Quote environment variables

(Bitbake rev: f84f382f340d6db15b9e5afb8c7c93969249a958)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:36 +01:00
Bernhard Reutner-Fischer 726802b980 persist_data: cache connection and use cursor
Store database connection to persistent database in fetcher.

(Bitbake rev: 8a6876752b90efd81d92f0947bfc9527d8260969)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:35 +01:00
Bernhard Reutner-Fischer 85ca18f60a fetch: commentary typo fix in fetcher_init()
(Bitbake rev: b786f1f60fb50565295e7c8e979b471327d924f3)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:35 +01:00
Bernhard Reutner-Fischer a7ad7cfb2f fetch: documentation typo fix
s/initilize/initialize/

(Bitbake rev: 1497dd0d5bc0cca0de7d0ee9d314287000a0c34d)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:34 +01:00
Khem Raj f7e6c5ad2b fetch: Check for existence of tar file along with md5 signature
(Bitbake rev: a5b1c0605328660de15bb8127b6f7d798c664d32)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:34 +01:00
Chris Larson 22a2179905 Kill unnecessary usages of the types module
types.IntType -> int
types.StringType -> basestring
...

Also moves our ImmutableTypes tuple into our own namespace.

(Bitbake rev: 83674a3a5564ecb1f9d2c9b2d5b1eeb3c31272ab)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:33 +01:00
Chris Larson 1180bab54e Apply some 2to3 transforms that don't cause issues in 2.6
(Bitbake rev: d39ab776e7ceaefc8361150151cf0892dcb70d9c)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:33 +01:00
Chris Larson bcd9c57a96 Switch some references to moved functions
(Bitbake rev: ddea2978cb969cf1381cfee5c055de0c9e56a4e3)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:33 +01:00
Chris Larson c770c62fdc Add a missing import of print_function
(Bitbake rev: 30ae747cc5c733512e417c61fca23c0cd15b0e44)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:33 +01:00
Chris Larson ad543e2e41 Apply the 2to3 print function transform
(Bitbake rev: ff2e28d0d9723ccd0e9dd635447b6d889cc9f597)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:33 +01:00
Chris Larson 1c74fd768f Import fixups
(Bitbake rev: 4fa052f426e3205ebace713eaa22deddc0420e8a)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:32 +01:00
Chris Larson 7acc132cac Formatting cleanups
(Bitbake rev: 2caf134b43a44dad30af4fbe33033b3c58deee57)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:32 +01:00
Chris Larson 6623d79ada Stop using functions via 'bb' that were moved from there to other modules
(Bitbake rev: 03a6c26f8da226f442c3cab557e4733f7cd6eeac)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:32 +01:00
Chris Larson 87f62d7c8d Ensure we always utilize the correct messaging domains
(Bitbake rev: 92a2e2e90981c0615171abe03645a772d84f6986)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:31 +01:00
Chris Larson a21841fb75 Drop doctest, as we aren't utilizing it
We should add back in some proper unit testing.  Doctest is rather limited,
and we haven't actually made use of it since the original implementation of
the datastore when the project started, as far as I'm aware.

(Bitbake rev: 3a11c2807972bbbddffde2fa67fc380d159da467)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-07-02 15:41:31 +01:00
Nitin A Kamble c3682bf89b bitbake decodeurl: fix the file:// url handling
Without this patch decoding a url of this kind file://dir/filename gives
path=/filename host=dir.
With the patch it decodes as path=/dir/filename host=""

Probably nobody stumbled on this issue yet because nobody used
file:// urls with directory names in the path.

Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com>
2010-06-07 16:05:00 +01:00
Chris Larson 6028daedcb Fix 7 references to undefined variables, as spotted by pyflakes
(Bitbake rev: e1e4ccf203e38070eeafd31a622671996cff61a1)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 17:25:56 +00:00
Enrico Scholz 5060280a7a Expand PREMIRRORS
When not expanding PREMIRRORS, the functions fails/does not work correctly
when PREMIRRORS is not a plain string (e.g. contains ${...} or a ${@...}
statements).

(Bitbake rev: d612d22b073f68b8cf1bb7344e0487820040d80d)

Signed-off-by: Enrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Signed-off-by: Chris Larson <clarson@kergoth.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-25 17:17:12 +00:00
Chris Larson ada2a8494a Avoid unnecessary calls to keys() when iterating over dictionaries.
dict objects provide an __iter__ method for the iteration which gives you the
keys, so calling keys directly is unnecessary, and isn't really a best
practice.  The only time you really need to call the keys is if there's a
danger of the dict changing out from underneith you, either due to external
forces or due to modification of the iterable in the loop.  Iterations over
os.environ are apparently subject to such changes, so they must continue to
use keys().

As an aside, also switches a couple spots to using sorted() rather than
creating a temporary list with keys() and sorting that.

(Bitbake rev: 5b6ccb16c6e71e23dac6920cd2df994d67c2587b)

Signed-off-by: Chris Larson <clarson@mvista.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 15:01:59 +00:00
Chris Larson a7d5f73134 Fix ud.basecmd error introduced by the FETCHCMD_git commit
(Bitbake rev: 0bbcbe3548f39ca46c5aa3bf1a8681026e51cbf0)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 14:58:41 +00:00
Tom Rini dea828c744 Add initial 'repo' fetcher
(Bitbake rev: f68406e864c9837feb56cbec993b620481445cc2)

Signed-off-by: Tom Rini <tom_rini@mentor.com>
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 14:58:15 +00:00
Chris Larson ac392b66a5 Move encodeurl, decodeurl into bb.fetch.
(Bitbake rev: 867d36f9afce2d298874ac7563e5b3852ef04659)

Signed-off-by: Chris Larson <clarson@kergoth.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 14:54:10 +00:00
Chris Larson a3012e1ca9 Move MalformedUrl, VarExpandError into appropriate modules.
(Bitbake rev: e616483b237dafff7f90ba1c09e9ee7c383a2e47)

Signed-off-by: Chris Larson <clarson@kergoth.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 14:53:55 +00:00
Martyn Welch 9a0da388ce Add FETCHCMD parameter for git
The Git fetcher currently hardwires the git command to "git". Allow the
path and any additional wrappers to the Git command to be provided via
FETCHCMD functionality, as with some of the other fetchers.

If FETCHCMD_git is not define in bitbake.conf, the fetcher defaults to "git".

(Bitbake rev: f3afb79ecac30d973a3c62ff6baf28d8b7388a24)

Signed-off-by: Malcolm Crossley <malcolm.crossley@ge.com>
Signed-off-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-22 14:53:26 +00:00
Richard Purdie 382a630e78 bitbake fetch/__init__.py: Failing urls should raise errors, not fatal exceptions
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-03-15 12:55:47 +00:00
Joshua Lock 52cbb07423 bitbake: fix invalid method and logic
The previous bitbake change included an invalid method call and inverted logic.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-05 12:41:08 +00:00
Joshua Lock ec92133d6f bitbake: Test premirrors and mirrors in checkstatus()
checkstatus() is used to ensure we can fetch a copy of each file, so it makes
sense to also test PREMIRRORS and MIRRORS in the method.

This patch adds calls to try_mirrors() to the Fetch.checkstatus() method and
changes the try_mirrors() method to take a check argument, which is False by
default. When check is True try_mirrors() will call a fetchers checkstatus()
with the replaced uri.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-05 12:19:05 +00:00
Joshua Lock c9fd126f64 bitbake: Fix try_mirrors() logic, was only trying the first mirror.
The logic in try_mirrors() was buggy such that only the first entry in the
mirrors list was tried.

This patch fixes this. Thanks to Richard for the review.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-04 14:08:34 +00:00
Joshua Lock afe12428a9 bitbake: if PREMIRRORS set test for local file in FetchData.setup_localpath
When we are using PREMIRRORS it's possible a mirror in the local namespace
(some filesystem path, i.e. an NFS share) provides read-only files.
This is a perfectly valid scenario so this patch fixes bitbake so that for
such a scenario locapath is set to the files path rather than some child
of DL_DIR.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-04 00:18:29 +00:00
Joshua Lock b571168ac7 bitbake: Enhance the fetchers' support for local mirrors
Modify the try_mirrors() function to return the localpath of the fetched file
and update the data dictionary to reflect this.
Secondly the metadata files, lock and md5, should always be stored relative to
the ${DL_DIR} as it is possible that the localpath is a read-only directory,
for example in the scenario where there is a read-only file:// mirror.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-04 00:18:29 +00:00
Joshua Lock 0737552c1d bitbake: unify mirror support and make it independant of the fetcher
This patch serves two purposes. Firstly it unifies the concept of mirrors into
PREMIRRORS and MIRRORS. PREMIRRORS are tried before the SRC_URI defined in the
recipe whereas MIRRORS are tried only if that fails.
The tarball stash was conceptually inline with a PREMIRROR only with special
handling within the wget fetcher and therefore only worked with certain
fetch types.
Secondly the patch removes the need for individual fetch implementations to
worry about mirror handling.

With this patch, the base fetch implementation will first try to use a
PREMIRROR to fetch the desired object, if this fails the native fetch method
for the object will be tried and if this fails will try to fetch a copy from
one of the MIRRORS.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-02-04 00:18:29 +00:00
Martin Jansa c69797d89c bitbake/git: remove repodir usage (from bitbake master)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-21 10:30:37 +00:00
Richard Purdie 22c29d8651 bitbake: Switch to bitbake-dev version (bitbake master upstream)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-01-20 18:46:02 +00:00
Richard Purdie 1183aff5e9 bitbake/git.py: Typo fix
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-11 17:20:06 +00:00
Richard Purdie b80f6d8ac4 bitbake/git.py: Add support for fullclone parameter
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-11 17:12:53 +00:00
Richard Purdie a94737f611 bitbake/git.py: Move variable init into the localpath function
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-11 17:12:53 +00:00
Richard Purdie c02e38901b git.py: Improve command failure error messages
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-12-11 12:48:14 +00:00
Richard Purdie 011557c157 bitbake: Fix dict changing size problems
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-26 22:45:52 +00:00
Richard Purdie b5a059ff28 fetch/__init__.py: Try and make the sortable_revision code mode readable
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:23 +00:00
Richard Purdie 483f85802a bitbake: Sync various functions with those from bitbake-dev and bitbake upstream
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:21 +00:00
Richard Purdie c2b5a61728 bitbake: Sync module import cleanups back from bitbake trunk
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-11-13 12:15:21 +00:00
Richard Purdie f310816acb bitbake: hg fetcher - sync bitbake-dev and remove debug
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-10-20 11:29:07 +01:00
Richard Purdie 717d71b8e9 bitbake: Add hg fetcher auto revisioning, patch from Carl Simonson <simonsonc@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-10-19 17:46:09 +01:00
Richard Purdie ac4d25c89a bitbake: Fix svk fetcher
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-10-17 21:07:40 +01:00
Richard Purdie 8138603680 bitbake/fetch: Ensure SRCREVINACTION always resets the core flags even when parsing failes by using a try/finally
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2009-09-24 18:57:08 +01:00