diff options
| author | Mark Hatle <mark.hatle@windriver.com> | 2015-09-10 17:02:10 -0500 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-09-18 09:05:34 +0100 |
| commit | 4c3d4eceb1811c4c17fb6649be86d8038a8daf4d (patch) | |
| tree | af1fbd9fff751a57c52fa0c55435aadaea256063 /bitbake/lib/bb/tests/fetch.py | |
| parent | 460e4c2c2c0411347442c30aedda6e0830fede16 (diff) | |
| download | poky-4c3d4eceb1811c4c17fb6649be86d8038a8daf4d.tar.gz | |
bitbake: fetch2/__init__.py: uri_replace regex handling
We should only substitute one time. If we do it without a max count, we can
end up matching over and over.
Before this change:
https://downloads.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz
with a mirror of
https://.*/[^/]* http://AAAA/A/A/A/
would end up either recursing indefinitely or result in:
http://AAAA/A/A/A/A/A/A/A/A/A/bitbake-1.0.tar.gz
(Bitbake rev: 4d254e02e2867dd9a6663508c8ca9f2733af71a8)
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/tests/fetch.py')
| -rw-r--r-- | bitbake/lib/bb/tests/fetch.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py index 1e61f3a116..84862247e0 100644 --- a/bitbake/lib/bb/tests/fetch.py +++ b/bitbake/lib/bb/tests/fetch.py | |||
| @@ -405,6 +405,13 @@ class MirrorUriTest(FetcherTest): | |||
| 405 | 'http://otherdownloads.yoctoproject.org/downloads/bitbake-1.0.tar.gz', | 405 | 'http://otherdownloads.yoctoproject.org/downloads/bitbake-1.0.tar.gz', |
| 406 | 'http://downloads2.yoctoproject.org/downloads/bitbake-1.0.tar.gz']) | 406 | 'http://downloads2.yoctoproject.org/downloads/bitbake-1.0.tar.gz']) |
| 407 | 407 | ||
| 408 | recmirrorvar = "https://.*/[^/]* http://AAAA/A/A/A/ \n" | ||
| 409 | |||
| 410 | def test_recursive(self): | ||
| 411 | fetcher = bb.fetch.FetchData("https://downloads.yoctoproject.org/releases/bitbake/bitbake-1.0.tar.gz", self.d) | ||
| 412 | mirrors = bb.fetch2.mirror_from_string(self.recmirrorvar) | ||
| 413 | uris, uds = bb.fetch2.build_mirroruris(fetcher, mirrors, self.d) | ||
| 414 | self.assertEqual(uris, ['http://AAAA/A/A/A/bitbake/bitbake-1.0.tar.gz']) | ||
| 408 | 415 | ||
| 409 | class FetcherLocalTest(FetcherTest): | 416 | class FetcherLocalTest(FetcherTest): |
| 410 | def setUp(self): | 417 | def setUp(self): |
