Add config file and force timestamp conditional option

This commit is contained in:
Melg Eight 2021-05-18 14:37:34 +03:00
parent fefb33a870
commit cf4ce56603
No known key found for this signature in database
GPG key ID: 8F73D998D1992669
4 changed files with 34 additions and 2 deletions

13
sysa.py
View file

@ -18,7 +18,7 @@ class SysA:
"""
Class responsible for preparing sources for System A.
"""
def __init__(self, arch, preserve_tmp, tmpdir):
def __init__(self, arch, preserve_tmp, tmpdir, force_timestamps):
self.git_dir = os.path.dirname(os.path.join(__file__))
self.arch = arch
self.preserve_tmp = preserve_tmp
@ -29,6 +29,7 @@ class SysA:
self.tmp_dir = tmpdir
self.sysa_dir = os.path.join(self.git_dir, 'sysa')
self.after_dir = os.path.join(self.tmp_dir, 'after')
self.force_timestamps = force_timestamps
self.prepare()
@ -187,6 +188,7 @@ class SysA:
"""
self.create_after_dirs()
self.create_configuration_file()
self.mescc_tools_checksum()
self.deploy_extra_files()
self.mescc_tools_extra()
@ -194,6 +196,15 @@ class SysA:
self.tcc_0_9_26()
self.get_packages()
def create_configuration_file(self):
"""
Creates bootstrap.cfg file which would contain options used to
customize bootstrap.
"""
config_path = os.path.join(self.after_dir, "bootstrap.cfg")
with open(config_path, "w") as config:
config.write("FORCE_TIMESTAMPS=" + str(self.force_timestamps))
def create_after_dirs(self):
"""
Create some empty directories for early bootstrap