summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/git.py
Commit message (Collapse)AuthorAgeFilesLines
* bitbake: fetch2: Change git fetcher not to destroy old referencessumoRichard Purdie2020-09-081-1/+1
| | | | | | | | | | | | | | | | It looks like we're about to see a lot of changes in branch names in repos. If we have the prune option here, those old names are lost, the changes propagate to our source mirrors and our old releases break. We have the force option so any replaced references should be replaced, its only orphaned branches which will now be preserved. I believe this behaviour will cause us fewer problems given the changes that look likely to happen. (Bitbake rev: 1df4fb1c9bf2fde0b274374bff1235c4b1f7ac79) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetcher: Fixed remote removal not throwing exception.Paulo Neves2018-10-101-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this fix it is assumed that the removal of the remote can only fail because there is not remote to remove. This is a false assumption. Example error which would be ignored: git -c core.fsyncobjectfiles=0 remote rm origin failed with exit code 1, output: Note: A branch outside the refs/remotes/ hierarchy was not removed; to delete it, use: git branch -d master error: could not lock config file config error: Could not remove config section 'remote.origin' Due to the masking of this error a stranger error will be presented to the user, because this time we do not mask the exception: git -c core.fsyncobjectfiles=0 remote add --mirror=fetch origin https://github.com/ptsneves/tl-wn722.git failed with exit code 128, output: fatal: remote origin already exists. The most likely reason that the remote cannot be removed nor modified is that the DL_DIR/git2 does not have permissions compatible with the user running bitbake. This commit fixes: https://bugzilla.yoctoproject.org/show_bug.cgi?id=12728 (Bitbake rev: 67189588a68b9bcb39421ef12103507b4c8820c3) Signed-off-by: Paulo Neves <ptsneves@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/git: log exception if ls-remote failsRoss Burton2018-03-281-1/+2
| | | | | | | (Bitbake rev: 8212446de11c0e370c55f88cde86334b760cd939) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch/git: Use 'git-make-shallow' from bin directoryNathan Rossi2018-02-141-1/+4
| | | | | | | | | | | | | | Move the code that existed in tests/fetch.py for determining the path to 'git-make-shallow' into the git module and reference it. This ensures that 'git-make-shallow' is always available and the desired version regardless of the path variable or whether git exposes the command. (Bitbake rev: 6b508ab8fd5aa796c1c00c970e81e5e93f84d35d) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch/git: Add pack-refs command to mirror handling codeRichard Purdie2018-01-291-0/+1
| | | | | | | | | | | | | We've noticed issues on our infrastucture iterating over the many tag/branch/head reference files that some git repositories may contain. By issuing the pack-refs command, we move these all to a single file which speeds up operations with the mirror repos in the downloads directory in general. (Bitbake rev: f8126aaf774186a6eaf0bd4067b89c074594886c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: Replace deprecated git branch parameter "--set-upstream"Andre Rosa2017-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | Since 2017-08-17 (git version 2.14.1.473.g3ec7d702a) using deprecated git branch parameter "--set-upstream" causes a fetcher error. Replace it by "--set-upstream-to". https://git.kernel.org/pub/scm/git/git.git/commit/?id=52668846ea2d41ffbd87cda7cb8e492dea9f2c4d says, it's deprecated since 2012-08-30 so hopefully all still supported host distributions have new enough git to support "--set-upstream-to". ERROR: PACKAGE do_unpack: Fetcher failure: ...; git -c core.fsyncobjectfiles=0 branch --set-upstream master origin/master failed with exit code 128, output: fatal: the '--set-upstream' option is no longer supported. Please use '--track' or '--set-upstream-to' instead. ERROR: PACKAGE do_unpack: Function failed: base_do_unpack (Bitbake rev: 2ab50074c1a6c56a8a178755de108447d7b7acaf) Signed-off-by: Andre Rosa <andre.rosa@lge.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch/git: add support for removing arbitrary revs for shallowChristopher Larson2017-06-021-1/+17
| | | | | | | | | | | | | | | | | | | | In certain cases, it's valuable to be able to exert more control over what history is removed, beyond srcrev+depth. As one example, you can remove most of the upstream kernel history from a kernel repository, keeping predominently the non-publically-accessible content. If the repository is private, the history in that repo couldn't be restored via `git fetch --unshallow`, but upstream history could be. Example usage: # Remove only these revs, not at a particular depth BB_GIT_SHALLOW_DEPTH_pn-linux-foo = "0" BB_GIT_SHALLOW_REVS_pn-linux-foo = "v4.1" (Bitbake rev: 97f856f0455d014ea34c28b1c25f09e13cdc851b) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch/git: add support for keeping extra refs for shallowChristopher Larson2017-06-021-1/+21
| | | | | | | | | | | | | | | | | | | | By default, all unused refs (branches & tags) are removed from the repository, as shallow processing scales with the number of refs it has to process. Add the ability to explicitly specify additional refs to keep. This is particularly useful for recipes with custom checkout processes, or whose git-based versioning requires a tag be available (i.e. for `git describe --tags`). The new `BB_GIT_SHALLOW_EXTRA_REFS` variable is a space-separated list of refs, fully specified, and support wildcards. Example usages: BB_GIT_SHALLOW_EXTRA_REFS = "refs/tags/v1.0" BB_GIT_SHALLOW_EXTRA_REFS += "refs/heads/*" (Bitbake rev: 1771934cd9f8b5847c6fcae0a906fb99d6b0db16) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch/git: support per-branch/per-url depths for shallowChristopher Larson2017-06-021-21/+40
| | | | | | | | | | | | | | | | Allow the user to explicitly adjust the depth for named urls/branches. The un-suffixed BB_GIT_SHALLOW_DEPTH is used as the default. Example usage: BB_GIT_SHALLOW_DEPTH = "1" BB_GIT_SHALLOW_DEPTH_doc = "0" BB_GIT_SHALLOW_DEPTH_meta = "0" (Bitbake rev: 9dfc517e5bcc6dd203a0ad685cc884676d2984c4) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch/git: add support for shallow mirror tarballsChristopher Larson2017-06-021-15/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This adds support to the git fetcher for fetching, using, and generating mirror tarballs of shallow git repositories. The external git-make-shallow script is used for shallow mirror tarball creation. This implements support for shallow mirror tarballs, not shallow clones. Supporting shallow clones directly is not really doable for us, as we'd need to hardcode the depth between branch HEAD and the SRCREV, and that depth would change as the branch is updated. When BB_GIT_SHALLOW is enabled, we will always attempt to fetch a shallow mirror tarball. If the shallow mirror tarball cannot be fetched, it will try to fetch the full mirror tarball and use that. If a shallow tarball is to be used, it will be unpacked directly at `do_unpack` time, rather than extracting it to DL_DIR at `do_fetch` time and cloning from there, to keep things simple. There's no value in keeping a shallow repository in DL_DIR, and dealing with the state for when to convert the clonedir to/from shallow is not worthwhile. To clarify when shallow is used vs a real repository, a current clone is preferred to either tarball, a shallow tarball is preferred to an out of date clone, and a missing clone will use either tarball (attempting the shallow one first). All referenced branches are truncated to SRCREV (that is, commits *after* SRCREV but before HEAD are removed) to further shrink the repository. By default, the shallow construction process removes all unused refs (branches/tags) from the repository, other than those referenced by the URL. Example usage: BB_GIT_SHALLOW ?= "1" # Keep only the top commit BB_GIT_SHALLOW_DEPTH ?= "1" # This defaults to enabled if both BB_GIT_SHALLOW and # BB_GENERATE_MIRROR_TARBALLS are enabled BB_GENERATE_SHALLOW_TARBALLS ?= "1" (Bitbake rev: 5ed7d85fda7c671be10ec24d7981b87a7d0d3366) Signed-off-by: Christopher Larson <chris_larson@mentor.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/git: prevent recursion on getting latest revisionPaul Eggleton2017-03-271-8/+20
| | | | | | | | | | | | | | | | | | We call git ls-remote to get the latest revision from a git repository, however by calling runfetchcmd() we can end up recursively running git ls-remote a number of times with OE e.g. if ${SRCPV} is in PV, ${PV} is in WORKDIR, and ${WORKDIR} is in PATH (as a result of recipe-specific sysroots), our call to runfetchcmd() exports PATH so _lsremote() will get called again - with the end result that we run git ls-remote 30 times in quick succession (!). Prevent that from happening by using a guard variable and returning a dummy value if it's called recursively. Fixes [YOCTO #11185]. (Bitbake rev: ff1ccd1db5d70b3fc9ad0d3e8f3d7b804c22bf36) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch/git: fix FetchError referenceChristopher Larson2017-03-221-1/+1
| | | | | | | | | FetchError isn't defined, use bb.fetch2.FetchError in this context. (Bitbake rev: 945fa980e027753df2c21d84eb63dcaddb2caaee) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch/git: drop pointless os.path.join, workdir=Christopher Larson2017-03-221-2/+2
| | | | | | | | | | The touch of .done explicitly specifies the path, so there's no need for workdir=, and "os.path.join('.')" is identical to just '.'. (Bitbake rev: 955cbfdaa2400d15ec428b65848e6835c9f44860) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch/git: kill pointless quotes around single % argsChristopher Larson2017-03-221-5/+5
| | | | | | | (Bitbake rev: 4aebf12153369364eae2e6e773e2a921e9c91f72) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch/git: use enumerate for ud.namesChristopher Larson2017-03-221-2/+2
| | | | | | | | | | list.index() isn't a particularly efficient operation, so keep track of our position via enumerate() instead, which is more pythonic as well. (Bitbake rev: dec6e90a4d27ee335e9c78aeebd277098fec94d1) 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: Correct two examples of typo "revsion."Robert P. J. Day2017-02-191-1/+1
| | | | | | | (Bitbake rev: 05f5421b2e44cd58c5912848de43d5884d070150) 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-2/+2
| | | | | | | | | [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-6/+6
| | | | | | | | | | | | 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-2/+2
| | | | | | | | | | 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-25/+20
| | | | | | | | | | | 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: git: Allow local repos to use HEADRichard Purdie2016-08-201-1/+15
| | | | | | | | | | | | | | | | Introduce a new 'usehead' url parameter for git repositories. Specifying usehead=1 causes bitbake to use whatever commit the repository HEAD is pointing to. Usage of usehead=1 is only allowed for local git repositories, i.e. it must always be accompanied with protocol=file url parameter. [YOCTO #9351] (Bitbake rev: 2673fac5a9d06de937101e3fb2ddf1e60ff99abf) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: implement progress supportPaul Eggleton2016-07-191-4/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement progress reporting support specifically for the fetchers. For fetch tasks we don't necessarily know which fetcher will be used (we might initially be fetching a git:// URI, but if we instead download a mirror tarball we may fetch that over http using wget). These programs also have different abilities as far as reporting progress goes (e.g. wget gives us percentage complete and rate, git gives this some of the time depending on what stage it's at). Additionally we filter out the progress output before it makes it to the logs, in order to prevent the logs filling up with junk. At the moment this is only implemented for the wget and git fetchers since they are the most commonly used (and svn doesn't seem to support any kind of progress output, at least not without doing a relatively expensive remote file listing first). Line changes such as the ones you get in git's output as it progresses don't make it to the log files, you only get the final state of the line so the logs aren't filled with progress information that's useless after the fact. Part of the implementation for [YOCTO #5383]. (Bitbake rev: 4027649f422ee64b1c4e1ad8d48ac295050afbff) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/git.py: References must match exactlyPeter Kjellerstedt2016-06-031-3/+4
| | | | | | | | | | | | | Previously the code used to match a reference to its SHA-1 in _latest_revision() used the Python "in" operator, which made it match if the reference matched the beginning of an existing tag or branch. This test, however, must be exact. I.e., either the reference matches a tag or branch exactly, or it does not match at all. (Bitbake rev: e5986c78a6108fd7578989c20efcbf0b81c97e03) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/git.py: remove .indirectiondir workaroundRobert Yang2016-04-061-17/+1
| | | | | | | | | | | It was used for workaround git 1.7.9.2 which was released in 2012 which should not be existed on nowadays host, so remove it to avoid confusions. (Bitbake rev: 6140d0cc9aecf1029ca16fed47071dfcc92f4269) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: Revert "fetch/git: Change to use clearer ssh url syntax for broken ↵Richard Purdie2016-01-151-4/+0
| | | | | | | | | | | servers" This reverts commit 4193e99adce8e88f12ac88d7578ad39575f7e346. It seems the underlying issue was caused by ":" in the url which isn't supported. The patch was therefore incorrect. Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/git.py: Add missing "errno" module import.Kristian Amlie2016-01-111-0/+1
| | | | | | | | | | | | This goes undetected most of the time, but when updating a repository, if the ud.fullmirror file is not present, you end up getting an exception instead of carrying on because the errno module is not loaded (specifically "if exc.errno != errno.ENOENT"). (Bitbake rev: e6fca8480731ce817df9bee61438347a5e3d3017) Signed-off-by: Kristian Amlie <kristian.amlie@mender.io> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch/git: Change to use clearer ssh url syntax for broken serversRichard Purdie2016-01-081-0/+4
| | | | | | | | | | | | | | | | | | | Some servers, e.g. bitbucket.org can't cope with ssh:// as part of the git url syntax. git itself is happy enough with this but you get server side errors when using it. This changes the git fetcher to use the more common ssh url format which also means we need a : before the path. Seems a shame to have to do this due to broken servers however it should be safe enough since this other form is the one most people use on the commandline so it should be safe enough. [YOCTO #8864] (Bitbake rev: 4193e99adce8e88f12ac88d7578ad39575f7e346) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: rename REGEX, REGEX_URI, and GITTAGREGEX.Alexander Kanavin2015-12-081-1/+1
| | | | | | | | | | | | Rename REGEX to UPSTREAM_CHECK_REGEX, REGEX_URI to UPSTREAM_CHECK_URI, and GITTAGREGEX to UPSTREAM_CHECK_GITTAGREGEX to better reflect their purpose and to reflect a common namespace. (Bitbake rev: f0a9e783f9969573fd74edfa241ef14f18ac684e) Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: bb.fetch2.git: Import errno moduleRomain Perier2015-09-191-0/+1
| | | | | | | | | | Currently this module is dereferencing errno.ENOENT but the python module "errno" is not imported, which causes a crash when fetching from a git repository. (Bitbake rev: 93e4c9bb2393b1074f5a01e7eaaac742a59d8086) Signed-off-by: Romain Perier <romain.perier@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: bb.fetch.git: remove leading '.' from gitsrcnameChristopher Larson2015-09-041-1/+4
| | | | | | | | | | | When using an absolute file URI, there's no host, and the path starts with '/', the dir under ${DL_DIR}/git2/ ends up starting with '.', so is hidden. Remove any leading '.' to fix this. (Bitbake rev: 8dce6964d56b36a77fb113f2ad496cc992a5ff36) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/git.py: latest_versionstring now returns (version, revision)Aníbal Limón2015-07-221-6/+12
| | | | | | | | | | | | | | | | We need to know the revision associated with the upstream version in SCM like git, this change broke return convention, oe-core recipeutils get_recipe_upstream_version need to be updated. tests/fetch.py: Updated git latest_versionstring test for comply new convention. [YOCTO #7605] (Bitbake rev: fd175dc90024c503134c11cbd83e77d88c406ac8) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/git.py: latest_versionstring search in all tagsAníbal Limón2015-07-221-1/+1
| | | | | | | | | Don't limit the tag search for only tags end with ^{}. (Bitbake rev: 7006ab313766344cf33481228465082ed5977d28) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: git.py: create a branch when checkoutRobert Yang2015-07-121-0/+7
| | | | | | | | | | * Create a branch and named as upstream branch when checkout source * Set the branch to track remote branch. (Bitbake rev: 1ba20e4fe9c884515b200589fe379ad5eeda10bd) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: Add fetch parameter to checkstatusyocto-1.9_M1Aníbal Limón2015-07-091-1/+1
| | | | | | | | | | In order to pass connection cache object to checkstatus function add fetch parameter. (Bitbake rev: fbb9c6f5538084e125b58118a86968908e6f895b) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/git.py: Add gitpkgv_revision alternative version informationMike Looijmans2015-05-241-0/+25
| | | | | | | | | | | | | | | | gitpkgv_revision returns a sortable revision number that can be used in the PKGV variable for example. To mimic meta-openembedded gitpkgv behaviour to provide a sortable revision numner, one could set the following: PKGV = "1.0+${@bb.fetch2.get_srcrev(d, 'gitpkgv_revision')}" This would yield a package version like "1.0+69+fb5eb80". (Bitbake rev: 989c08f62aff7b707c25c692c23284f16506b7bc) Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch/git: Fix uri in git checkstatusMarcin Smoczyński2015-05-191-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Pass proper repository url without arguments after a semicolon. Executing checkuri on a rule with git repository in SRC_URI does not report errors when working offline because wrong repository url is passed to the ls-remote command. For example "bitbake -c checkuri glibc" command executes: "git -c core.fsyncobjectfiles=0 ls-remote git://sourceware.org/git/glibc.git;branch=release/2.21/master" command in a shell subprocess to determine if url is valid. Shell subprocess executes in fact 2 commands: "git -c core.fsyncobjectfiles=0 ls-remote git://sourceware.org/git/glibc.git" and "branch=release/2.21/master" First one returns 127 or 128 depending on error but second one returns 0 because it is just env variable setup. Therefore we're not catching connection error. [YOCTO #7558] (Bitbake rev: efa44d04137977f883db4a643b0f774e91514722) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: fetch2/git: Add URL when latest_revision generates an ↵Mariano Lopez2015-05-151-1/+2
| | | | | | | | | | | | | | | | exception. The URL is not sent when _latest_revision generates and exception. When performing the sanity checks it is not possible to know the URI that failed. This add the URL when latest_revision generates an exception. [YOCTO: #7592] (Bitbake rev: 9f2115b07a55cb14e4a74dc6fbd3707c28a234d0) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/git: ensure the unpacked origin remote points upstreamPaul Eggleton2015-05-151-14/+17
| | | | | | | | | | | | | | | | | If you're interested in using the checked out repository for development (e.g. in OE with devtool) then you ideally want the origin remote to point to the repository it was fetched from, so just set that after cloning. (As part of this I did a minor refactor so we have one function to generate the repository URL, which was already in two places.) Fixes [YOCTO #7756]. (Bitbake rev: 80ecd1c54d4c748cee3a7ce0d64013a346e7671e) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch/git: Remove a possible trailing '/' in subpathAnders Darander2015-04-171-1/+1
| | | | | | | | | | | | If the subpath parameter to the git fetcher ends with a trailing '/', bb.utils.prunedir() will be called on '/'... Fixes [YOCTO #7620]. (Bitbake rev: 380a3fb372c8b0a53dd7528562e6e7a222dc76ef) Signed-off-by: Anders Darander <anders@chargestorm.se> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch/git: Improve ls-remote handling for latest_revisionRichard Purdie2015-01-141-4/+11
| | | | | | | | | | | | | | | | | | | Currently the code ignores lightweight tags which has caused some user complaints. We can't put the right search list in place easily since the results don't come back in a good order, head happens to sort before tags. In the end I refactored the function so we get the complete list of remotes and then we can filter it ourselves in the order we chose, including checking for light weight tags, preferring the proper ones. Hopefully this resolves the issues people have been seeing. [YOCTO #6881] (Bitbake rev: 07ad307065bb15a48f0015b9e4a643201abdc283) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch/git: Add latest_versionstring methodAníbal Limón2014-11-121-0/+38
| | | | | | | | | | | | | | | | | | | | | Being able to generate a version string representing the most recent git commit given git is useful, not least for the package reporting system. This adds in a latest_versionstring method to the git fetcher which allows users to query the latest version using ls-remote and filtering the responses. The patch also adds unittests for this function so that if improvements are made, the original test urls can be used to evaulate the those changes. This is based on code from Irina Patru <irina.patru@intel.com>. (Bitbake rev: f71c8c0354e87fed80bc845db6728e6e18ce9c4d) Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/git: Allow other namespaces than refs/heads to be searched.Fredrik Svensson2014-11-061-1/+4
| | | | | | | | | | | | This makes it possble to fetch Gerrit review references which are normally stored under refs/changes. Please disregard previous patch with the same topic. (Bitbake rev: 268e9c0c6830e8e621c418f20c2ca12dc840e48b) Signed-off-by: Fredrik Svensson <fredrik.svensson@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/git: Stop git from triggering fsync() callsRichard Purdie2014-04-271-2/+2
| | | | | | | | | | | | | | | We only ever clone other repositories, if there were a problem such as power failure, we'd blow away data and rebuild. As such we don't need fsync(). With filesystems like ext*, the fsync pushes nearly all the data out to disk which impacts all running processes. We therefore set a configuration parameter to disable the fsync() calls. Also fixup a case where basecmd wasn't being used for no good reason. (Bitbake rev: 0a26abaf3a1e34d556c9375068dd17c879568d0f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch/git: Separate out an ls-remote functionRichard Purdie2014-03-021-4/+12
| | | | | | | | | There is other code which can want to run ls-remote style commands with different parameters so split out the function. (Bitbake rev: 13f1138f5504feee0ee8e8f3a0675d0bea490351) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/git: Dereference unresolved tags with ls-remoteRichard Purdie2014-01-211-1/+1
| | | | | | | | | | | We need to deference tags when trying to map them to commit IDs with ls-remote. If we don't do this, a given commit might not show up later in a specific branch. There appears to be no good reason not to do this. (Bitbake rev: 8ef24f4c834298348172b96ec0b855bf09552b09) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/git: Anchor names when using ls-remoteRichard Purdie2014-01-211-2/+2
| | | | | | | | | | | | | | | | When specifying tags, they're searched for unanchored so foo/bar could match: refs/heads/abc/foo/bar refs/heads/xyz/foo/bar refs/heads/foo/bar This change anchors the expressions so they are based against heads or tags (or any other base level tree that has been created). (Bitbake rev: df2e0972cd1db7abd5ec8b7cb295fb0c42e284a4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>