diff options
author | Alexander Kanavin <alex.kanavin@gmail.com> | 2022-12-09 09:58:40 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-12-11 16:33:19 +0000 |
commit | 6257744d790dfe128ba1cb19b3b5676dc2dc0128 (patch) | |
tree | bfa8759d34a76b55e04d7c532645055dedef0534 /bitbake/lib/bb/fetch2/wget.py | |
parent | 91befcd1f39830b7d1edc70faa5e4ef2b7db9ab1 (diff) | |
download | poky-6257744d790dfe128ba1cb19b3b5676dc2dc0128.tar.gz |
bitbake: fetch2/wget.py: correctly match versioned directories
When obtaining latest upstream versions, the code needs
to check if the existing tarball is in a versioned directory
(e.g. component-name/x.y/component-name-x.y.z.tar.gz) and
if it is, it needs to first obtain the list of all
such versioned directories and then check all of them by going
one step up in the directory hierarchy.
Existing code was returning a correct match when the component
name did not have numbers, e.g. a check on 'source/epiphany/43/'
would return 43, but was stopping too soon when the component
name itself had numbers ('source/libxml2/2.10/' would return libxml2).
This change ensures the last match is taken instead of the first.
Also, adjust the fetcher tests to check that versioned directories
are correctly traversed in this case (e.g. the step to go one level
up is taken and a new tarball is discovered in a different versioned
directory).
(Bitbake rev: b6601be22c6d776327acdcd1fa931400f41ac786)
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2/wget.py')
-rw-r--r-- | bitbake/lib/bb/fetch2/wget.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/bitbake/lib/bb/fetch2/wget.py b/bitbake/lib/bb/fetch2/wget.py index d9aaad6b75..696e918030 100644 --- a/bitbake/lib/bb/fetch2/wget.py +++ b/bitbake/lib/bb/fetch2/wget.py | |||
@@ -645,10 +645,10 @@ class Wget(FetchMethod): | |||
645 | # search for version matches on folders inside the path, like: | 645 | # search for version matches on folders inside the path, like: |
646 | # "5.7" in http://download.gnome.org/sources/${PN}/5.7/${PN}-${PV}.tar.gz | 646 | # "5.7" in http://download.gnome.org/sources/${PN}/5.7/${PN}-${PV}.tar.gz |
647 | dirver_regex = re.compile(r"(?P<dirver>[^/]*(\d+\.)*\d+([-_]r\d+)*)/") | 647 | dirver_regex = re.compile(r"(?P<dirver>[^/]*(\d+\.)*\d+([-_]r\d+)*)/") |
648 | m = dirver_regex.search(path) | 648 | m = dirver_regex.findall(path) |
649 | if m: | 649 | if m: |
650 | pn = d.getVar('PN') | 650 | pn = d.getVar('PN') |
651 | dirver = m.group('dirver') | 651 | dirver = m[-1][0] |
652 | 652 | ||
653 | dirver_pn_regex = re.compile(r"%s\d?" % (re.escape(pn))) | 653 | dirver_pn_regex = re.compile(r"%s\d?" % (re.escape(pn))) |
654 | if not dirver_pn_regex.search(dirver): | 654 | if not dirver_pn_regex.search(dirver): |