diff options
Diffstat (limited to 'classes/newcollection.bbclass')
-rw-r--r-- | classes/newcollection.bbclass | 34 |
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) } |