Commit Graph

119 Commits

Author SHA1 Message Date
Richard Purdie 4cd9671078 bitbake: Update users of getVar/setVar to use the data store functions directly
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-11-27 10:35:30 +00:00
Richard Purdie 0cc52efc8c bitbake: Sync fetch back with upstream
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-06 18:18:59 +01:00
Chris Larson 7fc020aa15 persist_data: raise KeyError on missing elements
(Bitbake rev: a4f62433845c29f98c6a9746d5d2847bf9506ea5)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-06 15:49:17 +01:00
Chris Larson 88dbb0523c Initial work on getting bitbake working under pypy
- use os.chmod, not os.fchmod, as the latter is missing under pypy
- rearrange our imports a bit
- don't die if sqlite3 is missing shared cache support

(Bitbake rev: f229824dc9c453adf6067500e2bf6761536e4f2f)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-05-06 15:42:03 +01:00
Javier Martin f1bbea4ab0 Export KRB5CCNAME variable
This allows fetching git repositories using Kerberos authentication.

(Bitbake rev: d761cf98284b02eb3d3a1f879782c501c284b698)

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10 22:35:44 +00:00
Javier Martin aacbe3f35e Fix comparison with SRCREVINACTION constant
Use '==' instead of 'is', otherwise it will always return
true since 'rev' and "SRCREVINACTION" are not the same object.

(Bitbake rev: f30b3af975a071d1584817054a2996f08a3aba4f)

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10 22:35:28 +00:00
Yu Ke f12e714845 bb.fetch: add fetch version to distinguish bb.fetch and bb.fetch2
there is case that we need to distingush bb.fetch and bb.fetch2,
and use different API for bb.fetch and bb.fetch2. so it is necessary
to add version info for distinguish purpose

Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-01-25 12:25:46 +00:00
Bernhard Reutner-Fischer 2ef204dcdd *: use utils.remove() some more
(Bitbake rev: d3489b141cac1197324661680fe38b8a88bc49b4)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-12 13:47:14 +00:00
Yu Ke 1589a1172f Fetcher: break the "SRCREVINACTION" deadlock
Current fetcher has annoying "SRCREVINACTION" deadlock,
which occurs when SRCREV=${AUTOREV}=@bb.fetch.get_srcrev():
get_srcrev()->setup_localpath()->srcrev_internal_helper()
->evaluate SRCREV->get_srcrev()

current fetcher resolve the deadlock by introducing a
"SRCREVINACTION" condition check. Althoguh it works, it is
indeed not clean.

This patch use antoehr idea to break the deadlock: break
the dependency among SRCREV and get_srcrev(), i.e. assign
a specific keyword "AUTOINC" to AUTOREV. when Fetcher meet
this keyword, it will check and set the latest revision to
urldata.revision. get_srcrev later can use the urldata.revision
for value evaluation(SRCPV etc). In this case, SRCREV no longer
depends on get_srcrev, and there is not deadlock anymore.

Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-01-10 20:24:33 +00:00
Richard Purdie 5cc720aac2 bitbake/fetch: Sync up logger/whitespace improvements
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 13:24:04 +00:00
Chris Larson e9f4ed0173 Update persist_data usage to the new API
(Bitbake rev: 9723a1c474b72b096c5a3136bf446ed69f3a749e)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-05 00:58:24 +00:00
Chris Larson 3069c0b258 Revert "persist_data: cache connection and use cursor"
Caching the database connection can cause serious issues if it results in
multiple processes (e.g. multiple tasks) simultaneously using the same
connection.

This reverts commit 8a6876752b90efd81d92f0947bfc9527d8260969.

(Bitbake rev: 60b9b18eafad5ac46c7cf1048d749d673c2ee0ad)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-05 00:58:23 +00:00
Chris Larson 098f63d672 Rename command events, adjust compareRevisions
- Moved the logic for comparing revisions from cooker into command
- Removed 'Cooker' from the event names
- Renamed the 'ExitCode' event into CommandExit, and changed CommandFailed to
  be a subclass of CommandExit

(Bitbake rev: c51ed5d7a9971fad6019dac6c35a71b8a54ab16a)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:49 +00:00
Bernhard Reutner-Fischer 4df0d6adca fetch: be more pythonic
no functional changes

(Bitbake rev: e88834fb7c6821cc29c12d296f2edd51f6eb3746)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:41 +00:00
Bernhard Reutner-Fischer b7d667f252 fetch: use os.path.join
(Bitbake rev: c360b01df18d90a513a3d61d395f905102e7568e)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:41 +00:00
Bernhard Reutner-Fischer 87b6f7d27a fetch: add common helper _strip_leading_slashes()
Several fetcher need a way to strip leading slashes off a local path.
This helper-function consolidates all such occurances.

