diff options
author | Daniel Baumann <mail@daniel-baumann.ch> | 2016-06-14 19:22:29 +0000 |
---|---|---|
committer | Daniel Baumann <mail@daniel-baumann.ch> | 2016-06-14 19:22:29 +0000 |
commit | d11ae937a110a0b8a6a0ecc5787cf2a49e899382 (patch) | |
tree | 562a59a6f627ba4f0a2945cecaa83119a3b0088a | |
parent | Adding debconf handling for setting choosing /var/lib/machines, /etc/containe... (diff) | |
download | open-infrastructure-compute-tools-d11ae937a110a0b8a6a0ecc5787cf2a49e899382.tar.xz open-infrastructure-compute-tools-d11ae937a110a0b8a6a0ecc5787cf2a49e899382.zip |
Adding debconf handling for default container create script selection.
Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
-rw-r--r-- | debian/open-infrastructure-container-tools.config | 22 | ||||
-rw-r--r-- | debian/open-infrastructure-container-tools.postinst | 5 | ||||
-rw-r--r-- | debian/open-infrastructure-container-tools.templates | 10 |
3 files changed, 37 insertions, 0 deletions
diff --git a/debian/open-infrastructure-container-tools.config b/debian/open-infrastructure-container-tools.config index 65d325a..73d2157 100644 --- a/debian/open-infrastructure-container-tools.config +++ b/debian/open-infrastructure-container-tools.config @@ -20,4 +20,26 @@ db_settitle open-infrastructure-container-tools/title db_input low open-infrastructure-container-tools/cache || true db_go +SCRIPT_CHOICES="$(cd /usr/share/container-tools/scripts && find -maxdepth 1 -not -type d -and -not -name 'debconf' -and -not -name '*.d' -printf '%P\n' | sort)" +db_subst open-infrastructure-container-tools/script SCRIPT_CHOICES "$(echo ${SCRIPT_CHOICES} | sed -e 's| |, |g')" + +DISTRIBUTOR="$(lsb_release -is 2>/dev/null)" +DISTRIBUTOR="${DISTRIBUTOR:-Debian}" + +case "${DISTRIBUTOR}" in + Progress*) + SCRIPT_DEFAULT="progress-linux" + ;; + + *) + SCRIPT_DEFAULT="debian" + ;; +esac + +db_subst open-infrastructure-container-tools/script SCRIPT_DEFAULT "${SCRIPT_DEFAULT}" + +db_settitle open-infrastructure-container-tools/title +db_input low open-infrastructure-container-tools/script || true +db_go + db_stop diff --git a/debian/open-infrastructure-container-tools.postinst b/debian/open-infrastructure-container-tools.postinst index c0bffcc..97037fd 100644 --- a/debian/open-infrastructure-container-tools.postinst +++ b/debian/open-infrastructure-container-tools.postinst @@ -46,12 +46,17 @@ case "${1}" in db_get open-infrastructure-container-tools/cache CACHE="${RET:-/var/cache/container-tools}" # string (w/o empty) + db_get open-infrastructure-container-tools/script + SCRIPT="${RET:-debian}" # string (w/o empty) + db_stop Setup "/var/lib/machines" "${MACHINES}" Setup "/etc/container-tools/config" "${CONFIG}" Setup "/etc/container-tools/debconf" "${DEBCONF}" Setup "/var/cache/container-tools" "${CACHE}" + + update-alternatives --quiet --set container-tools_script "/usr/share/container-tools/scripts/${SCRIPT}" ;; abort-upgrade|abort-remove|abort-deconfigure) diff --git a/debian/open-infrastructure-container-tools.templates b/debian/open-infrastructure-container-tools.templates index 580467f..9b9ba25 100644 --- a/debian/open-infrastructure-container-tools.templates +++ b/debian/open-infrastructure-container-tools.templates @@ -44,3 +44,13 @@ Description: cache directory: If unsure, use /var/cache/container-tools (default) or /srv/container/container-tools/cache when using shared storage. + +Template: open-infrastructure-container-tools/script +Type: select +Choices: ${SCRIPT_CHOICES} +Default: ${SCRIPT_DEFAULT} +Description: create script: + Please select the script that will be used by default to + create containers. + . + If unsure, use debian (default). |