From a3cdf1dd7716761167f3189c86f0b1f4276758bc Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Tue, 7 Jul 2015 00:35:48 +0300 Subject: build-pkg: blacklist some file paths * usr/share/ (doc, gcc-5.1.0, info, man) * usr/installed/check-requirements There are documentation and other shared files installed, which we don't need [1]. This commit doesn't cover all doc files. More files can be found by "find usr -name doc". Some packages install files to same paths. There is a list of all packages which overlap and shared files [2]. [1] https://lists.nongnu.org/archive/html/mingw-cross-env-list/2015-06/msg00011.html [2] https://gist.github.com/starius/59625347cd68a21d9cc9 --- tools/build-pkg.lua | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/tools/build-pkg.lua b/tools/build-pkg.lua index 935985f..bb8575c 100755 --- a/tools/build-pkg.lua +++ b/tools/build-pkg.lua @@ -15,6 +15,11 @@ local max_packages = tonumber(os.getenv('MXE_MAX_PACKAGES')) local MXE_DIR = '/usr/lib/mxe' +local BLACKLIST = { + '^usr/installed/check-requirements$', + '^usr/share/', +} + local target -- used by many functions -- based on http://lua-users.org/wiki/SplitJoin @@ -126,13 +131,24 @@ local function sortForBuild(pkgs, pkg2deps) return build_list end +local function isBlacklisted(file) + for _, pattern in ipairs(BLACKLIST) do + if file:match(pattern) then + return true + end + end + return false +end + -- return set of all filepaths under ./usr/ local function findFiles() local files = {} local find = io.popen('find usr -type f -or -type l', 'r') for line in find:lines() do local file = trim(line) - files[file] = true + if not isBlacklisted(file) then + files[file] = true + end end find:close() return files -- cgit v0.12