summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Nagaev <bnagaev@gmail.com>2015-08-10 23:52:43 (GMT)
committerBoris Nagaev <bnagaev@gmail.com>2015-08-11 00:00:05 (GMT)
commitfc897b3327713949e5a270772b5c83cf96c501ce (patch)
tree3be8323782fc83d5bea8ed1828c91c411a1eaaea
parent2324fa4c5dbc0afe61b2233ee8192ae389dbf486 (diff)
downloadmxe-fc897b3327713949e5a270772b5c83cf96c501ce.zip
mxe-fc897b3327713949e5a270772b5c83cf96c501ce.tar.gz
mxe-fc897b3327713949e5a270772b5c83cf96c501ce.tar.bz2
build-pkg: fix build success detection
Previous code just checked if any new file was created. New code checks existance of the file created by MXE in case a build succeeded: "usr/<target>/installed/<package>". Without this improvement, some packages (e.g., pango) were falsely reported to be built successfully, because they have two or more targets and only first target succeded, creating *some* files (but not file "usr/<target>/installed/<package>").
-rwxr-xr-xtools/build-pkg.lua13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/build-pkg.lua b/tools/build-pkg.lua
index f250436..08e5ead 100755
--- a/tools/build-pkg.lua
+++ b/tools/build-pkg.lua
@@ -301,6 +301,17 @@ local function saveFileList(list_file, list)
file:close()
end
+local function isBuilt(pkg, files)
+ local INSTALLED = 'usr/%s/installed/%s'
+ local installed = INSTALLED:format(target, pkg)
+ for _, file in ipairs(files) do
+ if file == installed then
+ return true
+ end
+ end
+ return false
+end
+
-- build all packages, save filelist to file #pkg.list
local function buildPackages(pkgs, pkg2deps)
local broken = {}
@@ -316,7 +327,7 @@ local function buildPackages(pkgs, pkg2deps)
for _, pkg in ipairs(pkgs) do
if not brokenDep(pkg) then
local files = buildPackage(pkg)
- if #files > 0 then
+ if isBuilt(pkg, files) then
saveFileList(pkg .. '.list', files)
table.insert(unbroken, pkg)
else