aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGalina Kistanova <gkistanova@gmail.com>2019-10-17 20:42:10 +0000
committerGalina Kistanova <gkistanova@gmail.com>2019-10-17 20:42:10 +0000
commit0792e29d31fb3cfd13cfe3c4a7eb2b74a6c7125a (patch)
treebe5727b5393963aa08059f6dc07cfd7343a16f2b
parent597ddbc7395e72cf36e7ffab47eea0b79ab2f5d8 (diff)
LLVMBuildFactory code cleaning.
Cleaned dialing with repourl, added protection from potential leakage of is_legacy_mode kwarg, more radable name for src_dir. Patch by Andrei Lebedev Differential Revision: https://reviews.llvm.org/D69081 git-svn-id: https://llvm.org/svn/llvm-project/zorg/trunk@375168 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--zorg/buildbot/process/factory.py35
1 files changed, 18 insertions, 17 deletions
diff --git a/zorg/buildbot/process/factory.py b/zorg/buildbot/process/factory.py
index c2242fbb..dc4ff567 100644
--- a/zorg/buildbot/process/factory.py
+++ b/zorg/buildbot/process/factory.py
@@ -61,7 +61,7 @@ class LLVMBuildFactory(BuildFactory):
"%(monorepo_dir)s/build" % {'monorepo_dir' : self.monorepo_dir}
# Repourl could be specified per builder. Otherwise we use github.
- self.repourl = kwargs.pop('repourl', 'https://github.com/llvm/llvm-%s.git')
+ self.repourl_prefix = kwargs.pop('repourl', 'https://github.com/llvm/')
# Default build directory.
@@ -134,12 +134,9 @@ class LLVMBuildFactory(BuildFactory):
return
# Checkout the monorepo.
- _repourl = self.repourl
- if '%' in _repourl:
- _repourl = _repourl % 'project'
self.addStep(
Git(name='Checkout the source code',
- repourl=_repourl,
+ repourl=self.repourl_prefix + "llvm-project.git",
progress=True,
workdir=WithProperties(self.monorepo_dir),
**kwargs))
@@ -147,38 +144,42 @@ class LLVMBuildFactory(BuildFactory):
# Checkout a given LLVM project to the given directory.
# TODO: Handle clean property and self.clean attribute.
- def addGetSourcecodeForProject(self, project, srcdir=None, **kwargs):
+ def addGetSourcecodeForProject(self, project, src_dir=None, **kwargs):
+ # Remove 'is_legacy_mode' if it leaked in to kwargs.
+ kwargs.pop('is_legacy_mode', None)
+
# Bail out if we are in the legacy mode and SVN checkout is required.
if self.is_legacy_mode:
workdir, baseURL = svn_repos[project]
# Check out to the given directory if any.
# Otherwise this is a part of the unified source tree.
- if srcdir is None:
- srcdir = workdir % {'llvm_srcdir' : self.llvm_srcdir}
+ if src_dir is None:
+ src_dir = workdir % {'llvm_srcdir' : self.llvm_srcdir}
self.addStep(
SVN(name='svn-%s' % project,
- workdir=workdir % {'llvm_srcdir' : srcdir},
+ workdir=src_dir,
baseURL=WithProperties(baseURL),
**kwargs))
else:
# project contains a repo name which is not a part of the monorepo.
# We do not enforce it here, though.
- _repourl = kwargs.pop('repourl', self.repourl)
- if '%' in _repourl:
- _repourl = _repourl % project
+ _repourl = kwargs.pop('repourl', None)
+ if not _repourl:
+ _repourl = self.repourl_prefix + "llvm-%s.git" % project
# Check out to the given directory if any.
# Otherwise this is a part of the unified source tree.
- if srcdir is None:
- srcdir = 'llvm-%s' % project
+ if src_dir is None:
+ src_dir = 'llvm-%s' % project
- # Ignore workdir if given. We check out to srcdir.
+ # Ignore workdir if given. We check out to src_dir.
kwargs.pop('workdir', None)
self.addStep(
Git(name='Checkout the %s' % project,
+ repourl=_repourl,
progress=True,
- workdir=WithProperties(srcdir),
- **kwargs)) \ No newline at end of file
+ workdir=WithProperties(src_dir),
+ **kwargs))