From b5311afb506543565ed9db7f316382199599011a Mon Sep 17 00:00:00 2001 From: Boris Nagaev Date: Fri, 18 Sep 2015 23:07:31 +0300 Subject: build-pkg: check *.a files with nm close #858 see #854 --- tools/build-pkg.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/build-pkg.lua b/tools/build-pkg.lua index fdfa577..0039846 100755 --- a/tools/build-pkg.lua +++ b/tools/build-pkg.lua @@ -288,6 +288,11 @@ local function gitCommit(message) os.execute(cmd:format(message)) end +local function isValidBinary(file) + local cmd = './usr/bin/%s-objdump -t %s > /dev/null 2>&1' + return testCommand(cmd:format(target, file)) +end + local function checkFile(file, pkg) -- if it is PE32 file, it must have '.exe' in name local ext = file:sub(-4):lower() @@ -320,6 +325,14 @@ local function checkFile(file, pkg) if file:match('/lib/.*%.dll$') then log('File %s (%s): DLL in /lib/', file, pkg) end + if file:match('%.dll$') or file:match('%.a$') then + if file:find(target, 1, true) then -- not common + if not isValidBinary(file) then + log('File %s (%s): not recognized library', + file, pkg) + end + end + end end -- builds package, returns list of new files -- cgit v0.12