From 4d254e02e2867dd9a6663508c8ca9f2733af71a8 Mon Sep 17 00:00:00 2001 From: Mark Hatle Date: Thu, 10 Sep 2015 17:02:10 -0500 Subject: 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 Signed-off-by: Mark Hatle Signed-off-by: Richard Purdie --- lib/bb/fetch2/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/bb/fetch2/__init__.py') diff --git a/lib/bb/fetch2/__init__.py b/lib/bb/fetch2/__init__.py index 3d53b63b3e..569007fdb8 100644 --- a/lib/bb/fetch2/__init__.py +++ b/lib/bb/fetch2/__init__.py @@ -464,7 +464,7 @@ def uri_replace(ud, uri_find, uri_replace, replacements, d): for k in replacements: uri_replace_decoded[loc] = uri_replace_decoded[loc].replace(k, replacements[k]) #bb.note("%s %s %s" % (regexp, uri_replace_decoded[loc], uri_decoded[loc])) - result_decoded[loc] = re.sub(regexp, uri_replace_decoded[loc], uri_decoded[loc]) + result_decoded[loc] = re.sub(regexp, uri_replace_decoded[loc], uri_decoded[loc], 1) if loc == 2: # Handle path manipulations basename = None -- cgit 1.2.3-korg