Commit Graph

22 Commits

Author SHA1 Message Date
Nicolas Dechesne 1c8c9f1e53 bitbake: fetch2/svn.py: use log instead of info to retrieve revision
We have faced a corner case situation where the 'last changed
revision' returned from svn info is wrong. It happens when the last
revision is a directory move. e.g. if we assume that the svn
repository at revA has root/x/y/z/foo/bar and it is moved to
root/a/b/c/foo/bar in revB, then svn info 'last change revision' will
return revA. As such when using AUTOREV, we are going to attempt to
retrieve root/a/b/c/foo/bar (as per SRC_URI) but at revA when it did
not exist.

So this patch changes how we retrieve the latest revision and uses
'svn log --limit 1' which gives correct result in all tested cases.

(Bitbake master rev: 17d8ef0b813a05c231e3dbe6e8bc82a4a9b1d2f8)

(Bitbake rev: d14e532f07f31b99c55bec9d87470eb54251c8db)

Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-12-03 17:51:31 +00:00
Richard Purdie d228f9d938 bitbake: fetch2/git: Clean up sortable_revision
Now we no longer try and provide increasing values from the fetcher,
we can simplify the function structure for the sortable_revision
pieces and move the AUTOINC handling directly into the function
which needs it, simplifying the code.

(Bitbake rev: fb068bee47bb1a06f02447daf16c2b2a79c03288)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-22 12:10:12 +01:00
Vanveerdeghem, Simon 67ed18e656 bitbake: fetch2/svn: Do not save authentication
(Bitbake rev: a9b1e7c2ad13ff47acb629bae082d4f96e174f99)

Signed-off-by: Simon Vanveerdeghem <simon.vanveerdeghem@barco.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2013-05-03 16:24:13 +01:00
Martin Jansa d5fb11747a bitbake: fetch2/svn.py: Use protocol parameter to get the protocol
* it was send in v1 of proto -> protocol changes but then wasn't in V2
  http://patchwork.openembedded.org/patch/31617/
  where warning about proto= was moved to shared __init__

(Bitbake rev: b2017f493ab730d804ae44ec5a168d464626d046)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-18 12:43:50 +01:00
Richard Purdie dd5f6ae551 bitbake: fetch2/svn: Enhance to cope with subversion 1.7 upgrade
svn changed working checkout formats between 1.6 and 1.7. Its convoluted to
detect what format a given working copy is in so the simplest solution is simply
to run "svn upgrade" within the working copy.

The base svn command variable is relocated slightly to enable this new code to
work effectively.

(Bitbake rev: ebd3ecdb5f3c6d3fe1fad27cbed4d80f4277e92e)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2012-07-04 14:48:15 +01:00
Richard Purdie c4371138f7 bitbake/fetch2: Fix the problems introduced by the git fetcher AUTOREV fix
The ordering constrains on the urldata_init functions are not straight
forward. To avoid further problems, create a helper function to setup
the source revisions which the init functions can all at the appropriate
point.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-04-20 02:13:26 +01:00
Chris Larson 67fac77e10 Fix more incorrect usages of 'is'
(Bitbake rev: a26a2f548419af0e971ad21ec0a29e5245fe307f)

Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-31 12:23:23 +01:00
Khem Raj 54e10127c4 fetch, fetch2: Get rid of DeprecationWarning notice
* This patch fixes a cosmetic issue currently we get with master

WARNING: /home/kraj/work/bitbake/lib/bb/fetch2/__init__.py:733:
DeprecationWarning: Call to deprecated function bb.mkdirhier: Please use bb.utils.mkdirhier instead.  bb.mkdirhier("%s/%s" % (rootdir, destdir))

(Bitbake rev: 36fe59ce314c295d239b76de34c8714def2c32d5)

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-03-03 22:51:33 +00:00
Richard Purdie 029f19bd3d bitbake/fetch2: Add explict network access exception and handling to give users usable error messages
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-11 22:08:21 +00:00
Saul Wold 14dea89521 fetch2: Correct the clean() mechanism for the fetcher2 code
This create a clean() method in each of the fetcher modules
and correctly cleans the .done stamp file and lock files

Signed-off-by: Saul Wold <sgw@linux.intel.com>
2011-02-10 23:49:25 +00:00
Richard Purdie ee6f34483a bitbake/fetch2/svn: The concept of using dates with svn is totally insane, drop support
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:37 +00:00
Richard Purdie ab0dd13974 bitbake/fetch2: Rename Fetch class to FetchMethod
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:36 +00:00
Richard Purdie d08397ba4d bitbake/fetch2: Rewrite and improve exception handling, reusing core functions for common operations where possible
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:36 +00:00
Richard Purdie 5a52cb80d6 bitbake/fetch2: Define a sane localpath function and remove code duplication
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:35 +00:00
Richard Purdie 972eb5faba bitbake/fetch2: Move ud.localfile setup into urldata_init
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-07 09:06:35 +00:00
Yu Ke 0e837e6844 fetch2: Allow multiple src rev to be used in one src_uri
* SRC_URI format:
the SRC_URI are extended to allow multiple src rev:
name=<name1>,<name2>,...<name-n>
branch=<branch1>,<branch2>,...,<branch-n>
also SRCREV can be defined with
SRCREV_<name1> = xxxxx
SRCREV_<name2> = xxxxx

* FetchData extention
to support multiple src rev, several FetchData data are added:
- FetchData.names: list of name in SRC_URI,  one name per srcrev. name is the index of revision and branch
- FetchData.revisions: dictionary of name->revision.
- FetchData.branches: dictionary of name->branch.

For example, linux-yocto recipes becomes:
SRC_URI = "git://git.pokylinux.org/linux-yocto-2.6.37;protocol=git;branch=${KBRANCH},meta;name=machine,meta"

FetchData.names = ['machine', 'meta']
FetchData.revisions = { 'machine':xxxxx, 'meta':xxxxxx }
FetchData.branches = { 'machine':${KBRANCH}, 'meta':'meta'}

* generic revision handling extension
the related revision handling code in fetch2.__init__.py are changed accordingly. the major change is add name parameter to indicate which src rev to handling. originally there is one src rev per FetchData, so FetchData parameter is enough. now since one FetchData has multiple src rev, it is necessary to use FetchData + name to specifiy src rev.

* git extension
git fetcher are also revised to take advantage of the multiple src rev in FetchData. especially the download() method are enhanced to fetch multiple src rev.

* other fetcher (svn, hg, ...) does not support multiple src rev. they just sync the API to add name, and then simply ignore the name. no actually functional change

Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-02-02 17:19:18 +00:00
Yu Ke 029f8584d5 bitbake/fetch2: Instrument fetchers when making network access
Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-01-25 12:32:50 +00:00
Yu Ke e05918937c bb.fetch2: rename "go" with "download" to better reflect its functionality
no functional change

Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-01-25 12:25:47 +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
Yu Ke 7420e70f4f bb.fetch2.svn.py: add urldata_init
move the svn specific urldata init from localpath to urldata_init
so that it can be called early

Signed-off-by: Yu Ke <ke.yu@intel.com>
2011-01-10 20:21:48 +00:00
Yu Ke c64b445f38 bb.fetch2: replace bb.fetch with bb.fetch2 in the bb.fetch
bb.fetch2 is copied from bb.fetch, and has many bb.fetch referrence.
Fix these referrence with bb.fetch2 referrence

Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 18:05:07 +00:00
Yu Ke 4dccd92439 bitbake: copy bb.fetch to bb.fetch2 as initial code base for fetcher overhaul
Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10 14:23:36 +00:00