(Bitbake rev: 823a02185ed109054c6c1ae366221aaed0353f24)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:41 +00:00
Bernhard Reutner-Fischer d0d67a9fe2 fetch: rename suppports_srcrev to supports_srcrev
osc had it already spelled correctly?!

(Bitbake rev: b8bb4433de7a981c6826173e926ca34705c4ac70)

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:41 +00:00
Chris Larson ecc68fa4fb Switch bitbake internals to use logging directly rather than bb.msg
We use a custom Logger subclass for our loggers

This logger provides:
- 'debug' method which accepts a debug level
- 'plain' method which bypasses log formatting
- 'verbose' method which is more detail than info, but less than debug

(Bitbake rev: 3b2c1fe5ca56daebb24073a9dd45723d3efd2a8d)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2011-01-04 14:46:33 +00:00
Richard Purdie 3bda5b1301 bitbake/fetch: Fix fetch error
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-21 15:15:42 +00:00
Richard Purdie 2d1007b33f bitbake/fetch: Only checksum downloads when they're first downloaded and a checksum is present
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-21 00:52:10 +00:00
Richard Purdie d4ba59c87e bitbake/fetch: Add missing return so if a checksum isn't present, it isn't checked
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-20 17:38:03 +00:00
Richard Purdie 7abdf3e5c3 bitbake/fetch: Checksum validity fixes
If the checksum check failed, the .md5 stamp file would still have been created
meaning subsequent builds would proceed with the corrupt file. Reorder the calls
to avoid this. Also raise a specific error for the checksum not specified error
case.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-12-20 16:04:51 +00:00
Yu Ke b8d69d6f6e FetchData: add SRC_URI checksum
This patch add the per-recipe SRC_URI checksum verification.

- SRC_URI format
The format of SRC_URI checksum follow OE definition:

1. SRC_URI has single src
SRC_URI = "http://some.domain/file.tar.gz"
SRC_URI[md5sum] = "xxxxxxxxxxxxxxx"
SRC_URI[sha256sum] = "xxxxxxxxxxxxxxxxxxxxxx"

2. SRC_URI has multiple src, every src need specify name
SRC_URI = "http://some.domain/file1.tar.gz;name=name1 \
           http://some.domain/file2.tar.gz;name=name2 "
SRC_URI[name1.md5sum] = "xxxxxxxxxxxxxxx"
SRC_URI[name1.sha256sum] = "xxxxxxxxxxxxxxxxxxxxxx"
SRC_URI[name2.md5sum] = "xxxxxxxxxxxxxxx"
SRC_URI[name2.sha256sum] = "xxxxxxxxxxxxxxxxxxxxxx"

- SRC_URI checking invocation:
the checksum checking is invoked in do_fetch phase,
so it can be invoked manually by

# bitbake -f -c fetch <recipe_name>

if recipes has no SRC_URI checksum item, bitbake will show warning:
"
WARNING: Missing SRC_URI checksum for xxxx.tar.gz, consider to add
SRC_URI[md5sum] = "5c69f16d452b0bb3d44bc3c10556c072"
SRC_URI[sha256sum] = "f4e0ada8d4d516bbb8600a3ee7d9046c9c79e38cd781df9ffc46d8f16acd1768"
"
thus recipe author can add it to recpie file after SRC_URI

- control variable BB_STRICT_CHECKSUM
when SRC_URI checksum is missing, this variable decide pass or not
if BB_STRICT_CHECKSUM = "1", bitbake should fatal in this case, otherwise bitbake just pass

Signed-off-by: Yu Ke <ke.yu@intel.com>
2010-12-20 15:24:52 +00:00
Richard Purdie 89929e1f28 bitbake/fetch: Allow checking of a single url at a time (massive sstate speed improvement)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-11-13 20:10:53 +08:00
Richard Purdie caa7fe2284 bitbake/fetch: Fix handling of mirrors when checking for url validity
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-11-13 20:10:04 +08:00
Richard Purdie c5fab99a6f bitbake/fetch: When fetchers return errors, ensure any partial download is cleared
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-10-23 00:22:54 +01:00
Richard Purdie 535a77a9b6 bitbake/fetch: Make URL checking slightly less verbose (distracting with the sstate code)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-10-22 14:48:54 +01:00
Richard Purdie 05c8ee60f1 bitbake/fetcher: Deal with a ton of different bugs
The more we try and patch up the fetcher code, the more things break. The
code blocks in question are practically unreadable and are full of corner
cases where fetching could fail. In summary the issues noticed included:

