1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-11-30 11:41:39 +03:00

scripts: Fix minor lint warnings in build-many-glibcs.py

Reviewed-by: Carlos O'Donell <carlos@redhat.com>
This commit is contained in:
Yury Khrustalev
2025-11-12 10:54:41 +00:00
parent 244c404ae8
commit 6a29bbcf5a

View File

@@ -56,9 +56,11 @@ import sys
import time import time
import urllib.request import urllib.request
REQUIRED_TOOLS = {}
# This is a list of system utilities that are expected to be available # This is a list of system utilities that are expected to be available
# to this script, and, if a non-zero version is included, the minimum # to this script, and, if a non-zero version is included, the minimum
# version required to work with this sccript. # version required to work with this script.
def get_list_of_required_tools(): def get_list_of_required_tools():
global REQUIRED_TOOLS global REQUIRED_TOOLS
REQUIRED_TOOLS = { REQUIRED_TOOLS = {
@@ -109,6 +111,9 @@ class Context(object):
def __init__(self, topdir, parallelism, keep, replace_sources, strip, def __init__(self, topdir, parallelism, keep, replace_sources, strip,
full_gcc, action, exclude, shallow=False): full_gcc, action, exclude, shallow=False):
"""Initialize the context.""" """Initialize the context."""
self.bot_config = None
self.build_state = None
self.versions = None
self.topdir = topdir self.topdir = topdir
self.parallelism = parallelism self.parallelism = parallelism
self.keep = keep self.keep = keep
@@ -766,7 +771,7 @@ class Context(object):
'--prefix=%s' % installdir, '--prefix=%s' % installdir,
'--disable-shared'] '--disable-shared']
if extra_opts: if extra_opts:
cfg_cmd.extend (extra_opts) cfg_cmd.extend(extra_opts)
cmdlist.add_command('configure', cfg_cmd) cmdlist.add_command('configure', cfg_cmd)
cmdlist.add_command('build', ['make']) cmdlist.add_command('build', ['make'])
cmdlist.add_command('check', ['make', 'check']) cmdlist.add_command('check', ['make', 'check'])
@@ -1918,7 +1923,7 @@ def get_version_common(progname,line,word,arg1):
v = re.match(r'[0-9]+(.[0-9]+)*', v).group() v = re.match(r'[0-9]+(.[0-9]+)*', v).group()
return [int(x) for x in v.split('.')] return [int(x) for x in v.split('.')]
except: except:
return 'missing'; return 'missing'
def get_version_common_stderr(progname,line,word,arg1): def get_version_common_stderr(progname,line,word,arg1):
try: try:
@@ -1931,16 +1936,16 @@ def get_version_common_stderr(progname,line,word,arg1):
v = re.match(r'[0-9]+(.[0-9]+)*', v).group() v = re.match(r'[0-9]+(.[0-9]+)*', v).group()
return [int(x) for x in v.split('.')] return [int(x) for x in v.split('.')]
except: except:
return 'missing'; return 'missing'
def get_version(progname): def get_version(progname):
return get_version_common(progname, 0, -1, '--version'); return get_version_common(progname, 0, -1, '--version')
def get_version_awk(progname): def get_version_awk(progname):
return get_version_common(progname, 0, 2, '--version'); return get_version_common(progname, 0, 2, '--version')
def get_version_bzip2(progname): def get_version_bzip2(progname):
return get_version_common_stderr(progname, 0, 6, '-h'); return get_version_common_stderr(progname, 0, 6, '-h')
def check_version(ver, req): def check_version(ver, req):
for v, r in zip(ver, req): for v, r in zip(ver, req):
@@ -1951,7 +1956,7 @@ def check_version(ver, req):
return True return True
def version_str(ver): def version_str(ver):
return '.'.join([str (x) for x in ver]) return '.'.join([str(x) for x in ver])
def check_for_required_tools(): def check_for_required_tools():
get_list_of_required_tools() get_list_of_required_tools()
@@ -1963,7 +1968,7 @@ def check_for_required_tools():
if version == 'missing': if version == 'missing':
ok = 'missing' ok = 'missing'
else: else:
ok = 'ok' if check_version (version, v[1]) else 'old' ok = 'ok' if check_version(version, v[1]) else 'old'
if ok == 'old': if ok == 'old':
if count_old_tools == 0: if count_old_tools == 0:
print("One or more required tools are too old:") print("One or more required tools are too old:")
@@ -1978,11 +1983,11 @@ def check_for_required_tools():
version_str(v[1]))) version_str(v[1])))
if count_old_tools > 0 or count_missing_tools > 0: if count_old_tools > 0 or count_missing_tools > 0:
exit (1); exit(1)
def main(argv): def main(argv):
"""The main entry point.""" """The main entry point."""
check_for_required_tools(); check_for_required_tools()
parser = get_parser() parser = get_parser()
opts = parser.parse_args(argv) opts = parser.parse_args(argv)
topdir = os.path.abspath(opts.topdir) topdir = os.path.abspath(opts.topdir)