diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2014-01-24 14:06:09 +0000 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2014-01-24 14:06:09 +0000 |
commit | 24f9801382c01703d4869fec4e5487cc87150447 (patch) | |
tree | c2ec1ddb13413a56c35dc6ed8c9e815b41429475 | |
parent | 252d3854b375935195d0e94cfc74e17594edf0e9 (diff) | |
download | lua-aports-24f9801382c01703d4869fec4e5487cc87150447.tar.bz2 lua-aports-24f9801382c01703d4869fec4e5487cc87150447.tar.xz |
db: implement deps_exists()
This tests if all the deps has the .apks built
-rw-r--r-- | aports/db.lua | 11 |
1 files changed, 11 insertions, 0 deletions
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 |