diff options
author | Simon Warta <[email protected]> | 2017-03-07 23:12:33 +0100 |
---|---|---|
committer | Simon Warta <[email protected]> | 2017-03-08 23:33:34 +0100 |
commit | e18493452af4f38f2b2ec614f2a420279e994e7b (patch) | |
tree | 91503d64e224ba08713f6d5bfb5f89dd82793c36 | |
parent | 569e7888fbdd6e8f88110e395fe7778ed5c91086 (diff) |
pylint: use lex return value in OsInfo
-rwxr-xr-x | configure.py | 77 |
1 files changed, 40 insertions, 37 deletions
diff --git a/configure.py b/configure.py index 61c8b8420..8437a707e 100755 --- a/configure.py +++ b/configure.py @@ -1120,64 +1120,67 @@ class CompilerInfo(InfoObject): class OsInfo(InfoObject): def __init__(self, infofile): super(OsInfo, self).__init__(infofile) - lex_me_harder(infofile, self, - ['aliases', 'target_features'], - {'os_type': None, - 'program_suffix': '', - 'obj_suffix': 'o', - 'soname_suffix': '', - 'soname_pattern_patch': '', - 'soname_pattern_abi': '', - 'soname_pattern_base': '', - 'static_suffix': 'a', - 'ar_command': 'ar crs', - 'ar_needs_ranlib': False, - 'install_root': '/usr/local', - 'header_dir': 'include', - 'bin_dir': 'bin', - 'lib_dir': 'lib', - 'doc_dir': 'share/doc', - 'building_shared_supported': 'yes', - 'install_cmd_data': 'install -m 644', - 'install_cmd_exec': 'install -m 755' - }) + self.lex = lex_me_harder( + infofile, + None, + ['aliases', 'target_features'], + { + 'os_type': None, + 'program_suffix': '', + 'obj_suffix': 'o', + 'soname_suffix': '', + 'soname_pattern_patch': '', + 'soname_pattern_abi': '', + 'soname_pattern_base': '', + 'static_suffix': 'a', + 'ar_command': 'ar crs', + 'ar_needs_ranlib': False, + 'install_root': '/usr/local', + 'header_dir': 'include', + 'bin_dir': 'bin', + 'lib_dir': 'lib', + 'doc_dir': 'share/doc', + 'building_shared_supported': 'yes', + 'install_cmd_data': 'install -m 644', + 'install_cmd_exec': 'install -m 755' + }) - if self.soname_pattern_base != '': - if self.soname_pattern_patch == '' and self.soname_pattern_abi == '': - self.soname_pattern_patch = self.soname_pattern_base - self.soname_pattern_patch_abi = self.soname_pattern_base + if self.lex.soname_pattern_base != '': + if self.lex.soname_pattern_patch == '' and self.lex.soname_pattern_abi == '': + self.lex.soname_pattern_patch = self.lex.soname_pattern_base + self.lex.soname_pattern_patch_abi = self.lex.soname_pattern_base - elif self.soname_pattern_abi != '' and self.soname_pattern_abi != '': + elif self.lex.soname_pattern_abi != '' and self.lex.soname_pattern_abi != '': pass # all 3 values set, nothing needs to happen here else: # base set, only one of patch/abi set raise ConfigureError("Invalid soname_patterns in %s" % (self.infofile)) - if self.soname_pattern_base == '' and self.soname_suffix != '': - self.soname_pattern_base = "libbotan-{version_major}.%s" % (self.soname_suffix) - self.soname_pattern_abi = self.soname_pattern_base + ".{abi_rev}" - self.soname_pattern_patch = self.soname_pattern_abi + ".{version_minor}.{version_patch}" + if self.lex.soname_pattern_base == '' and self.lex.soname_suffix != '': + self.lex.soname_pattern_base = "libbotan-{version_major}.%s" % (self.lex.soname_suffix) + self.lex.soname_pattern_abi = self.lex.soname_pattern_base + ".{abi_rev}" + self.lex.soname_pattern_patch = self.lex.soname_pattern_abi + ".{version_minor}.{version_patch}" - self.ar_needs_ranlib = bool(self.ar_needs_ranlib) + self.lex.ar_needs_ranlib = bool(self.lex.ar_needs_ranlib) - self.building_shared_supported = (True if self.building_shared_supported == 'yes' else False) + self.lex.building_shared_supported = (True if self.lex.building_shared_supported == 'yes' else False) def ranlib_command(self): - return 'ranlib' if self.ar_needs_ranlib else 'true' + return 'ranlib' if self.lex.ar_needs_ranlib else 'true' def defines(self, options): r = [] r += ['TARGET_OS_IS_%s' % (self.basename.upper())] - if self.os_type != None: - r += ['TARGET_OS_TYPE_IS_%s' % (self.os_type.upper())] + if self.lex.os_type != None: + r += ['TARGET_OS_TYPE_IS_%s' % (self.lex.os_type.upper())] def feat_macros(): - for feat in self.target_features: + for feat in self.lex.target_features: if feat not in options.without_os_features: yield 'TARGET_OS_HAS_' + feat.upper() for feat in options.with_os_features: - if feat not in self.target_features: + if feat not in self.lex.target_features: yield 'TARGET_OS_HAS_' + feat.upper() r += sorted(feat_macros()) |