test no-op options and print info message when they are used

This commit is contained in:
Johannes 'josch' Schauer 2019-02-15 12:42:46 +01:00
parent 5115ca87c3
commit 89718d367e
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1
2 changed files with 24 additions and 3 deletions

View file

@ -549,6 +549,22 @@ else
./run_null.sh SUDO
fi
print_header "mode=root,variant=apt: debootstrap no-op options"
cat << END > shared/test.sh
#!/bin/sh
set -eu
export LC_ALL=C.UTF-8
$CMD --mode=root --variant=apt --resolve-deps --merged-usr --no-merged-usr unstable /tmp/debian-unstable $mirror
tar -C /tmp/debian-unstable --one-file-system -c . | tar -t | sort > tar2.txt
diff -u tar1.txt tar2.txt
rm -r /tmp/debian-unstable
END
if [ "$HAVE_QEMU" = "yes" ]; then
./run_qemu.sh
else
./run_null.sh SUDO
fi
# test all variants
for variant in essential apt required minbase buildd important debootstrap - standard; do

View file

@ -1662,6 +1662,7 @@ sub main() {
mode => 'auto',
dpkgopts => [],
aptopts => [],
noop => [],
customize => [],
};
chomp ($options->{architectures} = `dpkg --print-architecture`);
@ -1681,13 +1682,17 @@ sub main() {
'debug' => sub { $verbosity_level = 3; },
# no-op options so that mmdebstrap can be used with
# sbuild-createchroot --debootstrap=mmdebstrap
'resolve-deps' => sub {},
'merged-usr' => sub {},
'no-merged-usr' => sub {},
'resolve-deps' => sub { push @{$options->{noop}}, 'resolve-deps'; },
'merged-usr' => sub { push @{$options->{noop}}, 'merged-usr'; },
'no-merged-usr' => sub { push @{$options->{noop}}, 'no-merged-usr'; },
# option is hidden until I'm happy with it
'customize=s@' => \$options->{customize},
) or pod2usage(-exitval => 2, -verbose => 1);
foreach my $arg (@{$options->{noop}}) {
info "The option --$arg is a no-op. It only exists for compatibility with some debootstrap wrappers.";
}
my @valid_variants = ('extract', 'custom', 'essential', 'apt', 'required',
'minbase', 'buildd', 'important', 'debootstrap', '-', 'standard');
if (none { $_ eq $options->{variant}} @valid_variants) {