forked from josch/mmdebstrap
test no-op options and print info message when they are used
This commit is contained in:
parent
5115ca87c3
commit
89718d367e
2 changed files with 24 additions and 3 deletions
16
coverage.sh
16
coverage.sh
|
@ -549,6 +549,22 @@ else
|
||||||
./run_null.sh SUDO
|
./run_null.sh SUDO
|
||||||
fi
|
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
|
# test all variants
|
||||||
|
|
||||||
for variant in essential apt required minbase buildd important debootstrap - standard; do
|
for variant in essential apt required minbase buildd important debootstrap - standard; do
|
||||||
|
|
11
mmdebstrap
11
mmdebstrap
|
@ -1662,6 +1662,7 @@ sub main() {
|
||||||
mode => 'auto',
|
mode => 'auto',
|
||||||
dpkgopts => [],
|
dpkgopts => [],
|
||||||
aptopts => [],
|
aptopts => [],
|
||||||
|
noop => [],
|
||||||
customize => [],
|
customize => [],
|
||||||
};
|
};
|
||||||
chomp ($options->{architectures} = `dpkg --print-architecture`);
|
chomp ($options->{architectures} = `dpkg --print-architecture`);
|
||||||
|
@ -1681,13 +1682,17 @@ sub main() {
|
||||||
'debug' => sub { $verbosity_level = 3; },
|
'debug' => sub { $verbosity_level = 3; },
|
||||||
# no-op options so that mmdebstrap can be used with
|
# no-op options so that mmdebstrap can be used with
|
||||||
# sbuild-createchroot --debootstrap=mmdebstrap
|
# sbuild-createchroot --debootstrap=mmdebstrap
|
||||||
'resolve-deps' => sub {},
|
'resolve-deps' => sub { push @{$options->{noop}}, 'resolve-deps'; },
|
||||||
'merged-usr' => sub {},
|
'merged-usr' => sub { push @{$options->{noop}}, 'merged-usr'; },
|
||||||
'no-merged-usr' => sub {},
|
'no-merged-usr' => sub { push @{$options->{noop}}, 'no-merged-usr'; },
|
||||||
# option is hidden until I'm happy with it
|
# option is hidden until I'm happy with it
|
||||||
'customize=s@' => \$options->{customize},
|
'customize=s@' => \$options->{customize},
|
||||||
) or pod2usage(-exitval => 2, -verbose => 1);
|
) 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',
|
my @valid_variants = ('extract', 'custom', 'essential', 'apt', 'required',
|
||||||
'minbase', 'buildd', 'important', 'debootstrap', '-', 'standard');
|
'minbase', 'buildd', 'important', 'debootstrap', '-', 'standard');
|
||||||
if (none { $_ eq $options->{variant}} @valid_variants) {
|
if (none { $_ eq $options->{variant}} @valid_variants) {
|
||||||
|
|
Loading…
Reference in a new issue