summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2
Commit message (Collapse)AuthorAgeFilesLines
* bitbake: fetch2: fix import error for Python 3.6.5Tzu Hsiang Lin2018-07-262-3/+1
| | | | | | | | | | | | | | When running bitbake command with Python 3.6.5 always result in import error causing by the change of distutils module. This patch replaces the method to search executable in PATH by "/usr/bin/env <command>". (Bitbake rev: 0193e1f5b2128602ad8a80c82a3dd4d2cdb6e4a7) Signed-off-by: Tzu Hsiang Lin <t9360341@ntut.org.tw> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Changhyeok Bae <changhyeok.bae@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: Do not fail to create symbolic links if they already existPeter Kjellerstedt2017-12-181-2/+13
| | | | | | | | | | | | | | | 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: 5f5e13bacde95a93633f621ec6b94a022c476a58) Signed-off-by: Peter Kjellerstedt <pkj@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: Replace deprecated git branch parameter "--set-upstream"Andre Rosa2017-11-071-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: 991b533f1d61042a7b3edd1fbf3dea0bf9991606) 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: wget: Fix handling of urls with user/passwordRichard Purdie2017-08-291-3/+2
| | | | | | | | | | | | | URL decoding was improved in the core a while ago and this looks like a leftover from those times which caused urls needing a user/password to fail. Use the parameters from the core instead of the broken split implementation. [YOCTO #11262] (Bitbake rev: 32a249cf33f79b579a2cf6224c7d23cdb20d376f) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: handle absolute paths in subdirRoss Burton2016-09-221-1/+7
| | | | | | | | | | | | | | | | 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>
* bitbake: bitbake: fetch2: Make SRCREV_FORMAT name substitution saferUlf Magnusson2016-09-151-1/+11
| | | | | | | | | | | | | | | | | | | | | | 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>
* bitbake: fetch2/npm: don't download same URL multiple timesPaul Eggleton2016-09-151-4/+8
| | | | | | | | | | | If we've already fetched a particular URL then we do not need to do so again within in the same operation. Maintain an internal list of fetched URLs to avoid doing that. (Bitbake rev: b4705c80add1f618c11a9223cdd9578d763b50ec) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/npm: clarify commentPaul Eggleton2016-09-081-1/+1
| | | | | | | | | | The correct name of the parameter is "version" not "ver" so ensure we aren't misleading the user by giving the latter in an example. (Bitbake rev: 14c045c6a20993d389b91ae2459d811a1430a7b2) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/npm: handle top-level shrinkwrap filePaul Eggleton2016-09-081-2/+9
| | | | | | | | | | | | | Allow using a top-level shrinkwrap file with one or more npm:// dependencies, i.e. if the module isn't found at the top level then look one level down. Part of the fix for [YOCTO #9537]. (Bitbake rev: f7de3f8b5f628dee043fe783148812914ab20813) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/npm: support subdir= parameterPaul Eggleton2016-09-081-1/+6
| | | | | | | | | | | | | "npmpkg" can be a default, but it should respect the subdir parameter as with other FetchMethods. This allows us to have more than one npm:// entry in SRC_URI without nasty hacks. Fix required in order to support [YOCTO #9537]. (Bitbake rev: e6a94d2091ec5d42f25102334a8492a731b8dec3) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/npm: fix broken fetches if more than one npm URL fetchedPaul Eggleton2016-09-081-3/+3
| | | | | | | | | | | | | | | You cannot set a URL-specific value in an object-level variable on the FetchMethod in urldata_init() or the result is the value specific to the last URL will be the one that gets set. This prevented fetching more than one npm:// URL correctly - the other tarballs would not download to the correct location and do_unpack failed to find them as a result. Fix required in order to support [YOCTO #9537]. (Bitbake rev: 1435b49ea7d0f9d4cc4a665fb2aa83d1eea7900f) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/npm: explicitly specify workdirPaul Eggleton2016-09-081-1/+2
| | | | | | | | | | | | | We were downloading into the current directory here, which is fine if that current directory can be expected to be the right place - but that's not true when called from recipetool within OE. We should explicitly specify the directory to run the command in and then there won't be a problem. (Bitbake rev: 0ddaf725e5a0675b252b7f80b1706370e478175b) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bb.fetch2.svn: correctly pass workdir when fetchingChristopher Larson2016-09-021-1/+1
| | | | | | | | | | | | The ud.pkgdir argument was being passed as the 'quiet' argument to runfetchcmd, not the 'workdir' argument, resulting in fetching the svn module into the root of DL_DIR, not where it belongs. Cc: Matt Madison <matt@madison.systems> (Bitbake rev: dc756510a95f88b192352be6fcd1d5d77852c348) Signed-off-by: Christopher Larson <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: wget: allow basic http auth for SSTATE_MIRRORSStephano Cetola2016-09-021-0/+11
| | | | | | | | | | | | | | | | | | If http basic auth creds were added to sstate mirrors like so: https://foo.com/sstate/PATH;user=foo:bar;downloadfilename=PATH The sstate mirror check would silently fail with 401 unauthorized. This patch allows both the check, and the wget download to succeed by checking for user credentials and if present adding the correct headers, or wget params as needed. [ YOCTO #9815 ] (Bitbake rev: cea8113d14da9e12db80a5b6b5811a47a7dfdeef) Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: Handle multiconfig fetcher issuesRichard Purdie2016-09-021-3/+4
| | | | | | | | | | | 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>
* bitbake: fetch2: clean up remaining cwd saves/changesMatt Madison2016-08-251-11/+0
| | | | | | | | | | | 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>
* bitbake: fetch2: preserve current working directoryMatt Madison2016-08-2013-137/+101
| | | | | | | | | | | 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/gitannex.py: use 'git annex init' instead of 'git annex sync'Terry Boese2016-08-111-1/+1
| | | | | | | | | | | | The git annex fetcher needs git annex to be initialized. Previously it was using 'git annex sync' to do this, but that has the downside of moving the checkout to the tip of the default branch. This means that tags, SRCREV, etc don't work in the gitannex case. (Bitbake rev: c1a57e2dd7fc96834643be5591a96f239215481a) Signed-off-by: Terry Boese <terry.boese@vecima.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch: Fix use of tar's --exclude option for tar >= 1.29Mariano Lopez2016-08-104-4/+4
| | | | | | | | | | | | | | | Starting from tar 1.29 the --exclude option won't work anymore if is not used before the path. There are some fetch modules that copy the ptest using tar and --exclude option. This fixes these for bitbake. [YOCTO #9763] (Bitbake rev: cc71d5d9da71ea5f21d02f3b2fbf119bd2d794f0) Signed-off-by: Mariano Lopez <mariano.lopez@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: fix pickle issues while switching from master to krogothMaxin B. John2016-07-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* bitbake: fetcher2/__init__: Print command in case of ExecutionError in ↵Mario Domenech Goulart2016-07-261-1/+1
| | | | | | | | | runfetchcmd (Bitbake rev: df7f4897c463a48c45514e2bcbd44cc7f86c4bb0) Signed-off-by: Mario Domenech Goulart <mario.goulart@bmw-carit.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch: copy files with -HEnrico Scholz2016-07-261-1/+1
| | | | | | | | | | | | | | | | | | | | | 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>
* bitbake: fetch2: implement progress supportPaul Eggleton2016-07-193-8/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/wget: attempt checkstatus again if it failsRoss Burton2016-07-081-4/+8
| | | | | | | | | | | | | Some services such as SourceForge seem to struggle to keep up under load, with the result that over half of the autobuilder checkuri runs fail with sourceforge.net "connection timed out". Attempt to mitigate this by re-attempting once the network operation on failure. (Bitbake rev: 54b1961551511948e0cbd2ac39f19b39b9cee568) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/perforce: Rework to support SRCREV and P4CONFIGAndrew Bradford2016-06-162-123/+150
| | | | | | | | | | | | | | | | | | | | | 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>
* bitbake: fetch2: fix unpacking of deb packagesStephano Cetola2016-06-161-1/+1
| | | | | | | | | | | Python 3 changed the return value of check_output to binary rather than a string. This fix decodes the binary before calling splitlines, which requires a string. (Bitbake rev: 1072beefe172423873a22a10c7171e10d0401e1e) Signed-off-by: Stephano Cetola <stephano.cetola@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: fix unpacking of deb packagesPaul Eggleton2016-06-031-1/+12
| | | | | | | | | | | | | | | deb packages in modern Debian versions have the data tarball compressed with xz rather than gzip, and thus explicitly extracting data.tar.gz fails. Unfortunately ar doesn't support wildcards matching items to extract, so we have to find out what the name of the file is first and then extract it, relying on tar to figure out how to unpack it based on the filename rather than doing it with pipes and making that determination ourselves. (Bitbake rev: 17ff08d225a8fa7faffd683c028369574954fba9) Signed-off-by: Paul Eggleton <paul.eggleton@linux.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: bitbake: Convert to python 3Richard Purdie2016-06-027-59/+51
| | | | | | | | | Various misc changes to convert bitbake to python3 which don't warrant separation into separate commits. (Bitbake rev: d0f904d407f57998419bd9c305ce53e5eaa36b24) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: Drop futures usage since we're python 3Richard Purdie2016-06-022-3/+0
| | | | | | (Bitbake rev: bf25f05ce4db11466e62f134f9a6916f886a93d9) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch: Use OrderedDict for url parametersRichard Purdie2016-05-131-2/+3
| | | | | | | | Without this, the dict can reorder causing sanity test failures. (Bitbake rev: ca8c91acc9396385834b266d4e8b84d917e5e298) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: Update logger.warn() -> logger.warning()Richard Purdie2016-05-112-20/+20
| | | | | | | | | | python deprecated logger.warn() in favour of logger.warning(). This is only used in bitbake code so we may as well just translate everything to avoid warnings under python 3. Its safe for python 2.7. (Bitbake rev: 676a5f592e8507e81b8f748d58acfea7572f8796) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: fetch2: Safer check for BB_ORIGENV datastoreLeonardo Sandoval2016-05-061-1/+2
| | | | | | | | | | | | | BB_ORIGENV value on the datastore can be NoneType thus raising an AttributeError exception when calling the getVar method. To avoid this, a check is done before accesing it. [YOCTO #9567] (Bitbake rev: f368f5ae64a1681873f3d81f3cb8fb38650367b0) Signed-off-by: Leonardo Sandoval <leonardo.sandoval.gonzalez@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: export DBUS_SESSION_BUS_ADDRESS to support authentication ↵Ross Burton2016-04-291-2/+3
| | | | | | | | | | | | | | | | | | agents Some users may want to use authenticated SSH connections with credentials stored in a keyring, such as gnome-keyring. These typically need a DBus session bus connection, so pass DBUS_SESSION_BUS_ADDRESS into the fetcher environment. To avoid the user needing to set it in their local.conf (which wouldn't be usable) or adding it to the environment-cleansing whitelist (which would potentially impact builds) allow the variables being passed to the fetchers to come from the data store (first) or the original environment (second). (Bitbake rev: 20ad1ea87712d042bd5d89ce1957793f7ff71da0) Signed-off-by: Ross Burton <ross.burton@intel.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: fetch2: BB_ALLOWED_NETWORKS should not care about port numbersOlof Johansson2016-04-031-0/+1
| | | | | | | | | | | | | | | | | Bitbake would fail to classify the following URL as belonging to a allowed network, because of the port number in the url. BB_ALLOWED_NETWORKS = "*.example.com" SRC_URI = "http://git.example.com:8080/foo.tar.gz" Since protocols aren't specified in the BB_ALLOWED_NETWORKS variable, it's reasonable to believe that this should work regardless of protocol being used. (Bitbake rev: ff603df23037e10fb2cfdf150429cba3f65072cd) Signed-off-by: Olof Johansson <olof.johansson@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: Ensure that incorrect checksumed files are always renamedRichard Purdie2016-03-311-8/+21
| | | | | | | | | | | | | | There are some codepaths where the file checksum is verified and can be found to mismatch but the 'rename' logic doesn't kick in. If code relies on the presence of a file for the checksum having been checked (e.g. uninative.bbclass) then it can be used when the checksum hasn't matched. Therefore rename the file whenever an invalid checksum is encountered. (Bitbake rev: 69ef6c8a9db02bfa0e3fac72481ec26586a29a01) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/wget.py: _check_latest_version_by_dir fix prefix detectionAníbal Limón2016-03-281-2/+12
| | | | | | | | | | | | | | | | When prefix is part of the version directory it need to ensure that only version directory is used so remove previous directories if exists. Example: pfx = '/dir1/dir2/v' and version = '2.5' the expected result is 'v2.5' instead of '/dir1/dir2/v2.5'. [YOCTO #8778] (Bitbake rev: c760531c6dbf88135ab9f8e6f0784ccbf2cce1e4) Signed-off-by: Aníbal Limón <limon.anibal@gmail.com> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/wget.py: _check_latest_version_by_dir use group namesAníbal Limón2016-03-281-4/+4
| | | | | | | | | | Little improvement for reference tokens by names instead of index. (Bitbake rev: e8ea15eeb1857ed4bb6337836bd2fb1f5dbb1bdf) Signed-off-by: Aníbal Limón <limon.anibal@gmail.com> Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: Handle lockfiles for file:// urls redirected to mirrorsRichard Purdie2016-03-261-0/+8
| | | | | | | | | | | | | | | | | We recently dropped lockfiles for file:// urls which in itself makes sense. If a file url redirects to something like an http:// mirror, we'd have no lock taken for the original file and could race against others trying to download the file. We therefore need to ensure there is a lock taken in the mirror handling code. This adds code to take such a lock, assuming it isn't the same lock as the parent url. (Bitbake rev: 913b6ce22cd50eac96e8937c5ffc704bfce2c023) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: bitbake: fetch2/gitsm: Fix fetch when the repository contains ↵Derek Straka2016-03-261-5/+2
| | | | | | | | | | | nested submodules This fixes a problem when the repository contains multiple levels of submodules via a resursive submodule init. (Bitbake rev: dbafbe229360ffe5908b106a9c10e274712b9b17) Signed-off-by: Derek Straka <derek@asterius.io> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: cache: Make BB_DONT_CACHE variable externalMarkus Lehtonen2016-03-231-1/+1
| | | | | | | | | | | | | | This makes it possible to prevent a recipe to be cached, and thus, parsed every time. Use with care. [YOCTO #8853] (Bitbake rev: 78335c1fbe5266116700c2413aac28b00423a75b) Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/npm: fix ud.registry so that alternative registries can be ↵Brendan Le Foll2016-03-121-1/+1
| | | | | | | | | | | | | | | handled Fixes [YOCTO #9231] npm when given an invalid registry URL with --registry actually goes and fetches from the default registry, but this commit makes sure it goes to the specified one. (Bitbake rev: 7c849be7c70a5db4f66fe3041486abb923b5e4ee) Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2: Make SRC_URI[md5sum] and SRC_URI[sha256sum] expand their valuesPeter Kjellerstedt2016-03-091-2/+2
| | | | | | | | | | | | | | | | | | | For some reason, the values for SRC_URI[md5sum] and SRC_URI[sha256sum] were not being expanded. That lead to the following code not working as expected: SRC_URI = "http://.../${PN}-${PV}.tar.gz" MD5SUM = "123abc..." SHA256SUM = "abcd1234..." SRC_URI[md5sum] = "${MD5SUM}" SRC_URI[sha256sum] = "${SHA256SUM}" (Bitbake rev: ba011470df0ea8bd89f01c0b02ec4b3969e60ce7) Signed-off-by: Peter Kjellerstedt <peter.kjellerstedt@axis.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/npm: add missing URL argument to ParameterErrorPaul Eggleton2016-03-091-2/+2
| | | | | | | | | | Without this you get a rather odd traceback instead of the proper exception message. (Bitbake rev: 2fe1826d3077eeda6cde433d3a1e6620f74e08dd) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/npm: properly handle npm dependenciesPaul Eggleton2016-03-091-19/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The output of "npm view dependencies" isn't entirely JSON if there are multiple results, but the code here was just discarding the output if the entire thing didn't parse as JSON. Split the output into lines and iterate over it, parsing JSON fragments as we find them; this way we end up with the last package's dependencies since it'll be last in the output. Digging further, it seems that the dependencies field reported by "npm view" also includes optional dependencies. That wouldn't be a problem except some of these optional dependencies may be OS-specific; for example the "chokidar" module has "fsevents" in its optional dependencies, but fsevents only works on MacOS X (and is only needed there). If we erroneously pull in fsevents, not only is it unnecessary but it causes "npm shrinkwrap" to throw a tantrum. In the absence of a better approach, look at the os field and discard the module (along with any of its dependencies) if it isn't for Linux. As part of this, we can reduce the calls to npm view to one per package since we get the entire json output rather than querying twice for two separate fields. Overall the time taken has probably increased since we are being more thorough about dependencies, but it's not quite as bad as it could have been. (Bitbake rev: 436d67fe7af89ecfbd11749a6ae1bc20e81f2cc8) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/npm: fix errors with some version specificationsPaul Eggleton2016-03-091-1/+1
| | | | | | | | | | | "2 || 3" is a valid version specification for a dependency in an npm package.json file, but of course that looks like something else when sent to a shell. Quote the version value to avoid this. (Bitbake rev: bea0246831a46d943d2e27d6b38f6e498bd3413c) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/npm: ignore unknown headers in tarballsPaul Eggleton2016-03-071-1/+1
| | | | | | | | | | | Tarballs that are fetched down via npm repositories seem to often have unknown headers. This doesn't affect our ability to extract the contents though so we don't really care to see those warnings. (Bitbake rev: b38975103e52a0c25e9ad9032c8cca1c47cbdcc2) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* bitbake: fetch2/npm: handle alternative dependency syntaxPaul Eggleton2016-03-071-1/+3
| | | | | | | | | | | | | npm allows you to specify a dependency as a Github username+path, or omit the version entirely. You can hit these if you don't use a shrinkwrap file, with the result that the code later fails due to the output of "npm view" being empty; so handle this lazily by just ignoring this part of the dependency if it's not really a version. (Bitbake rev: 7b7a65c44dbdd5ba9366d4e2093f76df8758d546) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>