summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2019-11-19 11:17:51 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2019-11-19 11:17:51 +0000
commit9e31086fa8f1f7cc8d72c962c6ac089b93a60a36 (patch)
tree230ccfe31d164a265f5cedcabedad6c26835924e
parent02905c540b48dae833e4a64f8135ce0d417246d9 (diff)
downloadlua-aports-9e31086fa8f1f7cc8d72c962c6ac089b93a60a36.tar.gz
lua-aports-9e31086fa8f1f7cc8d72c962c6ac089b93a60a36.tar.bz2
lua-aports-9e31086fa8f1f7cc8d72c962c6ac089b93a60a36.tar.xz
db: include provides when calculate build order
-rw-r--r--aports/db.lua16
1 files changed, 12 insertions, 4 deletions
diff --git a/aports/db.lua b/aports/db.lua
index b0ba467..d3c7ebc 100644
--- a/aports/db.lua
+++ b/aports/db.lua
@@ -52,8 +52,8 @@ local function split_apkbuild(line)
return nil
end
local dir, pkgname, pkgver, pkgrel, pkgdesc, arch, license, options, depends,
- makedepends, checkdepends, subpackages, linguas, source, url =
- string.match(line, string.rep("([^\\]*)", 14, "\\"))
+ makedepends, checkdepends, subpackages, linguas, source, url, provides =
+ string.match(line, string.rep("([^\\]*)", 16, "\\"))
linguas = split(linguas)
return {
@@ -71,7 +71,8 @@ local function split_apkbuild(line)
source = split(source),
url = url,
arch = split_key(arch),
- options = split_key(options)
+ options = split_key(options),
+ provides = string.gsub(provides, "[=<>~].*", ""),
}
end
@@ -116,7 +117,7 @@ local function apkbuilds_open(aportsdir, repos)
[ -n "$dir" ] || exit 1;
cd "$dir";
. ./APKBUILD;
- echo $dir\\$pkgname\\$pkgver\\$pkgrel\\$pkgdesc\\$arch\\$license\\$options\\$depends\\$makedepends $makedepends_host $makedepends_build\\$checkdepends\\$subpackages\\$linguas\\$source\\$url ;
+ echo $dir\\$pkgname\\$pkgver\\$pkgrel\\$pkgdesc\\$arch\\$license\\$options\\$depends\\$makedepends $makedepends_host $makedepends_build\\$checkdepends\\$subpackages\\$linguas\\$source\\$url\\$provides ;
done;
]])
obj.read = function(self)
@@ -148,6 +149,13 @@ local function init_apkdb(aportsdir, repos, repodest)
end
table.insert(pkgdb[v], a)
end
+ -- add provides
+ if a.provides and a.provides ~= "" then
+ if pkgdb[a.provides] == nil then
+ pkgdb[a.provides] = {}
+ end
+ table.insert(pkgdb[a.provides], a)
+ end
-- add to reverse dependencies
for dep in a:each_dependency() do
if revdeps[dep] == nil then