From 4b6f5bd0131003decb3126c410c02fdae7a24f33 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 30 Jun 2017 17:04:17 +0200 Subject: Making setting of default container create script conditional depending on existence of container scripts. This fixes a failure to upgrade the package when the package is not in a clean state anymore. Signed-off-by: Daniel Baumann --- debian/open-infrastructure-container-tools.config | 41 ++++++++++++----------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/debian/open-infrastructure-container-tools.config b/debian/open-infrastructure-container-tools.config index 79c393a..9aaeb83 100644 --- a/debian/open-infrastructure-container-tools.config +++ b/debian/open-infrastructure-container-tools.config @@ -26,31 +26,34 @@ 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 'default' -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')" - -if [ -x /usr/bin/lsb_release ] +if [ -e /usr/share/container-tools/scripts ] then - DISTRIBUTOR="$(lsb_release -is 2>/dev/null)" -fi + SCRIPT_CHOICES="$(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)" + db_subst open-infrastructure-container-tools/script SCRIPT_CHOICES "$(echo ${SCRIPT_CHOICES} | sed -e 's| |, |g')" -DISTRIBUTOR="${DISTRIBUTOR:-Debian}" + if [ -x /usr/bin/lsb_release ] + then + DISTRIBUTOR="$(lsb_release -is 2>/dev/null)" + fi -case "${DISTRIBUTOR}" in - Progress*) - SCRIPT_DEFAULT="progress-linux" - ;; + DISTRIBUTOR="${DISTRIBUTOR:-Debian}" - *) - SCRIPT_DEFAULT="debian" - ;; -esac + case "${DISTRIBUTOR}" in + Progress*) + SCRIPT_DEFAULT="progress-linux" + ;; -db_subst open-infrastructure-container-tools/script SCRIPT_DEFAULT "${SCRIPT_DEFAULT}" + *) + SCRIPT_DEFAULT="debian" + ;; + esac -db_settitle open-infrastructure-container-tools/title -db_input low open-infrastructure-container-tools/script || true -db_go + 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 +fi if [ -e "${CONFFILE}" ] then -- cgit v1.2.3