From f53b44404ebb93cd01871bd2b0c7f0f2367e1406 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 27 Aug 2021 06:08:33 +0200 Subject: Making distribution detection and version handling more robust. Signed-off-by: Daniel Baumann --- debian/progress-linux.config | 70 +++++++++++++++++++++++++----------------- debian/progress-linux.postinst | 2 -- 2 files changed, 42 insertions(+), 30 deletions(-) diff --git a/debian/progress-linux.config b/debian/progress-linux.config index a3e55e3..4532d78 100755 --- a/debian/progress-linux.config +++ b/debian/progress-linux.config @@ -36,33 +36,47 @@ Run_debconf () DEBIAN_VERSION="$(cat /etc/debian_version)" PROGRESS_LINUX_VERSION="$(if [ -e /etc/progress-linux_version ]; then cat /etc/progress-linux_version; fi)" -case "${DEBIAN_VERSION}" in - 10.*|buster/sid) - RELEASE="5" - CODENAME="engywuck" - - Run_debconf - ;; - - 11.*|bullseye/sid) - case "${PROGRESS_LINUX_VERSION}" in - 5*) - RELEASE="5" - CODENAME="engywuck" - ;; - - *) - RELEASE="6" - CODENAME="fuchur" - ;; - esac - - Run_debconf - ;; - - *) - echo "W: unsupported debian release" - ;; -esac +if [ -n "${PROGRESS_LINUX_VERSION}" ] +then + case "${PROGRESS_LINUX_VERSION}" in + 5*) + RELEASE="5" + CODENAME="engywuck" + + Run_debconf + ;; + + 6*) + RELEASE="6" + CODENAME="fuchur" + + Run_debconf + ;; + + *) + echo "W: unsupported debian release" + ;; + esac +else + case "${DEBIAN_VERSION}" in + 10.*|buster/sid) + RELEASE="5" + CODENAME="engywuck" + + Run_debconf + ;; + + 11.*|bullseye/sid) + RELEASE="6" + CODENAME="fuchur" + + Run_debconf + ;; + + *) + echo "W: unsupported debian release" + ;; + esac +fi db_stop diff --git a/debian/progress-linux.postinst b/debian/progress-linux.postinst index 3e4dd5c..b102b48 100755 --- a/debian/progress-linux.postinst +++ b/debian/progress-linux.postinst @@ -207,11 +207,9 @@ case "${1}" in case "${DEBIAN_VERSION}" in 10.*|buster/sid) - ;; 11.*|bullseye/sid) - ;; *) -- cgit v1.2.3