Skip to contentSkip to conversation

Enable --ignore-deps options to access regular expression string

PATCH In review Guo Hongruan 3 participants 4 messages Dec 15, 2009 – Dec 24, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Enable --ignore-deps options to access regular expression string

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(-)
lib/bb/taskdata.py +17 -4
index 45f6902..3935e09 100644
@@ -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):
Signature · 1 line
1.5.4.3
#1 lore raw
Quoted 61 lines · Guo Hongruan

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(-)
lib/bb/taskdata.py +0 -0
index 45f6902..3935e09 100644
@@ -26,6 +26,19 @@ Task data collection and handling

 from bb import data, event, mkdirhier, utils
 import bb, os

lib/bb/taskdata.py +13 -0
+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

lib/bb/taskdata.py +0 -0
@@ -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

lib/bb/taskdata.py +0 -0
@@ -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

lib/bb/taskdata.py +0 -0
@@ -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:

lib/bb/taskdata.py +0 -0
@@ -408,7 +421,7 @@ class TaskData:
         (takes item names from RDEPENDS/PACKAGES namespace)

        """

Quoted 8 lines

-        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

look good to me. May be you should post it to [email protected] for getting it included into bitbake.

-Khem

#2 lore raw
In reply to Guo Hongruan
Quoted 2 lines · On Tuesday 15 December 2009 10:10:13 Guo Hongruan wrote:

1. Add a function named re_match_strings(target,strings), to match target using the string in strings which can be regular expression

I pushed this to 1.10 and master of bitbake. thanks a lot

regards

	z.
#3 lore raw

I am very happy :)

Quoted 13 lines · 在 Thu, 24 Dec 2009 20:44:17 +0800,Holger Hans Peter Freyther…
Quoted 2 lines · On Tuesday 15 December 2009 10:10:13 Guo Hongruan wrote:

1. Add a function named re_match_strings(target,strings), to match target using the string in strings which can be regular expression

I pushed this to 1.10 and master of bitbake. thanks a lot

regards

	z.

_______________________________________________
Openembedded-devel mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel

Signature · 4 lines
Guo Hongruan, Embedded Linux Consultant
Skype: camelguo
Twitter: camelguo
http://www.gulessoft.com