[oe] [PATCH] Enable --ignore-deps options to access regular expression string
Guo Hongruan
camelguo at gmail.com
Tue Dec 15 09:10:13 UTC 2009
1. Add a function named re_match_strings(target,strings), to match
target using the string in strings which can be regular expression
---
lib/bb/taskdata.py | 21 +++++++++++++++++----
1 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/lib/bb/taskdata.py b/lib/bb/taskdata.py
index 45f6902..3935e09 100644
--- a/lib/bb/taskdata.py
+++ b/lib/bb/taskdata.py
@@ -26,6 +26,19 @@ Task data collection and handling
from bb import data, event, mkdirhier, utils
import bb, os
+def re_match_strings(target, strings):
+ """
+ Whether or not the string 'target' matches
+ any one string of the strings which can be regular expression string
+ """
+ import re
+
+ for name in strings:
+ if (name==target or
+ re.search(name,target)!=None):
+ return True
+ return False
+
class TaskData:
"""
BitBake Task Data implementation
@@ -262,7 +275,7 @@ class TaskData:
"""
unresolved = []
for target in self.build_names_index:
- if target in dataCache.ignored_dependencies:
+ if re_match_strings(target, dataCache.ignored_dependencies):
continue
if self.build_names_index.index(target) in self.failed_deps:
continue
@@ -277,7 +290,7 @@ class TaskData:
"""
unresolved = []
for target in self.run_names_index:
- if target in dataCache.ignored_dependencies:
+ if re_match_strings(target, dataCache.ignored_dependencies):
continue
if self.run_names_index.index(target) in self.failed_rdeps:
continue
@@ -357,7 +370,7 @@ class TaskData:
added internally during dependency resolution
"""
- if item in dataCache.ignored_dependencies:
+ if re_match_strings(item, dataCache.ignored_dependencies):
return
if not item in dataCache.providers:
@@ -408,7 +421,7 @@ class TaskData:
(takes item names from RDEPENDS/PACKAGES namespace)
"""
- if item in dataCache.ignored_dependencies:
+ if re_match_strings(item, dataCache.ignored_dependencies):
return
if self.have_runtime_target(item):
--
1.5.4.3
More information about the Openembedded-devel
mailing list