Merge pull request #698 from cshore/pull-request-fix-lib-depends
luci-base: utils: Make checklib return a boolean
This commit is contained in:
commit
cae7d7a301
1 changed files with 4 additions and 4 deletions
|
@ -640,18 +640,18 @@ function checklib(fullpathexe, wantedlib)
|
||||||
local fs = require "nixio.fs"
|
local fs = require "nixio.fs"
|
||||||
local haveldd = fs.access('/usr/bin/ldd')
|
local haveldd = fs.access('/usr/bin/ldd')
|
||||||
if not haveldd then
|
if not haveldd then
|
||||||
return -1
|
return false
|
||||||
end
|
end
|
||||||
local libs = exec("/usr/bin/ldd " .. fullpathexe)
|
local libs = exec("/usr/bin/ldd " .. fullpathexe)
|
||||||
if not libs then
|
if not libs then
|
||||||
return 0
|
return false
|
||||||
end
|
end
|
||||||
for k, v in ipairs(split(libs)) do
|
for k, v in ipairs(split(libs)) do
|
||||||
if v:find(wantedlib) then
|
if v:find(wantedlib) then
|
||||||
return 1
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return 0
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|
Loading…
Reference in a new issue