Ignore duplicate library storages

This commit is contained in:
Ivan Kravets
2019-11-01 18:28:20 +02:00
parent da928efb43
commit 88db253515

View File

@ -674,7 +674,7 @@ class PlatformBase(PlatformPackagesMixin, PlatformRunMixin):
self.packages[name]["optional"] = True self.packages[name]["optional"] = True
def get_lib_storages(self): def get_lib_storages(self):
storages = [] storages = {}
for opts in (self.frameworks or {}).values(): for opts in (self.frameworks or {}).values():
if "package" not in opts: if "package" not in opts:
continue continue
@ -682,7 +682,7 @@ class PlatformBase(PlatformPackagesMixin, PlatformRunMixin):
if not pkg_dir or not isdir(join(pkg_dir, "libraries")): if not pkg_dir or not isdir(join(pkg_dir, "libraries")):
continue continue
libs_dir = join(pkg_dir, "libraries") libs_dir = join(pkg_dir, "libraries")
storages.append({"name": opts["package"], "path": libs_dir}) storages[libs_dir] = opts["package"]
libcores_dir = join(libs_dir, "__cores__") libcores_dir = join(libs_dir, "__cores__")
if not isdir(libcores_dir): if not isdir(libcores_dir):
continue continue
@ -690,14 +690,9 @@ class PlatformBase(PlatformPackagesMixin, PlatformRunMixin):
libcore_dir = join(libcores_dir, item) libcore_dir = join(libcores_dir, item)
if not isdir(libcore_dir): if not isdir(libcore_dir):
continue continue
storages.append( storages[libcore_dir] = "%s-core-%s" % (opts["package"], item)
{
"name": "%s-core-%s" % (opts["package"], item),
"path": libcore_dir,
}
)
return storages return [dict(name=name, path=path) for path, name in storages.items()]
class PlatformBoardConfig(object): class PlatformBoardConfig(object):