a) Always fetching strange broken urls from the premirror for "noclone"
   git repositories
b) Not creating or rewriting .md5 stamp files inconsistently
c) Always fetching git source mirror tarballs from the premirror even
   if they already exist but the checkout directory does now
d) Passing "None" values to os.access() and os.path.extsts() checks under
   certain circumstances
e) Not using fetched git mirror tarballs if the preexist and always
   try and fetch them.

This patch rewrites the sections of code in question to be simpler and
more readable, fixing the above problems and most likely other odd
corner cases.

Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-10-19 12:47:45 +01:00
Richard Purdie 115514b5eb bitbake/fetch: Ensure SRCREV is still set correctly if the pn-X override has been expanded
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-10-09 17:24:16 +01:00
Richard Purdie 24ad63979f bitbake/fetch/__init__.py: Abstract mirror variable handling and enhance to accept \n delimitation in variables
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-10-07 15:42:15 +01:00
Darren Hart 0a20caf090 Export ALL_PROXY for bitbake commands
We already export http,ftp,https proxy environment variables. Some environments,
GNOME for instance, place the socks proxy in ALL_PROXY and all_proxy. Export it
as well.

Signed-off-by: Darren Hart <dvhart@linux.intel.com>
2010-10-07 10:18:25 +01:00
Joshua Lock 0ee7a9e6bd bitbake/fetch: if mirror fetching fails, ensure exception is raised
We catch any exception raised by the fetchers go() method and attempt to work
around it by trying any (post) mirrors which are configured. However, should
the mirrors fail the exception is lost and the fetch is assumed to have
completed successfully.

Instead, save the exception and if the local file does not exist after trying
the mirrors re-raise the exception.

Fixes [BUGID #362]

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-10-05 16:54:10 +01:00
Joshua Lock 15ceaaaaf7 bitbake/fetch: fix logic to prevent fetches when the file already exists
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-09-28 14:07:08 +01:00
Joshua Lock c01e8760ba bitbake/fetch: ensure the go() method completes when not using premirrors
Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-09-10 18:36:35 +01:00
Zhai Edwin 566de26cf5 bitbake: Add proxy variables to standard export list
With "no_proxy" exported to bitbake, both internal and externel file mirror can
be used. "https_proxy" enable fetching "https://" file through proxy.

Signed-off-by: Zhai Edwin <edwin.zhai@intel.com>
2010-09-10 11:47:38 +01:00
Richard Purdie f7b1c1056e bitbake/__init__.py: Fix named SRCREVS variable name ordering with backwards compatibility
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-09-09 15:09:50 +01:00
Joshua Lock 3341e47b52 bitbake/fetch: fix by moving try_premirror() to the right place
The previous commit didn't define the method as part of the Fetch object

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-09-08 15:09:07 +01:00
Joshua Lock 7117a4458b bitbake/fetch: add try_premirror method and special case git fetcher
Add a new method, try_premirror, to the Fetch object which checks to see
whether the file needs to be fetched from a premirror.
Override this in the Git fetcher to only require a pre-mirror fetch when the
clone directory does not exist.

Fixes [BUGID 290]

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-09-08 14:25:24 +01:00
Joshua Lock b78d5368cc fetch: fix setting of localpath in SRC_URI parameters
When setting localpath in the SRC_URI parameters the basename should be set
explicitly as the localpath() method is not called.

Fixes [BUGID #81]

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-09-06 14:32:31 +01:00
Joshua Lock 232ef8430e bitbake/fetch: ensure the mirrored repository is updated as required
If we fetch a tarball from a mirror it's entirely possible that the
mirror will have been from before the required tag/branch/etc was included
in the repository. To that end use forcefetch() as a way of testing whether
the repository is up to date and if not fetch updates.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-09-01 11:14:57 +01:00
Joshua Lock b54e95fd06 bitbake/fetch: Respect forcefetch even when pulling from a mirror
When pulling from a premirror we would prefer a local tarball even when the
caller had specified the forcefetch parameter.
Add an extra parameter 'force' to try_mirrors, defaulting to False. If set
the mirrors will be tested even if the file exists locally.

Signed-off-by: Joshua Lock <josh@linux.intel.com>
2010-09-01 11:14:23 +01:00
Richard Purdie a18e9b4f93 bitbake/git.py: Allow tracking of branches in SRC_URI without cloning for use with fullclone
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
2010-08-13 11:35:11 +01:00
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