<!DOCTYPE html>
<html><head>
<meta charset="UTF-8">
</head><body><p>Hi,<br></p><p><br></p><p>i use Buildbot to build deb packages.<br></p><p>i have a small question because i use :<br></p><p><br></p><p>class UpstreamGetVersion(ShellCommand):<br> name ="upstreamgetversion"<br> command='grep version setup.py | grep = | cut -d = -f2 | cut -d"\'" -f2 '</p><p>def evaluateCommand(self, cmd):<br> shell.SetPropertyFromCommand(command='grep version setup.py | grep = | cut -d = -f2 | cut -d"\'" -f2 ', property="upstreamPkgVer")<br> return ShellCommand.evaluateCommand(self, cmd)</p><p><br></p><p>and later in the config:<br></p><p><br></p><p>class DebComputeNewVersion(BuildStep):<br> # /!\ Add your variable to renderables otherwise you'll have<br> # a property object instance instead of a string (??)<br> renderables = [ "debver", "commit", "upstreamver" ]<br> name = "debnewversion"<br> debver = Property("debPkgDebVer")<br> upstreamver = Interpolate("%(prop:upstreamPkgVer)s")<br> commit = Property("revision")<br> prop = Property("efef")</p><p>def __init__(self, master_path, pkg_url, **kwargs):<br> BuildStep.__init__(self, **kwargs)<br> self.master_path = master_path<br> self.pkg = pkg_url</p><p>def start(self):<br> date = datetime.datetime.now().strftime("%Y%m%d%H%M%S")<br> newdebver = self.upstreamver + "+git" + date + "." + self.commit[:7]<br> print '# DebComputeNewVersion #'<br> print 'Debian package upstream version: '+str(self.debver)<br> print 'Upstream version found: '+str(self.upstreamver)<br> print 'New Debian package version: '+str(newdebver)<br> print '# End DebComputeNewVersion #'<br> self.setProperty("debPkgNewDebVer", newdebver, "DebComputeNewVersion")<br> self.setProperty("debPkgRev", "1", "DebComputeNewVersion")<br> self.setProperty("shortRev", self.commit[:7], "DebComputeNewVersion")<br> self.setProperty("masterPath", os.path.join(self.master.basedir, self.master_path, newdebver), "DebComputeNewVersion")<br> self.setProperty("pkgUrl", os.path.join(self.pkg, newdebver), "DebComputeNewVersion")<br> self.finished(SUCCESS)</p><p><br></p><p><br></p><p>the probleme is that str(self.upstreamver) is empty.<br></p><p><br></p><p>Do i use Interpolate in a bad way ?<br></p><p><br></p><p>thanks a lot for your help<br></p></body></html>