diff options
author | Aníbal Limón <limon.anibal@gmail.com> | 2016-03-24 12:08:19 -0600 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-03-28 15:55:51 +0100 |
commit | 60656d07ea87e0c905c4b4c01a76a696af0d0c4e (patch) | |
tree | b95f640f2af9d5b7f09a3f35dc20fba383d49e4a /bitbake/lib/bb/fetch2 | |
parent | 45ee2b1079e8a6225a95c9e97791908fb6971ca0 (diff) | |
download | poky-60656d07ea87e0c905c4b4c01a76a696af0d0c4e.tar.gz |
bitbake: fetch2/wget.py: _check_latest_version_by_dir fix prefix detection
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>
Diffstat (limited to 'bitbake/lib/bb/fetch2')
-rw-r--r-- | bitbake/lib/bb/fetch2/wget.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py index ffae5405b0..8bc9e93ca0 100644 --- a/bitbake/lib/bb/fetch2/wget.py +++ b/bitbake/lib/bb/fetch2/wget.py | |||
@@ -438,9 +438,19 @@ class Wget(FetchMethod): | |||
438 | for line in soup.find_all('a', href=True): | 438 | for line in soup.find_all('a', href=True): |
439 | s = dirver_regex.search(line['href'].strip("/")) | 439 | s = dirver_regex.search(line['href'].strip("/")) |
440 | if s: | 440 | if s: |
441 | version_dir_new = ['', s.group('ver'), ''] | 441 | sver = s.group('ver') |
442 | |||
443 | # When prefix is part of the version directory it need to | ||
444 | # ensure that only version directory is used so remove previous | ||
445 | # directories if exists. | ||
446 | # | ||
447 | # Example: pfx = '/dir1/dir2/v' and version = '2.5' the expected | ||
448 | # result is v2.5. | ||
449 | spfx = s.group('pfx').split('/')[-1] | ||
450 | |||
451 | version_dir_new = ['', sver, ''] | ||
442 | if self._vercmp(version_dir, version_dir_new) <= 0: | 452 | if self._vercmp(version_dir, version_dir_new) <= 0: |
443 | dirver_new = s.group('pfx') + s.group('ver') | 453 | dirver_new = spfx + sver |
444 | path = ud.path.replace(dirver, dirver_new, True) \ | 454 | path = ud.path.replace(dirver, dirver_new, True) \ |
445 | .split(package)[0] | 455 | .split(package)[0] |
446 | uri = bb.fetch.encodeurl([ud.type, ud.host, path, | 456 | uri = bb.fetch.encodeurl([ud.type, ud.host, path, |