aboutsummaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
authorChris Larson <chris_larson@mentor.com>2010-11-12 16:12:26 -0700
committerChris Larson <chris_larson@mentor.com>2010-11-12 16:13:11 -0700
commitdf3fe2bf89fdb9c48770a1f9965e11ad21a7e72d (patch)
tree6bbe7e0c3d9c5e829ddd0c4d4aa15ab6dc1bfd55 /classes
parent81a5067e56df4bf7df435b8012836a04cabad424 (diff)
downloadopenembedded-df3fe2bf89fdb9c48770a1f9965e11ad21a7e72d.tar.gz
newcollection: clean up, and work for those not using collections.inc
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Diffstat (limited to 'classes')
-rw-r--r--classes/newcollection.bbclass34
1 files changed, 19 insertions, 15 deletions
diff --git a/classes/newcollection.bbclass b/classes/newcollection.bbclass
index 7d4d478491..9570597af0 100644
--- a/classes/newcollection.bbclass
+++ b/classes/newcollection.bbclass
@@ -106,16 +106,25 @@ python do_newcollection() {
from bb.build import FuncFailed
from urlparse import urlparse, urlunparse
- files = [__newcollection_get_recipe(d)]
- files += __newcollection_get_recipedeps(d)
- files += __newcollection_get_fileuris(d)
+ files = set([__newcollection_get_recipe(d)])
+ files |= set(__newcollection_get_recipedeps(d))
+ files |= set(__newcollection_get_fileuris(d))
+
+ # filter out files that aren't in any overlays
collectionsinfo = d.getVar("COLLECTIONSINFO",1) or ""
- collections = list(chain(*(glob(normpath(collection['path'])) for collection in collectionsinfo.itervalues())))
+ if collectionsinfo:
+ collections = list(chain(*(glob(normpath(collection['path']))
+ for collection in collectionsinfo.itervalues())))
+ else:
+ topdir = d.getVar("TOPDIR", True)
+ collections = d.getVar("BBPATH", True).split(":")
+ if topdir in collections:
+ collections.remove(topdir)
+
if not collections:
return
- # filter out files that aren't in collections
- files = filter(lambda f: len(filter(lambda c: f.startswith(c), collections)) != 0, files)
+ files = filter(lambda f: any(f.startswith(c) for c in collections), files)
if not files:
return
@@ -132,21 +141,16 @@ python do_newcollection() {
else:
existing += glob(normpath(path))
- recipe = filter(lambda f: f.endswith(".bb"), files)
- if not recipe:
- debug(1, "Recipe already populated, skipping.")
- return
-
- for file in files:
+ for file in set(files):
for col in collections:
if file.startswith(col + sep):
basefile = file[len(col)+1:]
+
if not basefile:
continue
- for e in existing:
- if exists(join(e, basefile)):
- break
+ if any(exists(join(e, basefile)) for e in existing):
+ debug(1, "%s already in existing collections, skipping." % basefile)
else:
__newcollection_populate_file(file, join(destcol, basefile), d)
}