Forráskód Böngészése

external-toolchain: catch re compilation errors in FILES_MIRRORS

Signed-off-by: Christopher Larson <kergoth@gmail.com>
Christopher Larson 9 éve
szülő
commit
6d9b06cd21
1 módosított fájl, 5 hozzáadás és 1 törlés
  1. 5 1
      classes/external-toolchain.bbclass

+ 5 - 1
classes/external-toolchain.bbclass

@@ -163,7 +163,11 @@ def expand_paths(pathnames, mirrors):
         expanded_paths = [pathname]
 
         for search, replace in mirrors:
-            new_pathname = re.sub(search, replace, pathname, count=1)
+            try:
+                new_pathname = re.sub(search, replace, pathname, count=1)
+            except re.error as exc:
+                bb.warn("Invalid pattern for `%s`" % search)
+                continue
             if new_pathname != pathname:
                 expanded_paths.append(new_pathname)