summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2021-11-07 17:51:20 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2021-11-07 17:51:20 +0000
commitd3a1ea38dde7ec2588fda7caaa5700f7375998c2 (patch)
treed72aea30146311dc870753eac355829adb61d0eb
parentAdding upgrade-handling for logfiles from buster to bullseye and newer. (diff)
downloadopen-infrastructure-compute-tools-d3a1ea38dde7ec2588fda7caaa5700f7375998c2.tar.xz
open-infrastructure-compute-tools-d3a1ea38dde7ec2588fda7caaa5700f7375998c2.zip
Adding upgrade-handling for hooks from buster to bullseye and newer.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-xdebian/open-infrastructure-container-tools.postinst27
1 files changed, 27 insertions, 0 deletions
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