[oe-commits] [bitbake] 02/02: fetch2/wget.py: _check_latest_version_by_dir fix prefix detection
git at git.openembedded.org
git at git.openembedded.org
Sat Mar 26 08:28:36 UTC 2016
rpurdie pushed a commit to branch master-next
in repository bitbake.
commit c760531c6dbf88135ab9f8e6f0784ccbf2cce1e4
Author: Aníbal Limón <limon.anibal at gmail.com>
AuthorDate: Thu Mar 24 12:08:19 2016 -0600
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]
Signed-off-by: Aníbal Limón <limon.anibal at gmail.com>
Signed-off-by: Aníbal Limón <anibal.limon at linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
---
lib/bb/fetch2/wget.py | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/lib/bb/fetch2/wget.py b/lib/bb/fetch2/wget.py
index ffae540..8bc9e93 100644
--- a/lib/bb/fetch2/wget.py
+++ b/lib/bb/fetch2/wget.py
@@ -438,9 +438,19 @@ class Wget(FetchMethod):
for line in soup.find_all('a', href=True):
s = dirver_regex.search(line['href'].strip("/"))
if s:
- version_dir_new = ['', s.group('ver'), '']
+ sver = s.group('ver')
+
+ # 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.
+ spfx = s.group('pfx').split('/')[-1]
+
+ version_dir_new = ['', sver, '']
if self._vercmp(version_dir, version_dir_new) <= 0:
- dirver_new = s.group('pfx') + s.group('ver')
+ dirver_new = spfx + sver
path = ud.path.replace(dirver, dirver_new, True) \
.split(package)[0]
uri = bb.fetch.encodeurl([ud.type, ud.host, path,
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Openembedded-commits
mailing list