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
pull/759/head
Boris Nagaev 9 years ago
parent ab0f773a7e
commit a3cdf1dd77

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

Loading…
Cancel
Save