From 89718d367e79c8bca06306f9b5502a651dbe8d86 Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Fri, 15 Feb 2019 12:42:46 +0100 Subject: [PATCH] test no-op options and print info message when they are used --- coverage.sh | 16 ++++++++++++++++ mmdebstrap | 11 ++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/coverage.sh b/coverage.sh index b8aa0ed..0e7cba0 100755 --- a/coverage.sh +++ b/coverage.sh @@ -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 diff --git a/mmdebstrap b/mmdebstrap index 99698e4..dc71594 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -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) {