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>").
This commit is contained in:
Boris Nagaev 2015-08-11 02:52:43 +03:00
parent 2324fa4c5d
commit fc897b3327
1 changed files with 12 additions and 1 deletions

View File

@ -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