Lines Matching refs:self
63 def __init__(self, args, returncode, stdout=None, stderr=None): argument
64 self.args = args
65 self.returncode = returncode
66 self.stdout = stdout
67 self.stderr = stderr
89 def __init__(self, topdir, parallelism, keep, replace_sources, strip, argument
92 self.topdir = topdir
93 self.parallelism = parallelism
94 self.keep = keep
95 self.replace_sources = replace_sources
96 self.strip = strip
97 self.full_gcc = full_gcc
98 self.shallow = shallow
99 self.srcdir = os.path.join(topdir, 'src')
100 self.versions_json = os.path.join(self.srcdir, 'versions.json')
101 self.build_state_json = os.path.join(topdir, 'build-state.json')
102 self.bot_config_json = os.path.join(topdir, 'bot-config.json')
103 self.installdir = os.path.join(topdir, 'install')
104 self.host_libraries_installdir = os.path.join(self.installdir,
106 self.builddir = os.path.join(topdir, 'build')
107 self.logsdir = os.path.join(topdir, 'logs')
108 self.logsdir_old = os.path.join(topdir, 'logs-old')
109 self.makefile = os.path.join(self.builddir, 'Makefile')
110 self.wrapper = os.path.join(self.builddir, 'wrapper')
111 self.save_logs = os.path.join(self.builddir, 'save-logs')
112 self.script_text = self.get_script_text()
114 self.build_triplet = self.get_build_triplet()
115 self.glibc_version = self.get_glibc_version()
116 self.configs = {}
117 self.glibc_configs = {}
118 self.makefile_pieces = ['.PHONY: all\n']
119 self.add_all_configs()
120 self.load_versions_json()
121 self.load_build_state_json()
122 self.status_log_list = []
123 self.email_warning = False
125 def get_script_text(self): argument
130 def exec_self(self): argument
135 def get_build_triplet(self): argument
137 config_guess = os.path.join(self.component_srcdir('gcc'),
143 def get_glibc_version(self): argument
145 version_h = os.path.join(self.component_srcdir('glibc'), 'version.h')
158 def add_all_configs(self): argument
160 self.add_config(arch='aarch64',
164 self.add_config(arch='aarch64_be',
166 self.add_config(arch='arc',
169 self.add_config(arch='arc',
172 self.add_config(arch='arceb',
175 self.add_config(arch='alpha',
177 self.add_config(arch='arm',
181 self.add_config(arch='armeb',
183 self.add_config(arch='armeb',
187 self.add_config(arch='arm',
198 self.add_config(arch='armeb',
201 self.add_config(arch='armeb',
206 self.add_config(arch='csky',
210 self.add_config(arch='csky',
213 self.add_config(arch='hppa',
215 self.add_config(arch='i686',
217 self.add_config(arch='ia64',
221 self.add_config(arch='m68k',
224 self.add_config(arch='m68k',
228 self.add_config(arch='m68k',
233 self.add_config(arch='microblaze',
236 self.add_config(arch='microblazeel',
239 self.add_config(arch='mips64',
247 self.add_config(arch='mips64',
257 self.add_config(arch='mips64',
269 self.add_config(arch='mips64',
282 self.add_config(arch='mips64el',
290 self.add_config(arch='mips64el',
300 self.add_config(arch='mips64el',
312 self.add_config(arch='mips64el',
325 self.add_config(arch='mipsisa64r6el',
336 self.add_config(arch='nios2',
338 self.add_config(arch='powerpc',
344 self.add_config(arch='powerpc',
349 self.add_config(arch='powerpc64',
352 self.add_config(arch='powerpc64le',
357 self.add_config(arch='riscv32',
362 self.add_config(arch='riscv32',
367 self.add_config(arch='riscv32',
372 self.add_config(arch='riscv64',
377 self.add_config(arch='riscv64',
382 self.add_config(arch='riscv64',
387 self.add_config(arch='s390x',
393 self.add_config(arch='sh3',
395 self.add_config(arch='sh3eb',
397 self.add_config(arch='sh4',
399 self.add_config(arch='sh4eb',
401 self.add_config(arch='sh4',
405 self.add_config(arch='sh4eb',
409 self.add_config(arch='sparc64',
423 self.add_config(arch='x86_64',
459 def add_config(self, **args): argument
461 cfg = Config(self, **args)
462 if cfg.name in self.configs:
465 self.configs[cfg.name] = cfg
467 if c.name in self.glibc_configs:
470 self.glibc_configs[c.name] = c
472 def component_srcdir(self, component): argument
474 return os.path.join(self.srcdir, component)
476 def component_builddir(self, action, config, component, subconfig=None): argument
481 return os.path.join(self.builddir, action, component)
483 return os.path.join(self.builddir, action, config, component)
486 return os.path.join(self.builddir, action, config, component,
489 def compiler_installdir(self, config): argument
491 return os.path.join(self.installdir, 'compilers', config)
493 def compiler_bindir(self, config): argument
495 return os.path.join(self.compiler_installdir(config), 'bin')
497 def compiler_sysroot(self, config): argument
499 return os.path.join(self.compiler_installdir(config), 'sysroot')
501 def glibc_installdir(self, config): argument
503 return os.path.join(self.installdir, 'glibcs', config)
505 def run_builds(self, action, configs): argument
508 self.checkout(configs)
514 self.bot_cycle()
520 self.bot()
527 for name in sorted(self.configs.keys()):
531 for config in sorted(self.glibc_configs.values(),
535 self.clear_last_build_state(action)
541 self.build_host_libraries()
546 old_versions = self.build_state['host-libraries']['build-versions']
547 self.build_compilers(configs)
552 old_versions = self.build_state['compilers']['build-versions']
554 self.update_syscalls(configs)
556 self.build_glibcs(configs)
557 self.write_files()
558 self.do_build()
564 if k in self.versions:
565 build_versions[k] = {'version': self.versions[k]['version'],
566 'revision': self.versions[k]['revision']}
571 self.update_build_state(action, build_time, build_versions)
586 def add_makefile_cmdlist(self, target, cmdlist, logsdir): argument
588 commands = cmdlist.makefile_commands(self.wrapper, logsdir)
589 self.makefile_pieces.append('all: %s\n.PHONY: %s\n%s:\n%s\n' %
591 self.status_log_list.extend(cmdlist.status_logs(logsdir))
593 def write_files(self): argument
595 mftext = ''.join(self.makefile_pieces)
596 with open(self.makefile, 'w') as f:
655 with open(self.wrapper, 'w') as f:
660 os.chmod(self.wrapper, mode_exec)
683 with open(self.save_logs, 'w') as f:
685 os.chmod(self.save_logs, mode_exec)
687 def do_build(self): argument
689 cmd = ['make', '-O', '-j%d' % self.parallelism]
690 subprocess.run(cmd, cwd=self.builddir, check=True)
692 def build_host_libraries(self): argument
694 installdir = self.host_libraries_installdir
695 builddir = os.path.join(self.builddir, 'host-libraries')
696 logsdir = os.path.join(self.logsdir, 'host-libraries')
697 self.remove_recreate_dirs(installdir, builddir, logsdir)
698 cmdlist = CommandList('host-libraries', self.keep)
699 self.build_host_library(cmdlist, 'gmp')
700 self.build_host_library(cmdlist, 'mpfr',
702 self.build_host_library(cmdlist, 'mpc',
706 self.add_makefile_cmdlist('host-libraries', cmdlist, logsdir)
708 def build_host_library(self, cmdlist, lib, extra_opts=None): argument
710 srcdir = self.component_srcdir(lib)
711 builddir = self.component_builddir('host-libraries', None, lib)
712 installdir = self.host_libraries_installdir
727 def build_compilers(self, configs): argument
730 self.remove_dirs(os.path.join(self.builddir, 'compilers'))
731 self.remove_dirs(os.path.join(self.installdir, 'compilers'))
732 self.remove_dirs(os.path.join(self.logsdir, 'compilers'))
733 configs = sorted(self.configs.keys())
735 self.configs[c].build()
737 def build_glibcs(self, configs): argument
740 self.remove_dirs(os.path.join(self.builddir, 'glibcs'))
741 self.remove_dirs(os.path.join(self.installdir, 'glibcs'))
742 self.remove_dirs(os.path.join(self.logsdir, 'glibcs'))
743 configs = sorted(self.glibc_configs.keys())
745 self.glibc_configs[c].build()
747 def update_syscalls(self, configs): argument
750 self.remove_dirs(os.path.join(self.builddir, 'update-syscalls'))
751 self.remove_dirs(os.path.join(self.logsdir, 'update-syscalls'))
752 configs = sorted(self.glibc_configs.keys())
754 self.glibc_configs[c].update_syscalls()
756 def load_versions_json(self): argument
758 if not os.access(self.versions_json, os.F_OK):
759 self.versions = {}
761 with open(self.versions_json, 'r') as f:
762 self.versions = json.load(f)
764 def store_json(self, data, filename): argument
771 def store_versions_json(self): argument
773 self.store_json(self.versions, self.versions_json)
775 def set_component_version(self, component, version, explicit, revision): argument
777 self.versions[component] = {'version': version,
780 self.store_versions_json()
782 def checkout(self, versions): argument
814 if k in self.versions and self.versions[k]['explicit']:
815 use_versions[k] = self.versions[k]['version']
820 os.makedirs(self.srcdir, exist_ok=True)
822 update = os.access(self.component_srcdir(k), os.F_OK)
825 k in self.versions and
826 v != self.versions[k]['version']):
827 if not self.replace_sources:
830 (k, self.versions[k]['version'], v))
832 shutil.rmtree(self.component_srcdir(k))
835 revision = self.checkout_vcs(k, v[4:], update)
837 self.checkout_tar(k, v, update)
839 self.set_component_version(k, v, explicit_versions[k], revision)
840 if self.get_script_text() != self.script_text:
843 self.exec_self()
845 def checkout_vcs(self, component, version, update): argument
855 return self.git_checkout(component, git_url, git_branch, update)
861 return self.gcc_checkout(branch, update)
868 r = self.git_checkout(component, git_url, git_branch, update)
869 self.fix_glibc_timestamps()
874 r = self.git_checkout(component, git_url, git_branch, update)
876 cwd=self.component_srcdir(component), check=True)
881 r = self.git_checkout(component, git_url, git_branch, update)
883 cwd=self.component_srcdir(component), check=True)
888 r = self.git_checkout(component, git_url, git_branch, update)
890 cwd=self.component_srcdir(component), check=True)
896 def git_checkout(self, component, git_url, git_branch, update): argument
900 cwd=self.component_srcdir(component), check=True)
901 if self.replace_sources:
903 cwd=self.component_srcdir(component), check=True)
905 cwd=self.component_srcdir(component), check=True)
907 if self.shallow:
913 self.component_srcdir(component)], check=True)
915 cwd=self.component_srcdir(component),
920 def fix_glibc_timestamps(self): argument
924 srcdir = self.component_srcdir('glibc')
941 def gcc_checkout(self, branch, update): argument
943 if os.access(os.path.join(self.component_srcdir('gcc'), '.svn'),
945 if not self.replace_sources:
949 shutil.rmtree(self.component_srcdir('gcc'))
952 self.git_checkout('gcc', 'git://gcc.gnu.org/git/gcc.git',
955 cwd=self.component_srcdir('gcc'), check=True)
957 cwd=self.component_srcdir('gcc'),
962 def checkout_tar(self, component, version, update): argument
981 filename = os.path.join(self.srcdir, url.split('/')[-1])
986 subprocess.run(['tar', '-C', self.srcdir, '-x', '-f', filename],
988 os.rename(os.path.join(self.srcdir, '%s-%s' % (component, version)),
989 self.component_srcdir(component))
992 def load_build_state_json(self): argument
994 if os.access(self.build_state_json, os.F_OK):
995 with open(self.build_state_json, 'r') as f:
996 self.build_state = json.load(f)
998 self.build_state = {}
1000 if k not in self.build_state:
1001 self.build_state[k] = {}
1002 if 'build-time' not in self.build_state[k]:
1003 self.build_state[k]['build-time'] = ''
1004 if 'build-versions' not in self.build_state[k]:
1005 self.build_state[k]['build-versions'] = {}
1006 if 'build-results' not in self.build_state[k]:
1007 self.build_state[k]['build-results'] = {}
1008 if 'result-changes' not in self.build_state[k]:
1009 self.build_state[k]['result-changes'] = {}
1010 if 'ever-passed' not in self.build_state[k]:
1011 self.build_state[k]['ever-passed'] = []
1013 def store_build_state_json(self): argument
1015 self.store_json(self.build_state, self.build_state_json)
1017 def clear_last_build_state(self, action): argument
1023 self.build_state[action]['build-time'] = ''
1024 self.build_state[action]['build-versions'] = {}
1025 self.store_build_state_json()
1027 def update_build_state(self, action, build_time, build_versions): argument
1030 self.build_state[action]['build-time'] = str(build_time)
1031 self.build_state[action]['build-versions'] = build_versions
1033 for log in self.status_log_list:
1042 old_build_results = self.build_state[action]['build-results']
1043 self.build_state[action]['build-results'] = build_results
1057 self.build_state[action]['result-changes'] = result_changes
1058 old_ever_passed = {t for t in self.build_state[action]['ever-passed']
1061 self.build_state[action]['ever-passed'] = sorted(old_ever_passed |
1063 self.store_build_state_json()
1065 def load_bot_config_json(self): argument
1067 with open(self.bot_config_json, 'r') as f:
1068 self.bot_config = json.load(f)
1070 def part_build_old(self, action, delay): argument
1073 old_time_str = self.build_state[action]['build-time']
1082 def bot_cycle(self): argument
1085 self.load_bot_config_json()
1087 self.bot_run_self(['--replace-sources'], 'checkout')
1088 self.load_versions_json()
1089 if self.get_script_text() != self.script_text:
1093 self.clear_last_build_state(a)
1094 self.exec_self()
1101 build_vers = self.build_state[a]['build-versions']
1103 if not self.build_state[a]['build-time']:
1110 new_vers[c] = {'version': self.versions[c]['version'],
1111 'revision': self.versions[c]['revision']}
1116 if a == 'compilers' and not self.part_build_old(
1117 a, self.bot_config['compilers-rebuild-delay']):
1128 self.clear_last_build_state(a)
1131 if os.access(self.logsdir, os.F_OK):
1132 shutil.rmtree(self.logsdir_old, ignore_errors=True)
1133 shutil.copytree(self.logsdir, self.logsdir_old)
1138 self.bot_run_self([], a)
1139 self.load_build_state_json()
1140 self.bot_build_mail(a, build_time)
1143 def bot_build_mail(self, action, build_time): argument
1145 if not ('email-from' in self.bot_config and
1146 'email-server' in self.bot_config and
1147 'email-subject' in self.bot_config and
1148 'email-to' in self.bot_config):
1149 if not self.email_warning:
1151 self.email_warning = True
1155 subject = (self.bot_config['email-subject'] %
1158 results = self.build_state[action]['build-results']
1159 changes = self.build_state[action]['result-changes']
1160 ever_passed = set(self.build_state[action]['ever-passed'])
1161 versions = self.build_state[action]['build-versions']
1203 msg['From'] = self.bot_config['email-from']
1204 msg['To'] = self.bot_config['email-to']
1207 with smtplib.SMTP(self.bot_config['email-server']) as s:
1210 def bot_run_self(self, opts, action, check=True): argument
1213 '-j%d' % self.parallelism]
1214 if self.full_gcc:
1217 cmd.extend([self.topdir, action])
1221 def bot(self): argument
1224 self.load_bot_config_json()
1225 if not self.bot_config['run']:
1228 self.bot_run_self([], 'bot-cycle', check=False)
1229 self.load_bot_config_json()
1230 if not self.bot_config['run']:
1233 time.sleep(self.bot_config['delay'])
1234 if self.get_script_text() != self.script_text:
1236 self.exec_self()
1241 def __init__(self, config): argument
1242 self.arch = config.arch
1243 self.srcdir = config.ctx.component_srcdir('linux')
1244 self.builddir = config.component_builddir('linux')
1245 self.headers_dir = os.path.join(config.sysroot, 'usr')
1250 def __init__(self, glibc, headers_dir): argument
1251 self.arch = glibc.compiler.arch
1252 self.srcdir = glibc.compiler.ctx.component_srcdir('linux')
1253 self.builddir = glibc.ctx.component_builddir(
1255 self.headers_dir = headers_dir
1300 def __init__(self, ctx, arch, os_name, variant=None, gcc_cfg=None, argument
1304 self.ctx = ctx
1305 self.arch = arch
1306 self.os = os_name
1307 self.variant = variant
1309 self.name = '%s-%s' % (arch, os_name)
1311 self.name = '%s-%s-%s' % (arch, os_name, variant)
1312 self.triplet = '%s-glibc-%s' % (arch, os_name)
1314 self.gcc_cfg = []
1316 self.gcc_cfg = gcc_cfg
1318 self.first_gcc_cfg = []
1320 self.first_gcc_cfg = first_gcc_cfg
1322 self.binutils_cfg = []
1324 self.binutils_cfg = binutils_cfg
1329 glibcs = [Glibc(self, **g) for g in glibcs]
1330 extra_glibcs = [Glibc(self, **g) for g in extra_glibcs]
1331 self.all_glibcs = glibcs + extra_glibcs
1332 self.compiler_glibcs = glibcs
1333 self.installdir = ctx.compiler_installdir(self.name)
1334 self.bindir = ctx.compiler_bindir(self.name)
1335 self.sysroot = ctx.compiler_sysroot(self.name)
1336 self.builddir = os.path.join(ctx.builddir, 'compilers', self.name)
1337 self.logsdir = os.path.join(ctx.logsdir, 'compilers', self.name)
1339 def component_builddir(self, component): argument
1341 return self.ctx.component_builddir('compilers', self.name, component)
1343 def build(self): argument
1345 self.ctx.remove_recreate_dirs(self.installdir, self.builddir,
1346 self.logsdir)
1347 cmdlist = CommandList('compilers-%s' % self.name, self.ctx.keep)
1350 os.path.join(self.ctx.host_libraries_installdir,
1352 cmdlist.use_path(self.bindir)
1353 self.build_cross_tool(cmdlist, 'binutils', 'binutils',
1358 '--disable-sim'] + self.binutils_cfg)
1359 if self.os.startswith('linux'):
1360 install_linux_headers(LinuxHeadersPolicyForBuild(self), cmdlist)
1361 self.build_gcc(cmdlist, True)
1362 if self.os == 'gnu':
1363 self.install_gnumach_headers(cmdlist)
1364 self.build_cross_tool(cmdlist, 'mig', 'mig')
1365 self.install_hurd_headers(cmdlist)
1366 for g in self.compiler_glibcs:
1372 self.build_gcc(cmdlist, False)
1374 os.path.join(self.installdir, 'ok')])
1375 self.ctx.add_makefile_cmdlist('compilers-%s' % self.name, cmdlist,
1376 self.logsdir)
1378 def build_cross_tool(self, cmdlist, tool_src, tool_build, extra_opts=None): argument
1380 srcdir = self.ctx.component_srcdir(tool_src)
1381 builddir = self.component_builddir(tool_build)
1385 '--prefix=%s' % self.installdir,
1386 '--build=%s' % self.ctx.build_triplet,
1387 '--host=%s' % self.ctx.build_triplet,
1388 '--target=%s' % self.triplet,
1389 '--with-sysroot=%s' % self.sysroot]
1408 def install_gnumach_headers(self, cmdlist): argument
1410 srcdir = self.ctx.component_srcdir('gnumach')
1411 builddir = self.component_builddir('gnumach')
1416 '--build=%s' % self.ctx.build_triplet,
1417 '--host=%s' % self.triplet,
1419 'CC=%s-gcc -nostdlib' % self.triplet])
1420 cmdlist.add_command('install', ['make', 'DESTDIR=%s' % self.sysroot,
1425 def install_hurd_headers(self, cmdlist): argument
1427 srcdir = self.ctx.component_srcdir('hurd')
1428 builddir = self.component_builddir('hurd')
1433 '--build=%s' % self.ctx.build_triplet,
1434 '--host=%s' % self.triplet,
1437 'CC=%s-gcc -nostdlib' % self.triplet])
1438 cmdlist.add_command('install', ['make', 'prefix=%s' % self.sysroot,
1443 def build_gcc(self, cmdlist, bootstrap): argument
1452 cfg_opts = list(self.gcc_cfg)
1455 host_libs = self.ctx.host_libraries_installdir
1479 '--with-glibc-version=%s' % self.ctx.glibc_version
1481 cfg_opts += self.first_gcc_cfg
1488 if not self.ctx.full_gcc:
1491 langs = 'all' if self.ctx.full_gcc else 'c,c++'
1494 self.build_cross_tool(cmdlist, 'gcc', tool_build, cfg_opts)
1499 def __init__(self, glibc): argument
1500 self.srcdir = glibc.ctx.component_srcdir('glibc')
1501 self.use_usr = glibc.os != 'gnu'
1502 self.prefix = '/usr' if self.use_usr else ''
1503 self.configure_args = [
1504 '--prefix=%s' % self.prefix,
1521 self.configure_args.append('MIG=%s' % glibc.tool_name('mig'))
1523 self.configure_args.append('CFLAGS=%s' % glibc.cflags)
1524 self.configure_args.append('CXXFLAGS=%s' % glibc.cflags)
1525 self.configure_args += glibc.cfg
1527 def configure(self, cmdlist): argument
1530 [os.path.join(self.srcdir, 'configure'),
1531 *self.configure_args])
1533 def extra_commands(self, cmdlist): argument
1540 def __init__(self, glibc): argument
1542 self.builddir = glibc.ctx.component_builddir(
1544 self.installdir = glibc.compiler.sysroot
1549 def __init__(self, glibc): argument
1551 self.builddir = glibc.ctx.component_builddir(
1553 self.installdir = glibc.ctx.glibc_installdir(glibc.name)
1555 self.strip = glibc.tool_name('strip')
1557 self.strip = None
1558 self.save_logs = glibc.ctx.save_logs
1560 def extra_commands(self, cmdlist): argument
1561 if self.strip:
1564 find_command = 'find %s/lib* -name "*.so*"' % self.installdir
1568 'done' % (find_command, self.strip))])
1570 cmdlist.add_command('save-logs', [self.save_logs], always_run=True)
1575 def __init__(self, glibc): argument
1577 self.builddir = glibc.ctx.component_builddir(
1579 self.linuxdir = glibc.ctx.component_builddir(
1581 self.linux_policy = LinuxHeadersPolicyForUpdateSyscalls(
1582 glibc, self.linuxdir)
1583 self.configure_args.insert(
1584 0, '--with-headers=%s' % os.path.join(self.linuxdir, 'include'))
1590 def __init__(self, compiler, arch=None, os_name=None, variant=None, argument
1593 self.ctx = compiler.ctx
1594 self.compiler = compiler
1596 self.arch = compiler.arch
1598 self.arch = arch
1600 self.os = compiler.os
1602 self.os = os_name
1603 self.variant = variant
1605 self.name = '%s-%s' % (self.arch, self.os)
1607 self.name = '%s-%s-%s' % (self.arch, self.os, variant)
1608 self.triplet = '%s-glibc-%s' % (self.arch, self.os)
1610 self.cfg = []
1612 self.cfg = cfg
1614 self.ccopts = ccopts
1617 self.cflags = cflags
1619 def tool_name(self, tool): argument
1621 ctool = '%s-%s' % (self.compiler.triplet, tool)
1622 if self.ccopts and (tool == 'gcc' or tool == 'g++'):
1623 ctool = '%s %s' % (ctool, self.ccopts)
1626 def build(self): argument
1628 builddir = self.ctx.component_builddir('glibcs', self.name, 'glibc')
1629 installdir = self.ctx.glibc_installdir(self.name)
1630 logsdir = os.path.join(self.ctx.logsdir, 'glibcs', self.name)
1631 self.ctx.remove_recreate_dirs(installdir, builddir, logsdir)
1632 cmdlist = CommandList('glibcs-%s' % self.name, self.ctx.keep)
1635 os.path.join(self.compiler.installdir, 'ok')])
1636 cmdlist.use_path(self.compiler.bindir)
1637 self.build_glibc(cmdlist, GlibcPolicyForBuild(self))
1638 self.ctx.add_makefile_cmdlist('glibcs-%s' % self.name, cmdlist,
1641 def build_glibc(self, cmdlist, policy): argument
1660 def update_syscalls(self): argument
1661 if self.os == 'gnu':
1665 policy = GlibcPolicyForUpdateSyscalls(self)
1666 logsdir = os.path.join(self.ctx.logsdir, 'update-syscalls', self.name)
1667 self.ctx.remove_recreate_dirs(policy.builddir, logsdir)
1668 cmdlist = CommandList('update-syscalls-%s' % self.name, self.ctx.keep)
1671 os.path.join(self.compiler.installdir, 'ok')])
1672 cmdlist.use_path(self.compiler.bindir)
1680 self.ctx.add_makefile_cmdlist('update-syscalls-%s' % self.name,
1686 def __init__(self, desc, num, dir, path, command, always_run=False): argument
1688 self.dir = dir
1689 self.path = path
1690 self.desc = desc
1692 self.logbase = '%03d-%s' % (num, desc.translate(trans))
1693 self.command = command
1694 self.always_run = always_run
1718 def shell_make_quote(self): argument
1720 return self.shell_make_quote_list(self.command, True)
1726 def __init__(self, desc, keep): argument
1728 self.cmdlist = []
1729 self.dir = None
1730 self.path = None
1731 self.desc = [desc]
1732 self.keep = keep
1734 def desc_txt(self, desc): argument
1736 return '%s %s' % (' '.join(self.desc), desc)
1738 def use_dir(self, dir): argument
1740 self.dir = dir
1742 def use_path(self, path): argument
1745 self.path = path
1747 def push_subdesc(self, subdesc): argument
1751 self.desc.append(subdesc)
1753 def pop_subdesc(self): argument
1755 self.desc.pop()
1757 def create_use_dir(self, dir): argument
1760 self.add_command_dir('rm', None, ['rm', '-rf', dir])
1761 self.add_command_dir('mkdir', None, ['mkdir', '-p', dir])
1762 self.use_dir(dir)
1764 def add_command_dir(self, desc, dir, command, always_run=False): argument
1766 cmd = Command(self.desc_txt(desc), len(self.cmdlist), dir, self.path,
1768 self.cmdlist.append(cmd)
1770 def add_command(self, desc, command, always_run=False): argument
1772 cmd = Command(self.desc_txt(desc), len(self.cmdlist), self.dir,
1773 self.path, command, always_run)
1774 self.cmdlist.append(cmd)
1776 def cleanup_dir(self, desc='cleanup', dir=None): argument
1781 dir = self.dir
1782 self.use_dir(None)
1783 if self.keep != 'all':
1784 self.add_command_dir(desc, None, ['rm', '-rf', dir],
1785 always_run=(self.keep == 'none'))
1787 def makefile_commands(self, wrapper, logsdir): argument
1799 for c in self.cmdlist:
1821 def status_logs(self, logsdir): argument
1824 for c in self.cmdlist]