return version
+def escape_arg(arg):
+ """Shell-escape arg, if necessary.
+ Fairly simplistic, doesn't escape anything except whitespace.
+ """
+ if ' ' not in arg:
+ return arg
+ return '"%s"' % arg.replace('\\', r'\\').replace('"', r'\"')
+
+
if __name__ == '__main__':
logger.debug('Start-up environment:\n\n{env}\n'.format(env=pformat(ENV)))
)
if ret == 0:
logger.info('Current environment:\n\n{env}\n'.format(env=builder.env))
- logger.info('Start building the binary package by running '
- '"{cmd}"...\n'.format(cmd=' '.join(builder.command)))
+ logger.info("Start building the binary package by running '{cmd}'...\n"
+ .format(cmd=' '.join(escape_arg(arg) for arg in builder.command)))
ret = builder.build()
# .. remove last commit (the one where we added the changelog entry)