diff options
author | Boris Nagaev <bnagaev@gmail.com> | 2015-07-06 21:35:48 (GMT) |
---|---|---|
committer | Boris Nagaev <bnagaev@gmail.com> | 2015-07-10 07:32:46 (GMT) |
commit | a3cdf1dd7716761167f3189c86f0b1f4276758bc (patch) | |
tree | a63f180e41c27881e253bca67154bbbc75fec07e | |
parent | ab0f773a7eb1d71332f41c078aa18e26861abc7e (diff) | |
download | mxe-a3cdf1dd7716761167f3189c86f0b1f4276758bc.zip mxe-a3cdf1dd7716761167f3189c86f0b1f4276758bc.tar.gz mxe-a3cdf1dd7716761167f3189c86f0b1f4276758bc.tar.bz2 |
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
-rwxr-xr-x | tools/build-pkg.lua | 18 |
1 files changed, 17 insertions, 1 deletions
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 |