[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#603114: live-build: be more careful in passing arguments to debootstrap



On Mon, 15 Nov 2010 09:04:29 +0100, Daniel Baumann <daniel@debian.org> wrote:
> On 11/14/2010 11:59 PM, Michael Hudson wrote:
> > Well, as I said in the initial submission, it broke when using
> > qemu-debootstrap instead of debootstrap.  It's basically an
> > implementation accident in the argument parsing of deboostrap -- if it
> > changed to say '$# -ge 4' rather than '$4 != ""', live-build would stop
> > working.  It's all a bit theoretical and I think qemu-debootstrap is
> > going to be fixed to be more compatible with debootstrap here, so if you
> > think the cost to readability is too high, I can understand that.
> 
> that's for the first two changes which are fine as i said, 

No, it's not.

> but i've asked about the second two changes:
> 
> -        ${LB_ROOT_COMMAND} debootstrap ${DEBOOTSTRAP_OPTIONS}
> --download-only "${LB_DISTRIBUTION}" chroot "${LB_MIRROR_BOOTSTRAP}"
> "${LB_DEBOOTSTRAP_SCRIPT}"
> +        ${LB_ROOT_COMMAND} debootstrap ${DEBOOTSTRAP_OPTIONS}
> --download-only "${LB_DISTRIBUTION}" chroot "${LB_MIRROR_BOOTSTRAP}"
> ${LH_DEBOOTSTRAP_SCRIPT:+"$LH_DEBOOTSTRAP_SCRIPT"}

> i don't think they make sense. could explain why you think this should
> be changed?

This is the difference between passing '' and passing nothing as the
last argument:

$ foo=; set -- "${foo}"; echo $# x${1}x
1 xx
$ foo=; set -- ${foo:+"$foo"}; echo $# x${1}x
0 xx

It's passing an empty final argument to qemu-debootstrap rather than no
final argument that confuses it.

> > Relatedly, would you be interested in patches that move towards making
> > live-build use qemu-deboostrap by default if cross building?  I have
> > some patches that work, but they're definitely a bit rough currently.
>
> not for 2.x, since that's in maintenance mode. for 3.x, we're going to
> drop a lot of code and support multistrap only. and multistrap already
> allows to cross-bootstrap, so there's not much point in adding
> qemu-debootstrap support. what do you think?

I'm not sure, to be honest.  It'll likely be a while before we catch up
to 3.0 anyway -- we're still invoking 'lh build', not 'lb build'...

Cheers.
mwh



Reply to: