summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Larson <clarson@kergoth.com>2007-02-27 20:03:44 +0000
committerChris Larson <clarson@kergoth.com>2007-02-27 20:03:44 +0000
commit6c9f1fb359e9e95874d1b6c0e9eb3b86c0986d55 (patch)
tree25faeed3e4bfcc526d3909b16ed8930ccdfea53e
parent2f6d37c0c7b67e8ee926065cba4cdcc5a9187eb3 (diff)
downloadbitbake-6c9f1fb359e9e95874d1b6c0e9eb3b86c0986d55.tar.gz
Bitbake: cooker.py: Fix find_bbfiles. Previously, an attempt to put a path to a directory (not a glob of the .bb files) in BBFILES would fail, as it was calling out 'find' but not chomping off the newlines from the find output. Now it's using os.walk() to populate the list instead.
-rw-r--r--lib/bb/cooker.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 8a9c58863..f7ac66296 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -556,13 +556,17 @@ class BBCooker:
return bbfiles
def find_bbfiles( self, path ):
- """Find all the .bb files in a directory (uses find)"""
- findcmd = 'find ' + path + ' -name *.bb | grep -v SCCS/'
- try:
- finddata = os.popen(findcmd)
- except OSError:
- return []
- return finddata.readlines()
+ """Find all the .bb files in a directory"""
+ from os.path import join
+
+ found = []
+ for dir, dirs, files in os.walk(path):
+ for ignored in ('SCCS', 'CVS', '.svn'):
+ if ignored in dirs:
+ dirs.remove(ignored)
+ found += [join(dir,f) for f in files if f.endswith('.bb')]
+
+ return found
def collect_bbfiles( self ):
"""Collect all available .bb build files"""