From a91a825e67f1c318aa8bde17f5659948206e0bac Mon Sep 17 00:00:00 2001 From: Johannes 'josch' Schauer Date: Sat, 23 Feb 2019 08:55:31 +0100 Subject: [PATCH] add --version option --- coverage.sh | 15 +++++++++++++++ mmdebstrap | 7 +++++++ 2 files changed, 22 insertions(+) diff --git a/coverage.sh b/coverage.sh index d685fb3..605c6a5 100755 --- a/coverage.sh +++ b/coverage.sh @@ -224,6 +224,21 @@ else ./run_null.sh fi +print_header "test --version" +cat << END > shared/test.sh +#!/bin/sh +set -eu +export LC_ALL=C.UTF-8 +$CMD --version | egrep --quiet '^mmdebstrap [0-9](\.[0-9])+$' +END +if [ "$HAVE_QEMU" = "yes" ]; then + ./run_qemu.sh +elif [ "$defaultmode" = "root" ]; then + ./run_null.sh SUDO +else + ./run_null.sh +fi + print_header "mode=root,variant=apt: create directory" cat << END > shared/test.sh #!/bin/sh diff --git a/mmdebstrap b/mmdebstrap index 2a09aa4..e40e0c8 100755 --- a/mmdebstrap +++ b/mmdebstrap @@ -15,6 +15,8 @@ use strict; use warnings; +our $VERSION = '0.3.0'; + use English; use Getopt::Long; use Pod::Usage; @@ -1699,6 +1701,7 @@ sub main() { Getopt::Long::Configure ('default', 'bundling', 'auto_abbrev', 'ignore_case_always'); GetOptions( 'h|help' => sub { pod2usage(-exitval => 0, -verbose => 2) }, + 'version' => sub { print STDOUT "mmdebstrap $VERSION\n"; exit 0; }, 'components=s' => \$options->{components}, 'variant=s' => \$options->{variant}, 'include=s' => \$options->{include}, @@ -2445,6 +2448,10 @@ require a double dash and may be abbreviated to uniqueness. Print this help text and exit. +=item B<--version> + +Print the B version and exit. + =item B<--variant>=I Choose which package set to install. Valid variant Is are B,