summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Nagaev <bnagaev@gmail.com>2016-04-20 06:07:15 (GMT)
committerBoris Nagaev <bnagaev@gmail.com>2016-04-20 20:35:13 (GMT)
commitc5c610b0853821a8ba824ff7a96d3bfc5d8562e7 (patch)
treee517bcf3d9c0fa08afdbb6203ec4ae6f6b9588fb
parent9da2e477d372a21e727a3c47bca8fe1a8345192d (diff)
downloadmxe-c5c610b0853821a8ba824ff7a96d3bfc5d8562e7.zip
mxe-c5c610b0853821a8ba824ff7a96d3bfc5d8562e7.tar.gz
mxe-c5c610b0853821a8ba824ff7a96d3bfc5d8562e7.tar.bz2
build-pkg, second pass: fix fail on broken package
If a package is found to be broken on the first pass, then prev_files = nil, because this structure is filled only for non-broken packages. See https://github.com/mxe/mxe/pull/1243#issuecomment-211137555
-rwxr-xr-xtools/build-pkg.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/tools/build-pkg.lua b/tools/build-pkg.lua
index 56b1aaa..0af1d33 100755
--- a/tools/build-pkg.lua
+++ b/tools/build-pkg.lua
@@ -602,13 +602,15 @@ local function prepareTree(pass, item, item2deps, prev_files, item2index)
item2index,
'first'
)
- -- Remove files of item from previous build.
- for _, file in ipairs(prev_files) do
- os.remove(file)
- end
removeEmptyDirs()
- gitAdd()
- gitCommit(("Remove %s to rebuild it"):format(item, pass))
+ if prev_files then
+ -- Remove files of item from previous build.
+ for _, file in ipairs(prev_files) do
+ os.remove(file)
+ end
+ gitAdd()
+ gitCommit(("Remove %s to rebuild it"):format(item, pass))
+ end
else
error("Unknown pass: " .. pass)
end