From 59788a6aab097a5e1265cb2feebf7e91cbab7ac7 Mon Sep 17 00:00:00 2001 From: Lynix Date: Thu, 29 Sep 2016 18:00:05 +0200 Subject: [PATCH] Build/Package: Improve printing Former-commit-id: c0b3bb1c20ed6b0fdcac34bd35e0c9fea6e5a46c [formerly 918686c05b0ac0cacbcd029a8ba95d1250dab731] [formerly fb1bdc4ec327c2b6588cb5fe4977a4fa23728a72 [formerly 9b359f94196467899e015de6107d2dd44c7037c1]] Former-commit-id: a0d6e9386e7970e160655bd1da7e7594754a1635 [formerly f63b6d2e66666389f5fa1c595d5229bcd068b1b4] Former-commit-id: ba34434a83785d2879a365ac324e3230bedec4ac --- build/scripts/actions/package.lua | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/build/scripts/actions/package.lua b/build/scripts/actions/package.lua index 632462769..6c4f1e677 100644 --- a/build/scripts/actions/package.lua +++ b/build/scripts/actions/package.lua @@ -15,15 +15,14 @@ ACTION.Function = function () elseif (#libDirs == 0) then error("No subdirectory was found in the lib directory, have you built the engine yet?") else - libDir = libDirs[1] .. "/" + libDir = path.getname(libDirs[1]) print("No directory was set by the --pack-libdir command, \"" .. libDir .. "\" will be used") end - else - libDir = "../lib/" .. libDir .. "/" end - if (not os.isdir(libDir)) then - error(string.format("\"%s\" doesn't seem to be an existing directory", libDir)) + local realLibDir = "../lib/" .. libDir .. "/" + if (not os.isdir(realLibDir)) then + error(string.format("\"%s\" doesn't seem to be an existing directory", realLibDir)) end local archEnabled = { @@ -31,7 +30,7 @@ ACTION.Function = function () ["x86"] = false } - for k,v in pairs(os.matchdirs(libDir .. "*")) do + for k,v in pairs(os.matchdirs(realLibDir .. "*")) do local arch = path.getname(v) if (archEnabled[arch] ~= nil) then archEnabled[arch] = true @@ -90,10 +89,11 @@ ACTION.Function = function () binFileMasks = {"**.so"} libFileMasks = {"**.a"} end - + + local enabledArchs = {} for arch, enabled in pairs(archEnabled) do if (enabled) then - local archLibSrc = libDir .. arch .. "/" + local archLibSrc = realLibDir .. arch .. "/" local arch3rdPartyBinSrc = "../extlibs/lib/common/" .. arch .. "/" local archBinDst = "bin/" .. arch .. "/" local archLibDst = "lib/" .. arch .. "/" @@ -118,6 +118,8 @@ ACTION.Function = function () Source = arch3rdPartyBinSrc, Target = archBinDst }) + + table.insert(enabledArchs, arch) end end @@ -225,5 +227,6 @@ ACTION.Function = function () end end - print(string.format("Package successfully created at \"%s\" (%u MB, %s)", packageDir, size / (1024 * 1024), libDir)) + local config = libDir .. " - " .. table.concat(enabledArchs, ", ") + print(string.format("Package successfully created at \"%s\" (%u MB, %s)", packageDir, size / (1024 * 1024), config)) end