diff options
author | Boris Nagaev <bnagaev@gmail.com> | 2015-12-13 00:07:44 (GMT) |
---|---|---|
committer | Boris Nagaev <bnagaev@gmail.com> | 2015-12-13 21:20:23 (GMT) |
commit | 686afc35ecd513c2e0934a6d0287665efcc2a3a7 (patch) | |
tree | fe7fbc0ad403e1289ae43c612b0b5e2a7f99e28a /tools | |
parent | de45bde5b9e30e125279f66d307646b1b7fefafd (diff) | |
download | mxe-686afc35ecd513c2e0934a6d0287665efcc2a3a7.zip mxe-686afc35ecd513c2e0934a6d0287665efcc2a3a7.tar.gz mxe-686afc35ecd513c2e0934a6d0287665efcc2a3a7.tar.bz2 |
build-pkg: build empty dependencies of non-empty
Otherwise empty dependency produces no .deb file
preventing non-empty package from being installed.
Example: non-empty package gcc depends on empty
package mingw-w64.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/build-pkg.lua | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/tools/build-pkg.lua b/tools/build-pkg.lua index 845db95..4271c99 100755 --- a/tools/build-pkg.lua +++ b/tools/build-pkg.lua @@ -622,21 +622,40 @@ local function buildPackages(items, item2deps) end local function makeDebs(items, item2deps, item2ver, item2files) + -- start from building non-empty packages + local to_build = {} for _, item in ipairs(items) do - local deps = assert(item2deps[item], item) - local ver = assert(item2ver[item], item) local files = assert(item2files[item], item) if not isEmpty(item, files) then + table.insert(to_build, item) + end + end + local built = {} + repeat + local missing_deps_set = {} + for _, item in ipairs(to_build) do + local deps = assert(item2deps[item], item) + local ver = assert(item2ver[item], item) + local files = assert(item2files[item], item) for _, dep in ipairs(deps) do - local dep_files = assert(item2files[dep], dep) + local dep_files = item2files[dep] if isEmpty(dep, dep_files) then - log('Non-empty item %s depends on ' .. + log('Item %s depends on ' .. 'empty item %s', item, dep) + missing_deps_set[dep] = true end end makeDeb(item, files, deps, ver) + built[item] = true end - end + -- empty packages built to satisfy non-empty + to_build = {} + for item in pairs(missing_deps_set) do + if not built[item] then + table.insert(to_build, item) + end + end + until #to_build == 0 end local function getMxeVersion() |