summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/__init__.py
AgeCommit message (Collapse)Author
2021-01-31bitbake: fetch2: Fix os.errno referencesRichard Purdie
os.errno used to happen to work but is invalid. Correct to use errno. [YOCTO #13068] (Bitbake rev: b3fc65289d33274cd5dace4d4ffe55be11c991f4) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-11-13bitbake: fetch2: Ensure cached url data is matched to a datastoreRichard Purdie
There was a weird error in OE-Core where "devtool modify virtual/kernel" was showing basehash mismatch errors. This was due to SRCPV sometimes being: AUTOINC+b867b78b50_47b80ef7bd and sometimes AUTOINC+b867b78b50_255a750d28. The latter hash comes from KBRANCH and meant sometimes the correct branch was seen, sometimes it was not. The issue was complicated by the execution using a remote datastore over tinfoil. The problem turns out to be a fetcher caching error. If the datastore changes, the cached url data may not be valid. We therefore ensure we match cached url data against the datastore that generated it, which appears to fix this issue. (Bitbake rev: 97067634b1f149b56844b10e3a5e8d0d980b6e34) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-09-06bitbake: fetch2: show warning when renaming the archive with bad checksum failedMartin Jansa
* noticed on read-only sshfs premirror * it was showing the warning about renaming the file: WARNING: laser-geometry-1.6.4-r0 do_fetch: Renaming /jenkins/mjansa/sshfs/webos-ose-thud/downloads/laser_geometry-1.6.4.tar.gz to /jenkins/mjansa/sshfs/webos-ose-thud/downloads/laser_geometry-1.6.4.tar.gz_bad-checksum_1ee7479b8c5914b4ffae996945121441 and then failed because of movefile() issue with python3 (fixed in previous commit): ERROR: laser-geometry-1.6.4-r0 do_fetch: Error executing a python function in exec_python_func() autogenerated: with movefile() fixed, it let do_fetch continue and re-fetch locally with the right checksum, but still the renamed file didn't exist, because of movefile failure - add another warning when the movefile fails - for whatever reason - unfortunately movefile prints error messages with just print() so the real error is hidden only in log.do_fetch in this case: movefile: Failed to move /jenkins/mjansa/sshfs/webos-ose-thud/downloads/laser_geometry-1.6.4.tar.gz to /jenkins/mjansa/sshfs/webos-ose-thud/downloads/laser_geometry-1.6.4.tar.gz_bad-checksum_1ee7479b8c5914b4ffae996945121441 [Errno 30] Read-only file system: '/jenkins/mjansa/sshfs/webos-ose-thud/downloads/laser_geometry-1.6.4.tar.gz' -> '/jenkins/mjansa/sshfs/webos-ose-thud/downloads/laser_geometry-1.6.4.tar.gz_bad-checksum_1ee7479b8c5914b4ffae996945121441' (Bitbake rev: d36438759344caa447d9a0bf30749a0aa31d1fba) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2019-01-08bitbake: fetch: don't use shell=True when listing ar filesRoss Burton
(Bitbake rev: ff2e5d435046886791551587a0988f21ddfe6e2a) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-12-06bitbake: fetch2: Avoid warning about incorrect character escaping in regexRichard Purdie
Fixes: lib/bb/fetch2/__init__.py:259: DeprecationWarning: invalid escape sequence \w re.compile("^\w+:(?!//)").match(uri): (Bitbake rev: 9c619f1eb1583582fafda6acabaf08a5761215ef) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-11-07bitbake: fetch: Also export GIT_SSH environment variableMike Crowe
Support users who want to specify a custom ssh to Git using an environment variable. (This lets build systems work without requiring users to configure Git explicitly.) (Bitbake rev: db46fb2755a4b1033ab60051ce511cc9dd7e34fb) Signed-off-by: Mike Crowe <mac@mcrowe.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-18bitbake: fetch2: Avoid incorrect getVarFlag callRichard Purdie
Calling getVarFlag with flag=None makes no sense, don't do it. Bitbake used to silently ignore this, it now warns so avoid the warning. (Bitbake rev: a68de8ace62eaba23856bfb301efbbe1824322aa) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-18bitbake: fetch2: extract the function which ensures that a valid symlink existsUrs Fässler
For better readability and future use, we extract the function which ensures that a given symlink exists. (Bitbake rev: 5e69ca56533666a097bb23d09ab673e5c862051c) Signed-off-by: Urs Fässler <urs.fassler@bbv.ch> Signed-off-by: Pascal Bach <pascal.bach@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-10-18bitbake: fetch2: avoid circular recursion with SRCPV in PRPeter Marko
Some recent changes broke SRCPV and workaround was introduced to avoid circular dependency if SRCPV is in PV. However there is still the same error if SRCPV is in PR. (Bitbake rev: 05ee4845f925b8528a7ce9cffb4bae425b8fa1e9) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-06-21bitbake: fetch2: Use correct check in parameter handling in uri_replace()Nikolai Merinov
If uri_find contain parameters then original URI parameters should be checked against parameters from uri_find instead of parameters from uri_replace. (Bitbake rev: 8efa7826a61501589afa33eb698c0ab3a622bf2e) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-05-22bitbake: fetch2/__init__.py: Fixed handling of uris with empty pathJakub Dębski
For mirrors or premirrors defined like: "http://.*/.* http://somewhere.org" fetching ends with errors because function fetch2/__init__.py:encodeurl() creates url like "http://somewhere.orgsomefile.tar.gz". It happens because function fetch2/__init__.py:decodeurl() for url "http://somewhere.org" returns ['http', 'somewhere.org', '', '', '', {}] and then in function fetch2/__init__.py:uri_replace() variable result_decode will be ['http', 'somewhere.org', 'somefile.tar.gz', '', '', {}] (because of line: result_decoded[loc] = os.path.join(result_decoded[loc], basename)) for which encodeurl returns "http://somewhere.orgsomefile.tar.gz". In addition for mirror "http://.*/.* http://somewhere.org/" everything works fine. (Bitbake rev: d822ae24ef5485e550804cbd9130ebd73b2aa48e) Signed-off-by: Jakub Dębski <jdebski@enigma.com.pl> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-02-14bitbake: fetch2: Handle missing donestamp file when content is validNathan Rossi
In order to allow users to manually populate the download directory with valid content change the assumption that missing the donestamp file means unfetched content. This allows users to populate the download dir without needing to create dummy .done files such that a user does not need a PREMIRROR when using BB_NO_NETWORK to provide valid content files in the download directory. To ensure the correct result this change also fails first if the localpath does not exist. This prevents further parts of the function attempting to calculating the checksum on non-existent files. This also fixes some edge conditions around where if the donestamp exists but the localpath does not it returns, and did not remove the donestamp. Also added test cases to cover this use case and additional use cases where for example the fetcher does not support checksums. (Bitbake rev: a335dbbb65d5b56e71d98cf3e4fa9bfbec1dcde6) Signed-off-by: Nathan Rossi <nathan@nathanrossi.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2018-01-08bitbake: fetch2/__init__: Disable pseudo in runfetchcmd()Peter Kjellerstedt
If a fetcher, e.g., git, is run when pseudo is active it will think it is running as root. If it in turn uses ssh (as git does), ssh too will think it is running as root. This will cause it to try to read root's ssh configuration from /root/.ssh which will fail. If ssh then needs to ask for credentials it will hang indefinitely as there is nowhere for it to ask the user for them (and even if there was it would not access the correct private keys). The solution to the above is to temporarily disable pseudo while executing any fetcher commands. There should be no reason for them to be executed under pseudo anyway so this should not be a problem. RP Ammendum: We finally did get more information about how to reproduce this problem, something needs to trigger bb.fetch2.get_srcrev() in a pseudo context, for example when AUTOREV is in use or the recipe doesn't have a defined SRCREV. That SRC_URI needs to be using protocol=ssh. This would trigger an ls-remote of the remote repo and if that happens under pseudo, the wrong ssh credentials may be attempted which can hang. [YOCTO #12464] (Bitbake rev: ceaca281cafa662aa2385b95641bce309dce843d) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-11-29bitbake: fetch2: fix unpack of .txz filesAndré Draszik
.txz is the same as .tar.xz, and can be found in the wild. (Bitbake rev: 2ba8a6b25ccc12e7b543e8450121e5311c7a701d) Signed-off-by: André Draszik <git@andred.net> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-09-11bitbake: fetch2: add stub latest_versionstring to FetchMethodRoss Burton
(Bitbake rev: c45453d1f6bc7bcecd84f58e2f7d93d6bd1e8499) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-08-23bitbake: fetch2: don't mandate path element in encodeurl()Paul Eggleton
URLs do not have to have a path; currently our npm URLs don't, so encodeurl() needs to handle if the path element isn't specified. This fixes errors using OpenEmbedded's devtool add / recipetool create on an npm URL after OE-Core revision ecca596b75cfda2f798a0bdde75f4f774e23a95b that uses decodeurl() and encodeurl() to change URL parameter values. (Bitbake rev: d5cab2dbf5682d2fd08e58316a3bf39a10f63df2) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-31bitbake: fetch2: fix checkstatus fallback to MIRRORSRoss Burton
The checkstatus() code was expecting checkstatus to throw exceptions if it failed, but in general it should return False. (Bitbake rev: 57be5cc6228518e60f564570a39cebbeb6cf564e) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-27bitbake: lib/fetch2/__init__.py: Fix unpack commentMark Hatle
(Bitbake rev: b8f477de204ab5d0680b2b7c42370d13395be46c) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-25bitbake: fetch2/__init__.py: replace stray logger.warn() with logger.warning()Andre McCurdy
Update stray usage of deprecated logger.warn(), which was introduced to fetch2/__init__.py after all other instances had been replaced by logger.warning(): http://git.openembedded.org/bitbake/commit/?id=5a53e7d7b017769a6eb0f0a6335735a1fe51a5ec http://git.openembedded.org/bitbake/commit/?id=676a5f592e8507e81b8f748d58acfea7572f8796 (Bitbake rev: 1b14f115a9e929e29e91e8ac70826a3fe7259961) Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-21bitbake: fetch2: fire an event when there are missing checksumsPaul Eggleton
If BB_STRICT_CHECKSUMS is set to anything other than "1" i.e. we're not going to raise an error, then fire an event so that scripts can listen for it and get the checksums. (Bitbake rev: 8b2ccb4b865f2df118ef668847df682a83f9c500) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-21bitbake: fetch2: allow hiding checksum warningPaul Eggleton
If BB_STRICT_CHECKSUMS is set to "ignore" then don't display a warning if no checksums are specified in the recipe. This is not intended to be used from recipes - it is needed when we move to using more standard code paths to fetch new files from scripts i.e. where we don't know what the checksums are in advance. (Bitbake rev: f15ca7339de8a448a93a14cf6130b3925178a920) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-07-18bitbake: fetch2: fix indentationPaul Eggleton
(Bitbake rev: 6683338598ce97278f188fbcd780c3e3754e5b9a) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-22bitbake: fetch: fix handling of files with incorrect checksums from a premirrorJoshua Lock
Ensure that when an item fetched from a premirror has an invalid checksum the fetcher falls back to the usual logic of trying the upstream and any configured mirrors. (Bitbake rev: 022adb30dbb0df764c9fb515918cb9a88e4f8d6f) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-06-02bitbake: fetch: support multiple mirror tarball filenamesChristopher Larson
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>
2017-05-15bitbake: lib/bb/fetch2: fix typo in conflicting revision messagePaul Eggleton
spcify -> specify (Bitbake rev: c46f183b3ea94789dd83cb280a1bf5735189c9bc) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-04-01bitbake: fetch2: Do not fail to create symbolic links if they already existPeter Kjellerstedt
When the fetcher retrieves file:// URLs, there is no lock file being used. This means that in case two separate tasks (typically from two concurrent invocations of bitbake) want to download the same file:// URL at the same time, there is a very small chance that they also end up wanting to create a symbolic link to the file at the same time. This would previously lead to one of the tasks failing as the other task would have created the link. (Bitbake rev: 58a03531c8183b165bb7dcad86d8559c92bc150d) Signed-off-by: Peter Kjellerstedt <pkj@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-29bitbake: fetch2: Ensure we don't have file downloads overwriting each otherRichard Purdie
Imagine you have an sstate mirror accessed over http and an SSTATE_MIRRORS which maps file:// urls to http:// urls. File urls set donestampneeded = False, http urls don't. This can result in races in the try_mirror_url() code since it will trigger new downloads after aquiring the lockfile as verify_donestamp() doesn't look at origud and there is no donestamp. verify_donestamp() already has code to look at origud, we're just missing some code at the start of the function to do this. Fix it to avoid these races. (Bitbake rev: b8b14d975a254444461ba857fc6fb8c725de8874) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04bitbake: fetch2: pass --no-same-owner when extracting tar files compressed ↵Andre McCurdy
with 7-Zip Treat tar files compressed with 7-Zip in the same way as tar files compressed with other compression formats. (Bitbake rev: 363a0f54dc7d9930537f0df25173fa31ca1f98ac) Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-04bitbake: fetch2: remove last remaining usage of deprecated bb.data APIsAndre McCurdy
(Bitbake rev: 62dc3c3b40a95f9df31f5c917574c3822fb8bb64) Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-03bitbake: fetch2: add initial Amazon AWS S3 fetcherAndre McCurdy
Class for fetching files from Amazon S3 using the AWS Command Line Interface. The aws tool must be correctly installed and configured prior to use. The class supports both download() and checkstatus(), which therefore allows S3 mirrors to be used for SSTATE_MIRRORS. (Bitbake rev: 6fe07ed25457dd7952b60f4b2153d56b15d5eea6) Signed-off-by: Andre McCurdy <armccurdy@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-03bitbake: fetch2: Allow whitespace only mirror entriesRichard Purdie
Forcing the use of "\n" in mirror variables is pointless, we can just require that there are pairs of values. (Bitbake rev: 044fb04dbe69313ee6908bf4d3cee7f797d0c41c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-03-01bitbake: fetch2/__init__: handle @ in package namesAnders Darander
A number of npm packages use @ as a leading chararacter. Examples are most of the angular2 packages. (Bitbake rev: 628c4bf6c89b3d62c9b864380b5c8e131a899bff) Signed-off-by: Anders Darander <anders@chargestorm.se> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-19bitbake: fetch2: Add NFS Stale file exception handlingKhem Raj
- In some cases the file descriptor is held by nfs client and none of os.path.* is catching that, it could mean that error is not doled out because client has cached the stat info. In this case we are out of luck. Needed to catch IOError, which would be causing the Stale error. - In download method, update_stamp is invoked md5sum validation which is found to be throwing Stale errors. - Added error handling to fix the stale errors. (Bitbake rev: 5a53e7d7b017769a6eb0f0a6335735a1fe51a5ec) Signed-off-by: Balaji Punnuru <balaji_punnuru@cable.comcast.com> Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-02-19bitbake: fetch2: Rename "setup_revisons" to "setup_revisions"Robert P. J. Day
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>
2017-02-19bitbake: fetch2: Correct two examples of typo "revsion."Robert P. J. Day
(Bitbake rev: 05f5421b2e44cd58c5912848de43d5884d070150) Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2017-01-20bitbake: fetch2: Avoid recursive errorsRichard Purdie
If PATH contains WORKDIR which contains PV which contains SRCPV we can end up in circular recursion within the fetcher. This code change allows for the recursion to be broken by giving PV a temporary dummy value in a data store copy. (Bitbake rev: ce1e70b8018340b54dba3a81d7d379182cb77514) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30bitbake: fetch2: obey BB_ALLOWED_NETWORKS when checking network accessMarkus Lehtonen
[YOCTO #10508] (Bitbake rev: ddd3bc2d64d7240ecb6b6e4a1ae29b1faef6cc22) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30bitbake: bitbake: remove True option to getVarFlag callsJoshua Lock
getVarFlag() now defaults to expanding by default, thus remove the True option from getVarFlag() calls with a regex search and replace. Search made with the following regex: getVarFlag ?\(( ?[^,()]*, ?[^,()]*), True\) (Bitbake rev: c19baa8c19ea8ab9b9b64fd30298d8764c6fd2cd) Signed-off-by: Joshua Lock <joshua.g.lock@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-11-30bitbake: bitbake: remove True option to getVar callsJoshua Lock
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>
2016-11-23bitbake: lib/bb: Don't use deprecated bb.data.getVar/setVar APIRichard Purdie
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>
2016-09-22bitbake: fetch2: handle absolute paths in subdirRoss Burton
Currently if you use the subdir parameter in a SRC_URI and pass an absolute path then it gets appended to the unpack directory instead of being used directly. This is inconvenient as it may be useful to use ${S} when you want to unpack a file into the source tree. Change this behaviour so that absolute paths are used directly instead of being appended to the root directory. To ensure that recipes cannot write files to an arbitrary location enforce that the subdir starts with the unpack root. (Bitbake rev: c3873346c6fa1021a1d63bddd9b898a77c618432) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-15bitbake: bitbake: fetch2: Make SRCREV_FORMAT name substitution saferUlf Magnusson
The implementation of SRCREV_FORMAT has at least two issues: 1. Given two names "foo" and "foobar" and SRCREV_FORMAT = "foo_foobar", "foo" might currently get substituted twice, and "foobar" not at all. 2. If the revision substitued for some name happens to contain another name as a substring, then that substring might incorrectly get replaced. Fix both issues by sorting the names with the longest ones first and replacing all names at once with a regular expression. This was inspired by http://stackoverflow.com/questions/6116978/python-replace-multiple-strings. (Bitbake rev: 8e6a893cb7f13ea14051fc40c6c9baf41aa47fee) Signed-off-by: Ulf Magnusson <ulfalizer@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-09-02bitbake: fetch2: Handle multiconfig fetcher issuesRichard Purdie
We need a separate fetcher cache per multiconfig as the revisions and other SRC_URI data can potentially be different. For now, this is the simplest way to achieve that and avoids linux-yocto kernel build failures when targeting multiple machines for example. (Bitbake rev: d98cc31d6668bc1d6372664593126b5e5132ef2c) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-25bitbake: fetch2: clean up remaining cwd saves/changesMatt Madison
Now that the fetchers all preserve the current working directory, the cwd changes in the try_mirror_url, download, and checkstatus methods are no longer needed. (Bitbake rev: 0ed8975c42718342a104a9764a58816f964ec4ea) Signed-off-by: Matt Madison <matt@madison.systems> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-08-20bitbake: fetch2: preserve current working directoryMatt Madison
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>
2016-07-29bitbake: fetch2: fix pickle issues while switching from master to krogothMaxin B. John
While switching from master to krogoth build with a common download directory, got a large number of warnings like the one listed below: WARNING: freetype-2.6.3-r0 do_fetch: Couldn't load checksums from donestamp /home/maxin/downloads/freetype-2.6.3.tar.bz2.done: ValueError (msg: unsupported pickle protocol: 4) These warnings are caused by the difference in pickle module implementation in python3(master) and python2(krogoth). Python2 supports 3 different protocols (0, 1, 2) and pickle.HIGHEST_PROTOCOL is 2 where as Python3 supports 5 different protocols (0, 1, 2, 3, 4) and pickle.HIGHEST_PROTOCOL is obviously 4. My suggestion is to use 2 since it is backward compatible with python2 (all the supported distros for krogoth provides python2 which supports pickle protocol version 2) (Bitbake rev: cc67800f279fb211ee3bb4ea7009fdbb82973b02) Signed-off-by: Maxin B. John <maxin.john@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26bitbake: fetcher2/__init__: Print command in case of ExecutionError in ↵Mario Domenech Goulart
runfetchcmd (Bitbake rev: df7f4897c463a48c45514e2bcbd44cc7f86c4bb0) Signed-off-by: Mario Domenech Goulart <mario.goulart@bmw-carit.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-26bitbake: fetch: copy files with -HEnrico Scholz
When using a PREMIRROR with plain (non-unpack) files, a SRC_URI like SRC_URI = "file://devmem2.c" will cause devmem2.c to be a symlink in the WORKDIR pointing to the local PREMIRROR. Trying to apply a patch on this file will either modify the file on the PREMIRROR or will fail due to sanity checks: ERROR: devmem2-1.0-r7 do_patch: Command Error: 'quilt --quiltrc /cache/build-ubuntu/sysroots/x86_64-oe-linux/etc/quiltrc push' exited with 1 Output: Applying patch devmem2-fixups-2.patch File devmem2.c is not a regular file -- refusing to patch (Bitbake rev: cfd481fe9799e7a4c6bfac32e56cc91cfcd81088) Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
2016-07-19bitbake: fetch2: implement progress supportPaul Eggleton
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>
2016-06-16bitbake: fetch2/perforce: Rework to support SRCREV and P4CONFIGAndrew Bradford
In recipes which use the perforce fetcher, enable use of SRCREV to specify any of: ${AUTOREV}, changelist number, p4date, or label. This is more in-line with how the other fetchers work for source control systems. Allow p4 to use the P4CONFIG env variable to define the server URL, username, and password if not provided in a recipe. This does change existing perforce fetcher usage by recipes and will likely need those recipes which use the perforce fetcher to be updated. No recipes in oe-core use the perforce fetcher. References [YOCTO #6303] (Bitbake rev: 6298696bb94a127cdec7964315f6891ba92cd026) Signed-off-by: Andrew Bradford <andrew.bradford@kodakalaris.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>