From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 7291315808D for ; Fri, 22 Apr 2022 12:34:57 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 6F1FCE05AC; Fri, 22 Apr 2022 12:34:56 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 7ED1AE05AC for ; Fri, 22 Apr 2022 12:34:54 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 4C885341EE3 for ; Fri, 22 Apr 2022 12:34:51 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A8CE135A for ; Fri, 22 Apr 2022 12:34:49 +0000 (UTC) From: "Magnus Granberg" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Magnus Granberg" Message-ID: <1650630875.e09c9ab4e45d4a884ea6d2da386f5ea3c8f13c2c.zorry@gentoo> Subject: [gentoo-commits] proj/tinderbox-cluster:master commit in: buildbot_gentoo_ci/steps/ X-VCS-Repository: proj/tinderbox-cluster X-VCS-Files: buildbot_gentoo_ci/steps/builders.py buildbot_gentoo_ci/steps/portage.py X-VCS-Directories: buildbot_gentoo_ci/steps/ X-VCS-Committer: zorry X-VCS-Committer-Name: Magnus Granberg X-VCS-Revision: e09c9ab4e45d4a884ea6d2da386f5ea3c8f13c2c X-VCS-Branch: master Date: Fri, 22 Apr 2022 12:34:49 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: fc10f104-626c-4b46-8013-81b903b9f7d6 X-Archives-Hash: e316b41daee01d66f1eda177707a6bf1 commit: e09c9ab4e45d4a884ea6d2da386f5ea3c8f13c2c Author: Magnus Granberg gentoo org> AuthorDate: Fri Apr 22 12:34:35 2022 +0000 Commit: Magnus Granberg gentoo org> CommitDate: Fri Apr 22 12:34:35 2022 +0000 URL: https://gitweb.gentoo.org/proj/tinderbox-cluster.git/commit/?id=e09c9ab4 Add support rootworkdir Signed-off-by: Magnus Granberg gentoo.org> buildbot_gentoo_ci/steps/builders.py | 14 +++++++++----- buildbot_gentoo_ci/steps/portage.py | 29 ++++++++++++++++++++++------- 2 files changed, 31 insertions(+), 12 deletions(-) diff --git a/buildbot_gentoo_ci/steps/builders.py b/buildbot_gentoo_ci/steps/builders.py index 4ade33d..8ce6545 100644 --- a/buildbot_gentoo_ci/steps/builders.py +++ b/buildbot_gentoo_ci/steps/builders.py @@ -344,7 +344,8 @@ class UpdateRepos(BuildStep): haltOnFailure = True flunkOnFailure = True - def __init__(self, **kwargs): + def __init__(self, workdir=False, **kwargs): + self.rootworkdir = workdir super().__init__(**kwargs) @defer.inlineCallbacks @@ -356,14 +357,17 @@ class UpdateRepos(BuildStep): projects_repositorys_data = yield self.gentooci.db.projects.getRepositorysByProjectUuid(project_data['uuid']) for project_repository_data in projects_repositorys_data: repository_data = yield self.gentooci.db.repositorys.getRepositoryByUuid(project_repository_data['repository_uuid']) - repository_path = yield os.path.join(portage_repos_path, repository_data['name']) + if self.rootworkdir: + repository_path = os.path.join(self.rootworkdir, portage_repos_path[1:], repository_data['name']) + else: + repository_path = os.path.join(portage_repos_path, repository_data['name'], '') yield self.build.addStepsAfterCurrentStep([ steps.Git(repourl=repository_data['url'], name = 'Git pull ' + repository_data['name'], mode='full', submodules=True, alwaysUseLatest=True, - workdir=os.path.join(repository_path, '')) + workdir=repository_path) ]) return SUCCESS @@ -798,8 +802,8 @@ class CheckEmergeLogs(BuildStep): print(cpv_build_dir) self.setProperty('cpv_build_dir', cpv_build_dir, 'cpv_build_dir') cpv_build_work_dir = yield os.path.join(cpv_build_dir, 'work') - #FIXME: take find pattern from db or config - find_pattern_list = ['meson-log.txt', 'CMakeCache.txt'] + #FIXME: take find pattern from db + find_pattern_list = ['meson-log.txt', 'CMakeCache.txt', 'testlog.txt', '*.out', 'project-config.jam', 'testlog-x11.txt'] shell_commad_list = [] # we have *.log as default shell_commad_list.append('find') diff --git a/buildbot_gentoo_ci/steps/portage.py b/buildbot_gentoo_ci/steps/portage.py index 2332626..431fe9a 100644 --- a/buildbot_gentoo_ci/steps/portage.py +++ b/buildbot_gentoo_ci/steps/portage.py @@ -76,7 +76,8 @@ class SetMakeProfile(BuildStep): haltOnFailure = True flunkOnFailure = True - def __init__(self, **kwargs): + def __init__(self, workdir=False, **kwargs): + self.rootworkdir = workdir super().__init__(**kwargs) @defer.inlineCallbacks @@ -104,8 +105,12 @@ class SetMakeProfile(BuildStep): 'ln', '-s' ] + if self.rootworkdir: + symlink_makeprofile_path = yield os.path.join(self.rootworkdir, 'etc/portage/make.profile') + else: + symlink_makeprofile_path = '/etc/portage/make.profile' shell_commad_list.append(makeprofile_path) - shell_commad_list.append('/etc/portage/make.profile') + shell_commad_list.append(symlink_makeprofile_path) yield self.build.addStepsAfterCurrentStep([ steps.ShellCommand( command=shell_commad_list, @@ -125,7 +130,8 @@ class SetReposConf(BuildStep): haltOnFailure = True flunkOnFailure = True - def __init__(self, **kwargs): + def __init__(self, workdir=False, **kwargs): + self.rootworkdir = workdir super().__init__(**kwargs) @defer.inlineCallbacks @@ -133,6 +139,10 @@ class SetReposConf(BuildStep): self.gentooci = self.master.namedServices['services'].namedServices['gentooci'] portage_repos_path = self.getProperty('portage_repos_path') project_data = self.getProperty('project_data') + if self.rootworkdir: + portage_etc_path = yield os.path.join(self.rootworkdir, 'etc/portage/') + else: + portage_etc_path = '/etc/portage/' # setup the default.conf repos_conf_data = yield self.gentooci.db.projects.getProjectPortageByUuidAndDirectory(project_data['uuid'], 'repos.conf') if repos_conf_data is None: @@ -149,7 +159,7 @@ class SetReposConf(BuildStep): yield self.build.addStepsAfterCurrentStep([ steps.StringDownload(default_conf_string + separator, workerdest="repos.conf/default.conf", - workdir='/etc/portage/') + workdir=portage_etc_path) ]) # display the default.conf yield log.addStdout('File: ' + 'default.conf' + '\n') @@ -171,7 +181,7 @@ class SetReposConf(BuildStep): yield self.build.addStepsAfterCurrentStep([ steps.StringDownload(repository_conf_string + separator, workerdest='repos.conf/' + filename, - workdir='/etc/portage/') + workdir=portage_etc_path) ]) yield log.addStdout('File: ' + filename + '\n') for line in repository_conf: @@ -187,7 +197,8 @@ class SetMakeConf(BuildStep): haltOnFailure = True flunkOnFailure = True - def __init__(self, **kwargs): + def __init__(self, workdir=False, **kwargs): + self.rootworkdir = workdir super().__init__(**kwargs) @defer.inlineCallbacks @@ -196,6 +207,10 @@ class SetMakeConf(BuildStep): self.gentooci = self.master.namedServices['services'].namedServices['gentooci'] project_data = self.getProperty('project_data') makeconf_variables_data = yield self.gentooci.db.portages.getVariables() + if self.rootworkdir: + portage_etc_path = yield os.path.join(self.rootworkdir, 'etc/portage/') + else: + portage_etc_path = '/etc/portage/' separator1 = '\n' separator2 = ' ' makeconf_list = [] @@ -248,7 +263,7 @@ class SetMakeConf(BuildStep): yield self.build.addStepsAfterCurrentStep([ steps.StringDownload(makeconf_string + separator1, workerdest="make.conf", - workdir='/etc/portage/') + workdir=portage_etc_path) ]) # display the make.conf for line in makeconf_list: