Skip to content

Commit

Permalink
Make rpm dist renderable
Browse files Browse the repository at this point in the history
  • Loading branch information
anish committed Jul 10, 2016
1 parent 00a48de commit 482701f
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions master/buildbot/steps/package/rpm/rpmbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ class RpmBuild(ShellCommand):
RpmBuild build step.
"""

renderables = [ 'dist' ]
dist = '.el6'
name = "rpmbuilder"
haltOnFailure = 1
flunkOnFailure = 1
Expand All @@ -42,7 +44,7 @@ def __init__(self,
sourcedir='`pwd`',
specdir='`pwd`',
srcrpmdir='`pwd`',
dist='.el5',
dist='.el6',
autoRelease=False,
vcsRevision=False,
**kwargs):
Expand Down Expand Up @@ -71,12 +73,16 @@ def __init__(self,
@param vcsRevision: Use vcs version number as revision number.
"""
ShellCommand.__init__(self, **kwargs)

self.dist = dist

self.rpmbuild = (
'rpmbuild --define "_topdir %s" --define "_builddir %s"'
' --define "_rpmdir %s" --define "_sourcedir %s"'
' --define "_specdir %s" --define "_srcrpmdir %s"'
' --define "dist %s"' % (topdir, builddir, rpmdir, sourcedir,
specdir, srcrpmdir, dist))
% (topdir, builddir, rpmdir, sourcedir, specdir,
srcrpmdir))

self.specfile = specfile
self.autoRelease = autoRelease
self.vcsRevision = vcsRevision
Expand All @@ -88,6 +94,9 @@ def __init__(self,
'stdio', logobserver.LineConsumerLogObserver(self.logConsumer))

def start(self):

self.rpmbuild = ('%s --define "dist %s"' % (self.rpmbuild, self.dist))

if self.autoRelease:
relfile = '%s.release' % (
os.path.basename(self.specfile).split('.')[0])
Expand Down

0 comments on commit 482701f

Please sign in to comment.