summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/hg.py
Commit message (Collapse)AuthorAgeFilesLines
* bitbake: fetch2: unify the way fetchers determine DL_DIR and FETCHCMDAndre McCurdy2018-06-151-1/+1
| | | | | | | | | | | | | | | Currently there is quite some variation between the fetchers in terms of how they determine the subdirectory within DL_DIR and the base fetch command to run. Some rely on variables being set externally (e.g. from bitbake.conf in oe-core), some respect these external variables but provide fallback defaults and some use only hardcoded internal values. Try to unify the approach used across the various fetchers. (Bitbake rev: efd5e35af4b08501c67e8b30f30d9457f6fdf610) Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch: support multiple mirror tarball filenamesChristopher Larson2017-06-021-2/+3
| | | | | | | | | | | | Remove ud.mirrortarball in favor of ud.mirrortarballs. Each tarball will be attempted, in order, and the first available will be used. This is needed for git shallow mirror tarball support, as we want to be able to use either a shallow or full mirror tarball. (Bitbake rev: 02eebee6709e57b523862257f75929e64f16d6b0) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: don't use deprecated bb.data APIsAndre McCurdy2017-03-011-1/+0
| | | | | | | | | Cleanup some more usage of bb.data APIs in the fetchers. (Bitbake rev: 9752fd1c10b8fcc819822fa6eabc2c1050fcc03b) Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: Rename "setup_revisons" to "setup_revisions"Robert P. J. Day2017-02-191-1/+1
| | | | | | | | | | For spelling's sake, rename Python routine "setup_revisons" to "setup_revisions." (Bitbake rev: 4df59b027c02ef39d72476251ccd3fd62fc20bf6) Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: obey BB_ALLOWED_NETWORKS when checking network accessMarkus Lehtonen2016-11-301-1/+1
| | | | | | | | | [YOCTO #10508] (Bitbake rev: ddd3bc2d64d7240ecb6b6e4a1ae29b1faef6cc22) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: remove True option to getVar callsJoshua Lock2016-11-301-5/+5
| | | | | | | | | | | | getVar() now defaults to expanding by default, thus remove the True option from getVar() calls with a regex search and replace. Search made with the following regex: getVar ?\(( ?[^,()]*), True\) (Bitbake rev: 3b45c479de8640f92dd1d9f147b02e1eecfaadc8) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: lib/bb: Don't use deprecated bb.data.getVar/setVar APIRichard Purdie2016-11-231-1/+1
| | | | | | | | | | The old style bb.data.getVar/setVar API is obsolete. Most of bitbake doesn't use it but there were some pieces that escaped conversion. This patch fixes the remaining users mostly in the fetchers. (Bitbake rev: ff7892fa808116acc1ac50effa023a4cb031a5fc) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: preserve current working directoryMatt Madison2016-08-201-18/+10
| | | | | | | | | | | Fix the methods in all fetchers so they don't change the current working directory of the calling process, which could lead to "changed cwd" warnings from bitbake. (Bitbake rev: 6aa78bf3bd1f75728209e2d01faef31cb8887333) Signed-off-by: Matt Madison <matt@madison.systems> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/hg: Include missing errno importLogan Buchy2015-10-161-0/+1
| | | | | | | | | | errno.ENOENT checked if deletion of the fullmirror fails. Exception was thrown since module not imported (Bitbake rev: d92ebfc34b69ad5df2d151e6b8299fbb5afa3e5f) Signed-off-by: Logan Buchy <logan.buchy@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bb.fetch2.{git, hg}: remove tarball if it needs updatingChristopher Larson2015-09-181-4/+6
| | | | | | | | | | | | | | | | | | | We were maintaining state in the form of ud.repochanged to determine whether we need to write the tarball in the case where the tarball already exists, but this state is maintained only in memory. If we need to update the git repo, set ud.repochanged to True, and then are interrupted or killed, the tarball will then be out of date. Rather than maintaining this state, simply remove the out of date tarball when we update the git repo, and it will be re-created with updated content in build_mirror_data. [YOCTO #6366] (Bitbake rev: eaaa81393f181432c8586b17ade623f42c9fed2e) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: fetch2/hg.py: fix unpack error and mirror tarballRobert Yang2015-06-271-13/+66
| | | | | | | | | | | | | | | | | | Fixed: * do_unpack error: abort: repository DL_DIR/hg/vim.googlecode.com/hg/vim not found! * The mirror tarball doesn't work - Add the build_mirror_data to create the tarball - Unpack the mirror tarball when needed * The hg files will put in the dir like git: DL_DIR/hg, it was DL_DIR/hg/path/to/src/uri/path in the past. (Bitbake rev: 378647281ae883dd726f1e1b775dd35ef6a0e8d1) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch/hg: Disable checksums for archived downloadsAsh Charles2015-05-261-0/+7
| | | | | | | | | | | | | | | | Like the Git fetcher, the Mercurial fetcher shouldn't expect recipes to provide a checksum. As described [1], recipes using a mercurial fetcher that don't provide a checksum will fail in a the repository has previously been downloaded and archived. Credit to Rafaël Carré for figuring out the bug. [1] https://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg41328.html (Bitbake rev: 2df35a25b4968f64adfa673d5b73442c1a30829d) Signed-off-by: Ash Charles <ashcharles@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/hg.py: add clean functionRobert Yang2015-05-191-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed when bitbake vim -ccleanall: File: '/path/to/bitbake/lib/bb/fetch2/__init__.py', lineno: 1462, function: clean 1458: def clean(self, urldata, d): 1459: """ 1460: Clean any existing full or partial download 1461: """ *** 1462: bb.utils.remove(urldata.localpath) 1463: 1464: def try_premirror(self, urldata, d): 1465: """ 1466: Should premirrors be used? File: '/path/to/bitbake/lib/bb/utils.py', lineno: 633, function: remove 0629: subprocess.call(['rm', '-rf'] + glob.glob(path)) 0630: return 0631: for name in glob.glob(path): 0632: try: *** 0633: os.unlink(name) 0634: except OSError as exc: 0635: if exc.errno != errno.ENOENT: 0636: raise Exception: OSError: [Errno 21] Is a directory: '/path/to/downloads/hg/vim.googlecode.com/hg/vim' (Bitbake rev: 02763306662e15a4750395e5eab64ba98d1f9939) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch/hg: support submodulesDaniel McGregor2015-05-121-19/+36
| | | | | | | | | | | | | | | Use hg clone and hg pull to copy the source into the build directory rather than taring up the cloned repository and untarring in the destination. This allows submodules to be cloned. While here, make the default behaviour keep the hg scm data to match the behaviour of the git fetcher. (Bitbake rev: f002b1ca80cb542a4ed0c06c53c914cd5e076565) Signed-off-by: Daniel McGregor <daniel.mcgregor@vecima.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/hg: Fix username/password handlingRichard Purdie2014-08-281-1/+4
| | | | | | | | | We should only add user/password options if they're specified as in the fetch case. Patch from Volker Vogelhuber <v.vogelhuber@digitalendoscopy.de> (Bitbake rev: 303e6256947f4df4f283b75b7ccfdffa72864d67) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/hg: Fix missing proto param for hg checkout with user and pwVolker Vogelhuber2014-05-281-1/+1
| | | | | | | | | | A fix for the former patch when checking out a repository with username and password using HG (Bitbake rev: 0e7b594ccbceb3149f38776cea204807031ef69f) Signed-off-by: Volker Vogelhuber <v.vogelhuber@digitalendoscopy.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fix cloning of mercurial repository with username and password ↵Volker Vogelhuber2014-05-111-1/+4
| | | | | | | | | specified in url (Bitbake rev: 9a328262e047562a6edf7b2ec7b8a1949e287cbe) Signed-off-by: Volker Vogelhuber <v.vogelhuber@digitalendoscopy.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: HG Fetch with username and password in urlVolker Vogelhuber2014-04-291-1/+1
| | | | | | | | | | | | | | | | | | Following up a previous patch for mercurial fetcher, I just fixed a problem when calling update on a repository with subrepositories enabled. Attached a patch that fixes this problem >From caae519a2bd64bf7c729bb26aff344827def47fb Mon Sep 17 00:00:00 2001 From: Volker Vogelhuber <v.vogelhuber@digitalendoscopy.de> Date: Tue, 29 Apr 2014 15:29:47 +0200 Subject: [PATCH] bitbake: - fixed authentication issues in case of using sub repositories (Bitbake rev: dfa041c940caad12da50126a559afc8de089eeda) Signed-off-by: Volker Vogelhuber <v.vogelhuber@digitalendoscopy.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: Correct a few calls to latest_revision()Peter Kjellerstedt2013-11-251-1/+1
| | | | | | | | | | | In 6a48474de9505a3700863f31839a7c53c5e18a8d the url parameter to a number of functions was removed. However, not all calls to latest_revision() were fixed... (Bitbake rev: 7c94ca56b2fd85a989089f58b3dcce3172a778f2) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: Stop passing around the pointless url parameterRichard Purdie2013-11-221-8/+8
| | | | | | | | | | | | | | | There is no good reason to keep passing around the url parameter when its contained within urldata (ud). This is left around due to legacy reasons, some functions take it, some don't and its time to cleanup. This is fetcher internal API, there are a tiny number of external users of the internal API (buildhistory and distrodata) which can be fixed up after this change. (Bitbake rev: 6a48474de9505a3700863f31839a7c53c5e18a8d) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch/hg: Improve user/password handlingVolker Vogelhuber2013-11-011-2/+8
| | | | | | | | | | | | Trying to use a server with username and password authentication within the URL of the SRC_URI variable doesn't appear to work. This patch adds the missing parts to the hg fetcher to make this work properly. (Bitbake rev: dc3d6d73e44802c203b3f7247f6f212acc2f69bf) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: hg.py: Fixed fetch failure that occurs when SRCREV is a tag.Jon Szymaniak2013-01-181-1/+6
| | | | | | | | | | | | Removed "-r REV" from hg clone invocation to fetch the entire repo, rather than just the subset at the specified revision. This will ensure that the specified tag exists for successive commands (e.g., the update built on line 149.) (Bitbake rev: f0a6261d3a8ede9ebdb6383e02cb2c2de1690640) Signed-off-by: Jon Szymaniak <jon.szymaniak@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/hg.py: Use "protocol" parameter to get the protocolAndrei Gherzan2012-07-111-1/+1
| | | | | | | (Bitbake rev: f4a780a7f50fdd8f2bd75888dad790bcfe95b873) Signed-off-by: Andrei Gherzan <andrei@gherzan.ro> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* Fix mercurial fetcher in fetch21.1_M4.rc3Julian Pidancet2011-09-211-1/+1
| | | | | | | | | | | The _build_revision method in Hg class gets called with the wrong number of arguments. This tiny patch adds a 5th argument to the method declaration to prevent python from throwing an exception. (Bitbake rev: 623e9c7f7a9cf12b8c81c26cc608990682a601dd) Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake/fetch2: Fix the problems introduced by the git fetcher AUTOREV fixRichard Purdie2011-04-201-0/+2
| | | | | | | | | 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>
* Fix more incorrect usages of 'is'Chris Larson2011-03-311-4/+4
| | | | | | | (Bitbake rev: a26a2f548419af0e971ad21ec0a29e5245fe307f) Signed-off-by: Chris Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* fetch, fetch2: Get rid of DeprecationWarning noticeKhem Raj2011-03-031-1/+1
| | | | | | | | | | | | | * 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>
* bitbake/fetch2: Add explict network access exception and handling to give ↵Richard Purdie2011-02-111-2/+2
| | | | | | users usable error messages Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake/fetch2: Update forcefetch and mirror handling to clean up, simplfy ↵Richard Purdie2011-02-071-2/+6
| | | | | | and bug fix the code Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake/fetch2: Rename Fetch class to FetchMethodRichard Purdie2011-02-071-2/+2
| | | | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake/fetch2: Rewrite and improve exception handling, reusing core ↵Richard Purdie2011-02-071-11/+3
| | | | | | functions for common operations where possible Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake/fetch2: Define a sane localpath function and remove code duplicationRichard Purdie2011-02-071-3/+0
| | | | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake/fetch2: Move ud.localfile setup into urldata_initRichard Purdie2011-02-071-6/+6
| | | | Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* fetch2: Allow multiple src rev to be used in one src_uriYu Ke2011-02-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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>
* bitbake/fetch2: Instrument fetchers when making network accessYu Ke2011-01-251-0/+3
| | | | Signed-off-by: Yu Ke <ke.yu@intel.com>
* bb.fetch2: rename "go" with "download" to better reflect its functionalityYu Ke2011-01-251-1/+1
| | | | | | no functional change Signed-off-by: Yu Ke <ke.yu@intel.com>
* Fetcher: break the "SRCREVINACTION" deadlockYu Ke2011-01-101-8/+2
| | | | | | | | | | | | | | | | | | | | | 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>
* bb.fetch2.hg: add hg urldata_initYu Ke2011-01-101-5/+9
| | | | | | | move the hg specific urldata init from localpath to urldata_init so that it can be called early Signed-off-by: Yu Ke <ke.yu@intel.com>
* bb.fetch2: replace bb.fetch with bb.fetch2 in the bb.fetchYu Ke2011-01-101-5/+5
| | | | | | | | 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>
* bitbake: copy bb.fetch to bb.fetch2 as initial code base for fetcher overhaulYu Ke2011-01-101-0/+180
Signed-off-by: Yu Ke <ke.yu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>