summaryrefslogtreecommitdiffstats
path: root/lib/bb/fetch2/__init__.py
AgeCommit message (Collapse)Author
2011-02-10bitbake/fetch2: Ensure that mirror fetches are symlinked from the download ↵Richard Purdie
directory When files are fetched from a mirror source that happens to be local, ensure links are created for the file since subsequent fetch calls can then follow the links to find files. Any other approach such as the existing manipulations of localpath internally to the fetcher are prone to errors, races and other issues. (From Poky rev: fa9fda05e1d269446b51050195b891346482e8bb) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10bitbake/fetch2: When encoding a file:// url, drop user and host informationRichard Purdie
When processing a cvs SRC_URI to a file:// mirror, the user and host information will break the mirror processing. This patch addresses it by only constructing valid urls. (From Poky rev: 7f99605562119a13a2510a3c990e3cf577ad764e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10bitbake/lib/bb/fetch2: Assign a default name in the names array as empty ↵Richard Purdie
strings as names cause problems for python (From Poky rev: a55d86b4051f6d063f9a67db026f7da6f9b50cc6) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10bitbake/fetch2: Add missing parameter to localcount_internal_helperRichard Purdie
(From Poky rev: 08cd6c1cb9639e958e0c60a02e317a22cf43f880) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10fetch2: Allow multiple src rev to be used in one src_uriYu Ke
* 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 (From Poky rev: 0e837e6844be449659bb96a1498e54a8b9442d13) Signed-off-by: Yu Ke <ke.yu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10bitbake/fetch2: Ensure the local revision counter takes a default value of ↵Richard Purdie
0, not None (From Poky rev: 05954ef4d7d882f34e2bb1f3bc44ad6f80c11d4c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10bb.fetch2: add "BB_NO_NETWORK" optionYu Ke
Sometime user want a purely local fetching, i.e. using local mirror without any remote netowrk access. BB_NO_NETWORK option is introduced for this purpose check_network_access() is the guard for BB_NO_NETWOKR option. it should be put in any place that fetcher use network access (From Poky rev: 098e8ded339f3bf864f3bad9871028176f70b12b) Signed-off-by: Yu Ke <ke.yu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10git.py: split download to download() and build_mirror_data()Yu Ke
the download is to fetch the source from URL, the build_mirror_data is to create the mirror tar ball. the original go() method mix them together, it is more clean to split them. (From Poky rev: ef918a72de97fd2189e1c8487e371d13e18088fd) Signed-off-by: Yu Ke <ke.yu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10bb.fetch2: rename "go" with "download" to better reflect its functionalityYu Ke
no functional change (From Poky rev: e05918937c515dff845fcb4c9e94f8ecbea8c957) Signed-off-by: Yu Ke <ke.yu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10bb.fetch: add fetch version to distinguish bb.fetch and bb.fetch2Yu Ke
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 (From Poky rev: f12e71484593039cd58b6e7fadd038b28b05d849) Signed-off-by: Yu Ke <ke.yu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10bb.fetch2: revise the Fetch.unpack APIYu Ke
change the unpack to use the urldata and rootdir parameter - urldata is the FetchData instance - rootdir is the dir to put the extracted source. the original unpack use current dir (os.getcwd) as destination dir, which is not flexible and error-prone (error will occur if caller not chdir to dest dir) (From Poky rev: 84ff79413a3b56f287f42b8ca1dd2ab194337c42) Signed-off-by: Yu Ke <ke.yu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10bb.fetch2: add unpack method in fetcherYu Ke
copy exactly the base.bbclass:oe_unpack_file() to bb.fetch2 as the code base (From Poky rev: d8698b92ffcc2cbd29b57d3dc8e851d3d6c137f2) Signed-off-by: Yu Ke <ke.yu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10Fetcher: only set __BB_DONT_CACHE when SRCREV = "${AUTOREV}"Yu Ke
we should cache SRCREV whenever possible, the only exception is when SREREV is auto rev. so change the logic to only set __BB_DONT_CACHE at SRCREV = "${AUTOREV}" case (From Poky rev: 2b2dbf76126650750cb8a6778b837af6fe4c8b21) Signed-off-by: Yu Ke <ke.yu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10Fetcher: break the "SRCREVINACTION" deadlockYu Ke
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. (From Poky rev: 1589a1172f9432aed1cc9ce006f68cddf3073774) Signed-off-by: Yu Ke <ke.yu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-02-10bb.fetch2: add urldata_init call for Fetch classYu Ke
FetchData has some fetch method specific data, and only fetch method knows how to initialize it. originally it is mostly initialized in Fetch.localpath(). But now there is requirement to call Fetch.latest_revision() before Fetch.localpath(), thus require another earlier place for initialization. so urldata_init is introduced for this purpose. it will be called in FetchData:__init__ and make all the Fetch functions useable after that. (From Poky rev: 2892cbfb114de1d2e2b5b479d5f928646ce5c831) Signed-off-by: Yu Ke <ke.yu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-11*: use utils.remove() some moreBernhard Reutner-Fischer
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2011-01-10bb.fetch2: replace bb.fetch with bb.fetch2 in the bb.fetchYu Ke
bb.fetch2 is copied from bb.fetch, and has many bb.fetch referrence. Fix these referrence with bb.fetch2 referrence (From Poky rev: c64b445f38179a117d39319f762f9dc2435da0ea) Signed-off-by: Yu Ke <ke.yu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2011-01-10bitbake: copy bb.fetch to bb.fetch2 as initial code base for fetcher overhaulYu Ke
Signed-off-by: Yu Ke <ke.yu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>