From 2ffd96ad1ef4e488b67722e957c160c0e47847df Mon Sep 17 00:00:00 2001 From: nazunalika Date: Thu, 16 Jun 2022 12:24:19 -0700 Subject: [PATCH] sort logs by date --- iso/py/templates/buildImage.tmpl.sh | 2 +- iso/py/util/dnf_utils.py | 23 ++++++++++------------- iso/py/util/iso_utils.py | 11 +++++++++-- 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/iso/py/templates/buildImage.tmpl.sh b/iso/py/templates/buildImage.tmpl.sh index efe097d..3cc055e 100644 --- a/iso/py/templates/buildImage.tmpl.sh +++ b/iso/py/templates/buildImage.tmpl.sh @@ -13,7 +13,7 @@ lorax --product='{{ distname }}' \ --variant={{ variant }} \ --nomacboot \ --buildarch={{ arch }} \ - --volid={{ shortname }}-{{ major }}-{{ minor }}-{{ arch }}-dvd1 \ + --volid={{ shortname }}-{{ major }}-{{ minor }}{{ rc }}-{{ arch }}-boot1 \ --logfile={{ mock_work_root }}/lorax.log \ --rootfs-size=3 \ {{ lorax_work_root }} diff --git a/iso/py/util/dnf_utils.py b/iso/py/util/dnf_utils.py index 6f6ec5e..c5ca97d 100644 --- a/iso/py/util/dnf_utils.py +++ b/iso/py/util/dnf_utils.py @@ -177,7 +177,8 @@ class RepoSync: log_root = os.path.join( work_root, - "logs" + "logs", + self.date_stamp ) if self.dryrun: @@ -313,18 +314,16 @@ class RepoSync: a )) - sync_log = ("{}/{}-{}-{}.log").format( + sync_log = ("{}/{}-{}.log").format( log_root, repo_name, - a, - self.date_stamp + a ) - debug_sync_log = ("{}/{}-{}-debug-{}.log").format( + debug_sync_log = ("{}/{}-{}-debug.log").format( log_root, repo_name, - a, - self.date_stamp + a ) sync_cmd = ("/usr/bin/dnf reposync -c {}.{} --download-metadata " @@ -395,10 +394,9 @@ class RepoSync: 'source/tree' ) - source_sync_log = ("{}/{}-source-{}.log").format( + source_sync_log = ("{}/{}-source.log").format( log_root, - repo_name, - self.date_stamp + repo_name ) source_sync_cmd = ("/usr/bin/dnf reposync -c {} " @@ -690,7 +688,7 @@ class RepoSync: ) repoclosure_cmd = ('/usr/bin/dnf repoclosure {} ' '--repofrompath={},file://{}/{}/{}/os --repo={} --check={} {} ' - '| tee -a {}/{}-repoclosure-{}-{}.log').format( + '| tee -a {}/{}-repoclosure-{}.log').format( repoclosure_arch_list, repo, sync_root, @@ -701,8 +699,7 @@ class RepoSync: join_repo_comb, log_root, repo, - arch, - self.date_stamp + arch ) repoclosure_entry_point_open = open(repoclosure_entry_point_sh, "w+") repoclosure_entry_point_open.write('#!/bin/bash\n') diff --git a/iso/py/util/iso_utils.py b/iso/py/util/iso_utils.py index 1461019..88de9fd 100644 --- a/iso/py/util/iso_utils.py +++ b/iso/py/util/iso_utils.py @@ -30,6 +30,7 @@ class IsoBuild: rlvars, config, major, + rc: bool = False, isolation: str = 'auto', compose_dir_is_here: bool = False, image=None, @@ -54,11 +55,13 @@ class IsoBuild: self.lorax_result_root = config['mock_work_root'] + "/" + "lorax" self.mock_isolation = isolation self.iso_map = rlvars['iso_map'] + self.release_candidate = rc # Relevant major version items self.release = rlvars['revision'] self.minor_version = rlvars['revision'].split('.')[1] self.revision = rlvars['revision'] + "-" + rlvars['rclvl'] + self.rclvl = rlvars['rclvl'] self.repos = rlvars['iso_map']['repos'] self.repo_base_url = config['repo_base_url'] self.project_id = rlvars['project_id'] @@ -172,7 +175,6 @@ class IsoBuild: # Check for arch specific build, build accordingly # local AND arch cannot be used together, local supersedes. print # warning. - self.log.info('Generating ISO configuration and scripts') self.generate_iso_scripts() print() @@ -180,6 +182,7 @@ class IsoBuild: """ Generates the scripts needed to be ran in the mock roots """ + self.log.info('Generating ISO configuration and scripts') mock_iso_template = self.tmplenv.get_template('isomock.tmpl.cfg') mock_sh_template = self.tmplenv.get_template('isobuild.tmpl.sh') iso_template = self.tmplenv.get_template('buildImage.tmpl.sh') @@ -188,6 +191,10 @@ class IsoBuild: mock_sh_path = '/var/tmp/isobuild.sh' iso_template_path = '/var/tmp/buildImage.sh' + rclevel = '' + if self.release_candidate: + rclevel = '-' + self.rclvl + mock_iso_template_output = mock_iso_template.render( arch=self.current_arch, major=self.major_version, @@ -216,6 +223,7 @@ class IsoBuild: lorax=self.iso_map['lorax_removes'], distname=self.distname, revision=self.release, + rc=rclevel, ) mock_iso_entry = open(mock_iso_path, "w+") @@ -229,7 +237,6 @@ class IsoBuild: iso_template_entry = open(iso_template_path, "w+") iso_template_entry.write(iso_template_output) iso_template_entry.close() - print() # !!! Send help, we would prefer to do this using the productmd python # !!! library. If you are reading this and you can help us, please do so!