summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--debian/control1
-rw-r--r--debian/open-infrastructure-container-tools.alternatives29
-rwxr-xr-xdebian/open-infrastructure-container-tools.postinst18
-rwxr-xr-xdebian/open-infrastructure-container-tools.prerm29
4 files changed, 37 insertions, 40 deletions
diff --git a/debian/control b/debian/control
index 3cd2127..f936890 100644
--- a/debian/control
+++ b/debian/control
@@ -3,6 +3,7 @@ Section: admin
Priority: optional
Maintainer: Daniel Baumann <daniel.baumann@progress-linux.org>
Build-Depends:
+ debhelper (>= 13.1~),
debhelper-compat (= 13),
python3-docutils,
Rules-Requires-Root: no
diff --git a/debian/open-infrastructure-container-tools.alternatives b/debian/open-infrastructure-container-tools.alternatives
new file mode 100644
index 0000000..5d657ca
--- /dev/null
+++ b/debian/open-infrastructure-container-tools.alternatives
@@ -0,0 +1,29 @@
+# build: mmdebstrap
+Name: container_build-script
+Link: /usr/share/compute-tools/build-scripts/default
+Alternative: /usr/share/compute-tools/build-scripts/mmdebstrap
+Priority: 1000
+
+# build: debootstrap
+Name: container_build-script
+Link: /usr/share/compute-tools/build-scripts/default
+Alternative: /usr/share/compute-tools/build-scripts/debootstrap
+Priority: 2000
+
+# build: progress-linux
+Name: container_build-script
+Link: /usr/share/compute-tools/build-scripts/default
+Alternative: /usr/share/compute-tools/build-scripts/progress-linux
+Priority: 3000
+
+# build: debian
+Name: container_build-script
+Link: /usr/share/compute-tools/build-scripts/default
+Alternative: /usr/share/compute-tools/build-scripts/debian
+Priority: 4000
+
+# get: curl
+Name: container_get-script
+Link: /usr/share/compute-tools/get-scripts/default
+Alternative: /usr/share/compute-tools/get-scripts/curl
+Priority: 1000
diff --git a/debian/open-infrastructure-container-tools.postinst b/debian/open-infrastructure-container-tools.postinst
index 0c9292c..af0137f 100755
--- a/debian/open-infrastructure-container-tools.postinst
+++ b/debian/open-infrastructure-container-tools.postinst
@@ -98,15 +98,6 @@ Upgrade ()
case "${1}" in
configure)
- # build-scripts
- update-alternatives --quiet --install /usr/share/compute-tools/build-scripts/default container_build-script /usr/share/compute-tools/build-scripts/mmdebstrap 1000
- update-alternatives --quiet --install /usr/share/compute-tools/build-scripts/default container_build-script /usr/share/compute-tools/build-scripts/debootstrap 2000
- update-alternatives --quiet --install /usr/share/compute-tools/build-scripts/default container_build-script /usr/share/compute-tools/build-scripts/progress-linux 3000
- update-alternatives --quiet --install /usr/share/compute-tools/build-scripts/default container_build-script /usr/share/compute-tools/build-scripts/debian 4000
-
- # get-scripts
- update-alternatives --quiet --install /usr/share/compute-tools/get-scripts/default container_get-script /usr/share/compute-tools/get-scripts/curl 1000
-
. /usr/share/debconf/confmodule
db_get open-infrastructure-container-tools/machines
@@ -144,8 +135,6 @@ case "${1}" in
Upgrade
- update-alternatives --quiet --set container_build-script "/usr/share/compute-tools/build-scripts/${SCRIPT}"
-
if [ ! -e "${CONFFILE}" ]
then
@@ -189,4 +178,11 @@ esac
#DEBHELPER#
+case "${1}" in
+ configure)
+ # run after debhelper update-alternative scripts
+ update-alternatives --quiet --set container_build-script "/usr/share/compute-tools/build-scripts/${SCRIPT}"
+ ;;
+esac
+
exit 0
diff --git a/debian/open-infrastructure-container-tools.prerm b/debian/open-infrastructure-container-tools.prerm
deleted file mode 100755
index 3650635..0000000
--- a/debian/open-infrastructure-container-tools.prerm
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/sh
-
-set -e
-
-case "${1}" in
- remove|upgrade|deconfigure)
- # build-scripts
- update-alternatives --quiet --remove container_build-script /usr/share/compute-tools/build-scripts/mmdebstrap
- update-alternatives --quiet --remove container_build-script /usr/share/compute-tools/build-scripts/debootstrap
- update-alternatives --quiet --remove container_build-script /usr/share/compute-tools/build-scripts/progress-linux
- update-alternatives --quiet --remove container_build-script /usr/share/compute-tools/build-scripts/debian
-
- # get-scripts
- update-alternatives --quiet --remove container_get-script /usr/share/compute-tools/get-scripts/curl
- ;;
-
- failed-upgrade)
-
- ;;
-
- *)
- echo "prerm called with unknown argument \`${1}'" >&2
- exit 1
- ;;
-esac
-
-#DEBHELPER#
-
-exit 0