From 2bcc2a014b8c70d5be1bc9a1916799fa83cbaeab Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 3 May 2018 12:48:45 +0200 Subject: Merging upstream version 20180503. Signed-off-by: Daniel Baumann --- CHANGELOG.txt | 11 +++++++++++ VERSION.txt | 2 +- lib/container/create | 23 ++++++++++++++++++++--- share/bash-completion/container | 24 ++++++++++++------------ share/doc/asciicast/introduction.sh | 2 +- share/man/container-create-debconf.1.txt | 4 ++-- share/man/container-create.1.txt | 3 +++ 7 files changed, 50 insertions(+), 19 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index d6ca7b6..581e46d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,14 @@ +2018-05-03 Daniel Baumann + + * Releasing version 20180503. + + [ Daniel Baumann ] + * Removing suite reference in examples of container-create-debconf manpage. + * Adding -v, --verbose option to container-create command to be used e.g. when mass-creating new containers in a row. + * Adding quotes for consistency in bash-completion. + * Updating bash-completion to also complete on preseed files in the first level of subdirectories of /etc/container-tools/debconf. + * Updating asciicast for asciinema version 2.0. + 2018-02-18 Daniel Baumann * Releasing version 20180218. diff --git a/VERSION.txt b/VERSION.txt index 66631f9..9e4322f 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -20180218 +20180503 diff --git a/lib/container/create b/lib/container/create index 5878e7e..2ffcfda 100755 --- a/lib/container/create +++ b/lib/container/create @@ -29,8 +29,8 @@ SCRIPTS="/usr/share/container-tools/scripts" Parameters () { - GETOPT_LONGOPTIONS="name:,cnt.container-server:,cnt.overlay:,bind:,bind-ro:,capability:,drop-capability:script:," - GETOPT_OPTIONS="n:,b:,c:,d:,s:," + GETOPT_LONGOPTIONS="name:,cnt.container-server:,cnt.overlay:,bind:,bind-ro:,capability:,drop-capability:script:,verbose," + GETOPT_OPTIONS="n:,b:,c:,d:,s:,v," PARAMETERS="$(getopt --longoptions ${GETOPT_LONGOPTIONS} --name=${COMMAND} --options ${GETOPT_OPTIONS} --shell sh -- ${@})" @@ -90,6 +90,11 @@ Parameters () shift 2 ;; + -v|--verbose) + VERBOSE="true" + shift 1 + ;; + --) shift 1 break @@ -105,7 +110,7 @@ Parameters () Usage () { - echo "Usage: container ${COMMAND} -n|--name NAME [--cnt.container-server=true|false|FQDN] [--cnt.overlay=DIRECTORY_LOWER:DIRECTORY_UPPER:DIRECTORY_WORK:DIRECTORY_MERGED] [-b|--bind DIRECTORY:DIRECTORY[:OPTIONS]] [--bind-ro DIRECTORY:DIRECTORY[:OPTIONS]] [-c|--capability CAPABILITY[,CAPABILITY]] [-d|--drop-capability DROP_CAPABILITY[,DROP_CAPABILITY]] [-s|--script SCRIPT] [-- SCRIPT_OPTIONS]" >&2 + echo "Usage: container ${COMMAND} -n|--name NAME [--cnt.container-server=true|false|FQDN] [--cnt.overlay=DIRECTORY_LOWER:DIRECTORY_UPPER:DIRECTORY_WORK:DIRECTORY_MERGED] [-b|--bind DIRECTORY:DIRECTORY[:OPTIONS]] [--bind-ro DIRECTORY:DIRECTORY[:OPTIONS]] [-c|--capability CAPABILITY[,CAPABILITY]] [-d|--drop-capability DROP_CAPABILITY[,DROP_CAPABILITY]] [-s|--script SCRIPT] [-v|--verbose] [-- SCRIPT_OPTIONS]" >&2 exit 1 } @@ -152,6 +157,18 @@ else fi fi +case "${VERBOSE}" in + true) + +cat << EOF +################################################################################ +Creating container: ${NAME} +################################################################################ +EOF + + ;; +esac + CNT_CONTAINER_SERVER="${CNT_CONTAINER_SERVER:-$(hostname -f)}" # Pre hooks diff --git a/share/bash-completion/container b/share/bash-completion/container index 0a9af1a..e117d16 100644 --- a/share/bash-completion/container +++ b/share/bash-completion/container @@ -48,7 +48,7 @@ _container() console|con) case "${prev}" in -n|--name) - opts=$(container list -s -f shell) + opts="$(container list -s -f shell)" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 ;; @@ -64,19 +64,19 @@ _container() create) case "${prev}" in -n|--name) - opts=$(cd /etc/container-tools/debconf 2>/dev/null && ls *.cfg 2>/dev/null | sed -e 's/.cfg$//g') + opts="$(cd /etc/container-tools/debconf 2>/dev/null && ls *.cfg */*.cfg 2>/dev/null | sed -e 's|.*/||g' -e 's|.cfg$||g')" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 ;; -s|--script) - opts=$(cd /usr/share/container-tools/scripts && find -maxdepth 1 -not -type d -and -not -name 'default' -and -not -name 'debconf' -and -not -name '*.d' -printf '%P\n' | sort) + opts="$(cd /usr/share/container-tools/scripts && find -maxdepth 1 -not -type d -and -not -name 'default' -and -not -name 'debconf' -and -not -name '*.d' -printf '%P\n' | sort)" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 ;; *) - opts="-n --name -c --capability -d --drop-capability -s --script -b --bind --bind-ro" + opts="-n --name -c --capability -d --drop-capability -s --script -v --verbose -b --bind --bind-ro" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 ;; @@ -86,7 +86,7 @@ _container() enter) case "${prev}" in -n|--name) - opts=$(container list -s -f shell) + opts="$(container list -s -f shell)" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 ;; @@ -108,7 +108,7 @@ _container() limit) case "${prev}" in -n|--name) - opts=$(container list -a -f shell) + opts="$(container list -a -f shell)" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 ;; @@ -146,7 +146,7 @@ _container() move|mv) case "${prev}" in -o|--old) - opts=$(container list -t -f shell) + opts="$(container list -t -f shell)" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 ;; @@ -162,7 +162,7 @@ _container() remove|rm) case "${prev}" in -n|--name) - opts=$(container list -t -f shell) + opts="$(container list -t -f shell)" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 ;; @@ -178,7 +178,7 @@ _container() restart) case "${prev}" in -n|--name) - opts=$(container list -s -f shell) + opts="$(container list -s -f shell)" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 ;; @@ -194,7 +194,7 @@ _container() start) case "${prev}" in -n|--name) - opts=$(container list -t -f shell) + opts="$(container list -t -f shell)" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 ;; @@ -210,7 +210,7 @@ _container() status) case "${prev}" in -n|--name) - opts=$(container list -t -f shell) + opts="$(container list -t -f shell)" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 ;; @@ -226,7 +226,7 @@ _container() stop) case "${prev}" in -n|--name) - opts=$(container list -s -f shell) + opts="$(container list -s -f shell)" COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) return 0 ;; diff --git a/share/doc/asciicast/introduction.sh b/share/doc/asciicast/introduction.sh index 2a1ab0b..c4efb0c 100755 --- a/share/doc/asciicast/introduction.sh +++ b/share/doc/asciicast/introduction.sh @@ -20,7 +20,7 @@ set -e -# Usage: sudo asciinema -c ./introduction.sh +# Usage: sudo asciinema rec -c ./introduction.sh PS1="root@debian:~#" diff --git a/share/man/container-create-debconf.1.txt b/share/man/container-create-debconf.1.txt index ce77c53..db4028b 100644 --- a/share/man/container-create-debconf.1.txt +++ b/share/man/container-create-debconf.1.txt @@ -103,10 +103,10 @@ The following script options are available: EXAMPLES -------- *Create a Debian based container:*:: - sudo container create -s debian -n stretch.example.net + sudo container create -s debian -n debian.example.net *Create a Progress Linux container:*:: - sudo container create -s progress-linux -n cairon-backports.example.net + sudo container create -s progress-linux -n progress.example.net FILES diff --git a/share/man/container-create.1.txt b/share/man/container-create.1.txt index 6ffc867..d21bd58 100644 --- a/share/man/container-create.1.txt +++ b/share/man/container-create.1.txt @@ -55,6 +55,9 @@ The following container-create options are available: *-s, --script='SCRIPT'*:: Specify container creation script, defaults to debootstrap. +*-v, --verbose*:: + Explain what is being done. + *-b, --bind='DIRECTORY:DIRECTORY[:OPTIONS][;DIRECTORY:DIRECTORY[:OPTIONS]]'*:: Specify container read-write bind mounts, see systemd-nspawn(1) --bind option. -- cgit v1.2.3