oe.external: escape the pathname from FILES_MIRRORS

Currently the substitutions fail to match if the path contains re
special characters like '+', which is problematic.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
This commit is contained in:
Christopher Larson
2018-03-17 07:22:39 +05:00
parent e5885f2319
commit 52de7a284a

View File

@@ -1,4 +1,5 @@
import os.path
import re
import oe.path
import bb
@@ -29,8 +30,8 @@ def get_file_search_metadata(d):
entry = entry.strip()
if not entry:
continue
pattern, subst = entry.strip().split('|', 1)
mirrors.append(('^' + pattern, subst))
pathname, subst = entry.strip().split('|', 1)
mirrors.append(('^' + re.escape(pathname), subst))
source_paths = [os.path.realpath(p)
for p in d.getVar('EXTERNAL_INSTALL_SOURCE_PATHS', True).split()]