mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-10 23:17:37 +01:00
parent
8fd229b739
commit
3914659718
@ -167,16 +167,27 @@ def updateMetaFromRelease(self, id, path):
|
|||||||
package.provides.clear()
|
package.provides.clear()
|
||||||
package.provides.extend(provides)
|
package.provides.extend(provides)
|
||||||
|
|
||||||
for dep in package.dependencies:
|
# Delete all meta package dependencies
|
||||||
if dep.meta_package:
|
package.dependencies.filter(Dependency.meta_package != None).delete()
|
||||||
db.session.delete(dep)
|
|
||||||
|
|
||||||
for meta in getMetaPackages(tree.fold("meta", "depends")):
|
# Get raw dependencies
|
||||||
|
depends = tree.fold("meta", "depends")
|
||||||
|
optional_depends = tree.fold("meta", "optional_depends")
|
||||||
|
|
||||||
|
# Filter out provides
|
||||||
|
for mod in provides:
|
||||||
|
depends.discard(mod)
|
||||||
|
optional_depends.discard(mod)
|
||||||
|
|
||||||
|
# Add dependencies
|
||||||
|
|
||||||
|
for meta in getMetaPackages(depends):
|
||||||
db.session.add(Dependency(package, meta=meta, optional=False))
|
db.session.add(Dependency(package, meta=meta, optional=False))
|
||||||
|
|
||||||
for meta in getMetaPackages(tree.fold("meta", "optional_depends")):
|
for meta in getMetaPackages(optional_depends):
|
||||||
db.session.add(Dependency(package, meta=meta, optional=True))
|
db.session.add(Dependency(package, meta=meta, optional=True))
|
||||||
|
|
||||||
|
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
|
||||||
except MinetestCheckError as err:
|
except MinetestCheckError as err:
|
||||||
|
Loading…
Reference in New Issue
Block a user