[csw-maintainers] Taking symbols into account when checking binaries

Maciej (Matchek) Blizinski maciej at opencsw.org
Mon Feb 22 13:06:56 CET 2010


Sebastian, when you have time, I'd like to get you involved in writing
new checks.  We've talked about the checks with missing symbols
reported by ldd -r.  Here's the current code which extracts the data:

https://sourceforge.net/apps/trac/gar/browser/csw/mgar/gar/v2/lib/python/checkpkg.py#L961

You can add a new method, similar to this one.  Look at binary_abspath
bit, it shows how to access the unpacked binary on the disk.   All the
method needs to return, is a data structure.  Right now, it's just a
list of lines from ldd -r output.  Look at existing saved data
structures:

ls ~/.checkpkg/stats/*/*/ldd_dash_r.yml

It's a dict of lists:

{'foo.so': ['line1', 'line2']}

here, you would do something similar

{'foo.so': ['symbol1', 'symbol2', ...]}

You can copy the GetLddMinusRlines() method to a new name
(GetSymbols?) and modify it.  Then you can add one line to
CollectStats(), something along the lines of:

self.DumpObject(self.GetSymbols(), "symbols")

Once this is done, you can go to
https://sourceforge.net/apps/trac/gar/browser/csw/mgar/gar/v2/lib/python/package_checks.py
and use pkg_data["symbols"].

Maciej


More information about the maintainers mailing list