[csw-devel] SF.net SVN: gar:[19798] csw/mgar/gar/v2-yann/lib/python/inspective_package. py
chninkel at users.sourceforge.net
chninkel at users.sourceforge.net
Sat Dec 1 17:04:46 CET 2012
Revision: 19798
http://gar.svn.sourceforge.net/gar/?rev=19798&view=rev
Author: chninkel
Date: 2012-12-01 16:04:46 +0000 (Sat, 01 Dec 2012)
Log Message:
-----------
gar/v2-yann: handle unsorted version needed section
Modified Paths:
--------------
csw/mgar/gar/v2-yann/lib/python/inspective_package.py
Modified: csw/mgar/gar/v2-yann/lib/python/inspective_package.py
===================================================================
--- csw/mgar/gar/v2-yann/lib/python/inspective_package.py 2012-12-01 10:13:43 UTC (rev 19797)
+++ csw/mgar/gar/v2-yann/lib/python/inspective_package.py 2012-12-01 16:04:46 UTC (rev 19798)
@@ -287,6 +287,7 @@
else:
binary_info[cur_section].append(elf_info)
+
# elfdump doesn't repeat the name of the soname in the version section
# if it's the same on two contiguous line, so we have to make sure
# the information is present in each entry
@@ -294,11 +295,19 @@
if not version['soname']:
version['soname'] = binary_info['version needed'][i]['soname']
+ # soname version needed are usually displayed sorted by index ...
+ # but that's not always the case :( so we have to reorder
+ # the list by index
+ binary_info['version needed'].sort(key = lambda m: m['index'])
+ for version in binary_info['version needed']:
+ del version['index']
+
# if it exists, the first "version definition" entry is the base soname
# we don't need this information
if binary_info['version definition']:
binary_info['version definition'].pop(0)
+
binary_info['symbol table'] = symbols.values()
binary_info['symbol table'].sort(key=lambda m: m['symbol'])
# To not rely of the section order output of elfdump, we resolve
@@ -386,8 +395,8 @@
(?P<section>Version\sNeeded|Symbol\sTable # Section header
|Version\sDefinition|Syminfo)
\sSection:
- \s+(?:\.SUNW_version|\.dynsym
- |\.SUNW_syminfo|.symtab)\s*$
+ \s+(?:\.SUNW_version|\.gnu\.version_[rd]
+ |\.dynsym|\.SUNW_syminfo|.symtab)\s*$
|\s*(?:index\s+)?version\s+dependency\s*$ # Version needed header
@@ -411,7 +420,7 @@
(?:\s+\[\s(?:BASE)\s\])?\s*$
"""),
'version needed': (r"""
- \s*(?:\[\d+\]\s+)? # index: might be not present if
+ \s*(?:\[(?P<index>\d+)\]\s+)? # index: might be not present if
# no version binding is enabled
(?:(?P<soname>\S+)\s+ # file: can be absent if the same as
(?!\[\s(?:INFO|WEAK)\s\]))? # the previous line,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the devel
mailing list