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): # search for version matches on folders inside the path, like: # "5.7" in http://download.gnome.org/sources/${PN}/5.7/${PN}-${PV}.tar.gz dirver_regex = re.compile(r"(?P[^/]*(\d+\.)*\d+([-_]r\d+)*)/") - m = dirver_regex.search(path) + m = dirver_regex.findall(path) if m: pn = d.getVar('PN') - dirver = m.group('dirver') + dirver = m[-1][0] dirver_pn_regex = re.compile(r"%s\d?" % (re.escape(pn))) if not dirver_pn_regex.search(dirver): diff --git a/bitbake/lib/bb/tests/fetch-testdata/software/libxml2/2.10/index.html b/bitbake/lib/bb/tests/fetch-testdata/software/libxml2/2.10/index.html new file mode 100644 index 0000000000..4e41af6d6a --- /dev/null +++ b/bitbake/lib/bb/tests/fetch-testdata/software/libxml2/2.10/index.html @@ -0,0 +1,20 @@ + + +Index of /sources/libxml2/2.10/ +

Index of /sources/libxml2/2.10/

+ + + + + + + + + + + + + + + +
File Name  ↓ File Size  ↓ Date  ↓ 
--
2.5 MiB2022-Oct-14 12:55
7.1 KiB2022-Aug-17 11:55
174 B2022-Aug-17 11:55
2.6 MiB2022-Aug-17 11:55
455 B2022-Aug-25 11:33
174 B2022-Aug-25 11:33
2.6 MiB2022-Aug-25 11:33
309 B2022-Aug-29 14:56
174 B2022-Aug-29 14:56
2.5 MiB2022-Aug-29 14:56
294 B2022-Oct-14 12:55
174 B2022-Oct-14 12:55
2.5 MiB2022-Oct-14 12:55
diff --git a/bitbake/lib/bb/tests/fetch-testdata/software/libxml2/2.9/index.html b/bitbake/lib/bb/tests/fetch-testdata/software/libxml2/2.9/index.html new file mode 100644 index 0000000000..abdfdd0fa2 --- /dev/null +++ b/bitbake/lib/bb/tests/fetch-testdata/software/libxml2/2.9/index.html @@ -0,0 +1,40 @@ + + +Index of /sources/libxml2/2.9/ +

Index of /sources/libxml2/2.9/

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
File Name  ↓ File Size  ↓ Date  ↓ 
--
3.0 MiB2022-May-02 12:03
87 B2022-Feb-14 18:27
3.0 MiB2022-Feb-14 18:27
87 B2022-Feb-14 18:28
3.0 MiB2022-Feb-14 18:28
88 B2022-Feb-14 18:42
3.2 MiB2022-Feb-14 18:42
88 B2022-Feb-14 18:43
3.2 MiB2022-Feb-14 18:43
88 B2022-Feb-14 18:45
3.2 MiB2022-Feb-14 18:45
26.6 KiB2022-Feb-20 12:42
174 B2022-Feb-20 12:42
3.1 MiB2022-Feb-20 12:42
1.0 KiB2022-May-02 12:03
174 B2022-May-02 12:03
3.0 MiB2022-May-02 12:03
87 B2022-Feb-14 18:30
3.2 MiB2022-Feb-14 18:30
87 B2022-Feb-14 18:31
3.2 MiB2022-Feb-14 18:31
87 B2022-Feb-14 18:33
2.9 MiB2022-Feb-14 18:33
87 B2022-Feb-14 18:35
3.0 MiB2022-Feb-14 18:35
87 B2022-Feb-14 18:36
3.0 MiB2022-Feb-14 18:36
87 B2022-Feb-14 18:37
3.0 MiB2022-Feb-14 18:37
87 B2022-Feb-14 18:39
3.0 MiB2022-Feb-14 18:39
87 B2022-Feb-14 18:40
3.0 MiB2022-Feb-14 18:40
diff --git a/bitbake/lib/bb/tests/fetch-testdata/software/libxml2/index.html b/bitbake/lib/bb/tests/fetch-testdata/software/libxml2/index.html new file mode 100644 index 0000000000..c183e06a55 --- /dev/null +++ b/bitbake/lib/bb/tests/fetch-testdata/software/libxml2/index.html @@ -0,0 +1,19 @@ + + +Index of /sources/libxml2/ +

Index of /sources/libxml2/

+ + + + + + + + + + + + + + +
File Name  ↓ File Size  ↓ Date  ↓ 
--
-2009-Jul-14 13:04
-2009-Jul-14 13:04
-2022-Oct-14 12:55
-2009-Jul-14 13:04
-2009-Jul-14 13:05
-2009-Jul-14 13:05
-2009-Jul-14 13:05
-2009-Jul-14 13:05
-2022-Feb-14 18:24
-2022-Feb-14 18:26
-2022-May-02 12:04
22.8 KiB2022-Oct-14 12:55
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py index 0af06e46e5..ad3d4dea7d 100644 --- a/bitbake/lib/bb/tests/fetch.py +++ b/bitbake/lib/bb/tests/fetch.py @@ -1401,6 +1401,9 @@ class FetchLatestVersionTest(FetcherTest): # http://www.cmake.org/files/v2.8/cmake-2.8.12.1.tar.gz ("cmake", "/files/v2.8/cmake-2.8.12.1.tar.gz", "", "") : "2.8.12.1", + # https://download.gnome.org/sources/libxml2/2.9/libxml2-2.9.14.tar.xz + ("libxml2", "/software/libxml2/2.9/libxml2-2.9.14.tar.xz", "", "") + : "2.10.3", # # packages with versions only in current directory #