Package portage :: Package util :: Module lafilefixer
[hide private]

Module lafilefixer

source code

Functions [hide private]
 
_parse_lafile_contents(contents)
Parses 'dependency_libs' and 'inherited_linker_flags' lines.
source code
tuple
rewrite_lafile(contents)
Given the contents of an .la file, parse and fix it.
source code
Variables [hide private]
  dep_libs_re = re.compile(r'dependency_libs=\'(?P<value>[^\']*)...
  inh_link_flags_re = re.compile(r'inherited_linker_flags=\'(?P<...
  X11_local_sub = re.compile(r'X11R6/lib|local/lib')
  pkgconfig_sub1 = re.compile(r'usr/lib[^/]*/pkgconfig/\.\./\.\.')
  pkgconfig_sub2 = re.compile(r'(?P<usrlib>usr/lib[^/]*)/pkgconf...
  flag_re = re.compile(r'-mt|mthreads|kthread|Kthread|pthread|pt...
  __package__ = 'portage.util'

Imports: _os, re, _unicode_decode, InvalidData


Function Details [hide private]

rewrite_lafile(contents)

source code 

Given the contents of an .la file, parse and fix it. This operates with strings of raw bytes (assumed to contain some ascii characters), in order to avoid any potential character encoding issues. Raises 'InvalidData' if the .la file is invalid.

Parameters:
  • contents (bytes) - the contents of a libtool archive file
Returns: tuple
(True, fixed_contents) if something needed to be fixed, (False, None) otherwise.

Variables Details [hide private]

dep_libs_re

Value:
re.compile(r'dependency_libs=\'(?P<value>[^\']*)\'$')

inh_link_flags_re

Value:
re.compile(r'inherited_linker_flags=\'(?P<value>[^\']*)\'$')

pkgconfig_sub2

Value:
re.compile(r'(?P<usrlib>usr/lib[^/]*)/pkgconfig/\.\.')

flag_re

Value:
re.compile(r'-mt|mthreads|kthread|Kthread|pthread|pthreads|-thread-saf\
e|threads')