+COLLECTIONINFO = "${@get_collection(d.getVar('FILE', 1), d)}"
+
+def has_collection(name, d):
+ for (uniquename, info) in d.getVar("COLLECTIONSINFO", 1).iteritems():
+ if info["name"] == name:
+ return True
+ return False
+
+def get_collection(file, d):
+ if not os.path.isabs(file):
+ file = bb.which(d.getVar("BBPATH", 1), file)
+ filedir = os.path.realpath(os.path.dirname(file))
+ for (uniquename, info) in d.getVar("COLLECTIONSINFO", 1).iteritems():
+ path = os.path.realpath(info["path"])
+ if filedir.startswith(path + os.path.sep):
+ return info
+
+def collection_unpack(collection, d):