summaryrefslogtreecommitdiffstats
path: root/debian/progress-linux.postinst
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-01-29 04:43:26 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-01-29 06:46:30 +0000
commita9ec15615ca08833f452fc8ec1be0c29a4ff341d (patch)
treec2b10b1f09b6d8e9eed55cb5e87d71f8184cb939 /debian/progress-linux.postinst
parentAdding upstream version 20181201. (diff)
downloadprogress-linux-a9ec15615ca08833f452fc8ec1be0c29a4ff341d.tar.xz
progress-linux-a9ec15615ca08833f452fc8ec1be0c29a4ff341d.zip
Adding debian version 20181201-1.debian/20181201-1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/progress-linux.postinst')
-rwxr-xr-xdebian/progress-linux.postinst100
1 files changed, 100 insertions, 0 deletions
diff --git a/debian/progress-linux.postinst b/debian/progress-linux.postinst
new file mode 100755
index 0000000..70414bd
--- /dev/null
+++ b/debian/progress-linux.postinst
@@ -0,0 +1,100 @@
+#!/bin/sh
+
+set -e
+
+Install ()
+{
+ # apt sources
+ echo "Installing /etc/apt/sources.list.d/progress-linux.list ..."
+
+cat > /etc/apt/sources.list.d/progress-linux.list << EOF
+# /etc/apt/sources.list.d/progress-linux.list
+
+EOF
+
+ # apt preferences
+ echo "Installing /etc/apt/preferences.d/progress-linux.pref ..."
+
+cat > /etc/apt/preferences.d/progress-linux.pref << EOF
+# /etc/apt/preferences.d/progress-linux.pref
+EOF
+
+ # apt key
+ echo "Installing /etc/apt/trusted.gpg.d/progress-linux-5-engywuck-archive-key.gpg ..."
+ ln -sf /usr/share/progress-linux/pgp-keys/progress-linux-5-engywuck-archive-key.gpg /etc/apt/trusted.gpg.d/progress-linux-5-engywuck-archive-key.gpg
+}
+
+Remove ()
+{
+ # apt sources
+ echo "Removing /etc/apt/sources.list.d/progress-linux.list ..."
+ rm -f /etc/apt/sources.list.d/progress-linux.list
+
+ # apt preferences
+ echo "Removing /etc/apt/sources.list.d/progress-linux.list ..."
+ rm -f /etc/apt/preferences.d/progress-linux.pref
+
+ # apt key
+ echo "Removing /etc/apt/trusted.gpg.d/progress-linux-5-engywuck-archive-key.gpg ..."
+ rm -f /etc/apt/trusted.gpg.d/progress-linux-5-engywuck-archive-key.gpg
+}
+
+Configure ()
+{
+ ARCHIVE="${1}"
+
+ # apt sources
+ cat >> /etc/apt/sources.list.d/progress-linux.list << EOF
+deb https://deb.progress-linux.org/packages ${ARCHIVE} ${ARCHIVE_AREAS}
+EOF
+
+ # apt preferences
+ cat >> /etc/apt/preferences.d/progress-linux.pref << EOF
+
+Package: *
+Pin: release n=${ARCHIVE}
+Pin-Priority: 999
+EOF
+}
+
+case "${1}" in
+ configure)
+ . /usr/share/debconf/confmodule
+
+ db_get progress-linux/archives
+ ARCHIVES="${RET}" # multiselect w/ empty
+
+ db_get progress-linux/archive-areas
+ ARCHIVE_AREAS="${RET:-main}" # string w/o empty
+
+ db_stop
+
+ if [ -n "${ARCHIVES}" ]
+ then
+ Install
+ else
+ Remove
+ fi
+
+ ARCHIVES="$(echo ${ARCHIVES} | sed -e 's|,| |g')"
+ ARCHIVE_AREAS="$(echo ${ARCHIVE_AREAS} | sed -e 's|,| |g')"
+
+ for ARCHIVE in ${ARCHIVES}
+ do
+ Configure ${ARCHIVE}
+ done
+ ;;
+
+ abort-upgrade|abort-remove|abort-deconfigure)
+
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`${1}'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0