From d3a1ea38dde7ec2588fda7caaa5700f7375998c2 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Nov 2021 18:51:20 +0100 Subject: Adding upgrade-handling for hooks from buster to bullseye and newer. Signed-off-by: Daniel Baumann --- .../open-infrastructure-container-tools.postinst | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/debian/open-infrastructure-container-tools.postinst b/debian/open-infrastructure-container-tools.postinst index ee13b73..7514e29 100755 --- a/debian/open-infrastructure-container-tools.postinst +++ b/debian/open-infrastructure-container-tools.postinst @@ -93,6 +93,33 @@ case "${1}" in rmdir /etc/open-infrastructure > /dev/null 2>&1 || true fi + # upgrade from buster: hooks + for HOOK in ${HOOKS}/* + do + NAME="$(basename ${HOOK})" + TARGET="$(readlink -m ${HOOK})" + + case "${TARGET}" in + /usr/share/open-infrastructure/container/hooks/pre-create.git-pull.sh) + rm -f "${HOOKS}/${NAME}" + ln -sf /usr/share/compute-tools/hooks/pre-get.git-pull.sh "${HOOKS}/pre-get.git-pull.sh" + ln -sf /usr/share/compute-tools/hooks/pre-build.git-pull.sh "${HOOKS}/pre-build.git-pull.sh" + ;; + + /usr/share/open-infrastructure/container/hooks/*) + ln -sf "$(echo ${TARGET} | sed -e 's|/usr/share/open-infrastructure/container/hooks/|/usr/share/compute-tools/hooks/|')" "${HOOKS}/${NAME}" + ;; + + *) + if [ -e "/usr/share/compute-tools/hooks/${NAME}" ] + then + rm -f "${HOOKS}/${NAME}" + ln -sf "/usr/share/compute-tools/hooks/${NAME}" "${HOOKS}/${NAME}" + fi + ;; + esac + done + # upgrade from buster: keys if [ -e /etc/open-infrastructure/container/keys ] then -- cgit v1.2.3