From 24f9801382c01703d4869fec4e5487cc87150447 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 24 Jan 2014 14:06:09 +0000 Subject: db: implement deps_exists() This tests if all the deps has the .apks built --- aports/db.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/aports/db.lua b/aports/db.lua index 08247f4..40b6f6c 100644 --- a/aports/db.lua +++ b/aports/db.lua @@ -251,6 +251,17 @@ function Aports:git_describe() return result end +function Aports:deps_exists(pkg) + for name in pkg:each_dependency() do + for dep in self:each_pkg_with_name(name) do + if dep.pkgname ~= pkg.pkgname and dep:arch_enabled() and not dep:all_apks_exists() then + return false + end + end + end + return true +end + function M.new(aportsdir, ...) local h = Aports h.aportsdir = aportsdir -- cgit v1.2.3