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

Bug#488264: regression: errors out on empty include-debs option



tags 488264 wontfix
thanks

On Friday 27 June 2008, Thijs Kinkhorst wrote:
> debootstrap fails when supplied an empty set of packages to include:
>
> /usr/sbin/debootstrap --include= --exclude=adduser,apt-utils \
>  --arch powerpc etch /tmp/aap3 http://ftp.nl.debian.org/debian
> E: unrecognized or invalid option --include=
>
> This works successfully on etch so I think it's a regression introduced
> in 1.0.9 with this change:
>   * Error out on unrecognized options to avoid invalid options to be
>     recognized as arguments.

I introduced that change and as it fixes real bugs I'm not inclined to 
revert it.

> We use debootstrap in a shell script where it is called like this:
> /usr/sbin/debootstrap --include="$INCLUDEDEBS" --exclude="$EXCLUDEDEBS"
> \ --arch "$ARCH" etch "$CHROOTDIR" "$DEBMIRROR"
> and I think it's quite reasonable if $INCLUDEDEBS is set to an empty
> string if I don't want to include any extra debs. I don't see problems
> with the existing behaviour so I hope that can be resurrected.

To be honest, I think that passing an empty option like that is invalid as 
there is really no reason why "unsetting" an include list is needed.
In general options should only be passed to commands if actually needed, 
not because it is "convenient".

You should change your script to only pass the option if it actually 
contains a (comma separated) list of packages.

INCLUDEOPT=""
if [ -n "$INCLUDEDEBS" ]; then
	INCLUDEOPT="--include=$INCLUDEDEBS"
fi
/usr/sbin/debootstrap $INCLUDEOPT ...

Note that in the old situation your option was not processed as "include 
option with empty package list", but as "unrecognized option with empty 
argument".

Cheers,
FJP



Reply to: