Run c++filt only once for all undefined non-weak symbols in a file.

git-svn-id: svn+ssh://rpmlint.zarb.org/home/projects/rpmlint/svn/trunk@1851 9bc8b190-ac0f-0410-8968-dc7d1f502856
This commit is contained in:
Ville Skyttä 2011-04-14 20:30:29 +00:00
parent fe8dd39588
commit b1dc5fc179
1 changed files with 9 additions and 6 deletions

View File

@ -139,6 +139,15 @@ class BinaryInfo:
undef = BinaryInfo.undef_regex.search(l)
if undef:
self.undef.append(undef.group(1))
if self.undef:
cmd = self.undef[:]
cmd.insert(0, 'c++filt')
try:
res = Pkg.getstatusoutput(cmd)
if not res[0]:
self.undef = res[1].splitlines()
except:
pass
else:
printWarning(pkg, 'ldd-failed', file)
res = Pkg.getstatusoutput(
@ -310,12 +319,6 @@ class BinariesCheck(AbstractCheck.AbstractCheck):
# libs only, but that has potential to generate lots of
# false positives and noise.
for s in bin_info.undef:
try:
(sts, out) = Pkg.getstatusoutput(('c++filt', s))
if not sts:
s = out
except:
pass
printWarning(pkg, 'undefined-non-weak-symbol', fname, s)
for s in bin_info.unused:
printWarning(pkg, 'unused-direct-shlib-dependency',