[buildd-tools-devel] Bug#782672: sbuild: Extra command parsing is overly-complex and broken

Dima Kogan dima at secretsauce.net
Wed Apr 15 22:19:58 UTC 2015


Package: sbuild
Version: 0.65.2-1
Severity: normal

Hi.

sbuild has commandline options to run generic commands at various points
in time (--pre-build-commands for instance). Rather than taking strings
given in these options and passing them to a shell, sbuild instead
manipulates these strings in ways that make only the most simplistic
commands work.

Things that don't work include redirection, multiple commands separated
by ;, subshells etc. For instance, I can't run an arbitrary command in
an arbitrary directory. Something like this should work:

  --pre-build-commands 'cd directory; do_thing'

but it doesn't. Sbuild splits the string on whitespace, throws out all '
(with a warning), then encloses each work in '', and prepends a
directory switch. So the above becomes

 /bin/sh
 -c
 cd /home/user && 'cd' 'directory;' 'do_thing'

It would make way more sense to take the string as is, enclose in () and
pass it through:

 /bin/sh
 -c
 cd /home/user && (cd directory; do_thing)

Would a patch that does this be accepted?



More information about the Buildd-tools-devel mailing list