[users at bb.net] question about use of Interpolate
tardyp at gmail.com
Wed Apr 5 15:20:36 UTC 2017
On Wed, Apr 5, 2017 at 10:57 AM nicolas.lecureuil nicolas.lecureuil <
nicolas.lecureuil at siveo.net> wrote:
> i use Buildbot to build deb packages.
> i have a small question because i use :
> class UpstreamGetVersion(ShellCommand):
> name ="upstreamgetversion"
> command='grep version setup.py | grep = | cut -d = -f2 | cut -d"\'" -f2 '
> def evaluateCommand(self, cmd):
> shell.SetPropertyFromCommand(command='grep version setup.py | grep = | cut
> -d = -f2 | cut -d"\'" -f2 ', property="upstreamPkgVer")
> return ShellCommand.evaluateCommand(self, cmd)
Your email agent mangled the whitespace, which does not make you code easy
looks like you are not using shell.SetPropertyFromCommand in the way it is
It is not a method you call in the evaluateCommand context, it is a step by
So you don't need any custom evaluateCommand step, you just need
f1.addStep(shell.SetPropertyFromCommand(command='grep version setup.py |
grep = | cut -d = -f2 | cut -d"\'" -f2 ', property="upstreamPkgVer"))
Note that you can debug your properties setup in the properties tab of the
Then, it is recommended to use new style steps for your customizations.
It is exactly the same except you redefine run(), and you do "return
SUCCESS" instead of self.finished(SUCCESS).
Those new style steps are easier to use, and will avoid Buildbot to setup
eight compatibility layer.
Last, you should know that self.getProperty() exists, and should simplify
Instead of printing, you can also call self.addLog:
stdio_log = self.addLog("stdio")
stdio_log.addStdout( 'Debian package upstream version:
You debug logs will be found in the buildbot UI instead of twisted.log
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the users