summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdebian/progress-linux.postinst96
1 files changed, 73 insertions, 23 deletions
diff --git a/debian/progress-linux.postinst b/debian/progress-linux.postinst
index 8dc75c6..5bf957d 100755
--- a/debian/progress-linux.postinst
+++ b/debian/progress-linux.postinst
@@ -5,18 +5,18 @@ set -e
PROJECT="progress-linux"
DOMAIN="progress-linux.org"
PACKAGES="https://cdn.deb.progress-linux.org/packages"
+KEY="/usr/share/progress-linux/pgp-keys/apt.progress-linux.org.gpg"
Install_apt_sources ()
{
-cat > "/etc/apt/sources.list.d/${PROJECT}.list" << EOF
-# /etc/apt/sources.list.d/${PROJECT}.list
-
+cat > "/etc/apt/sources.list.d/${PROJECT}.sources" << EOF
+# /etc/apt/sources.list.d/${PROJECT}.sources
EOF
}
Remove_apt_sources ()
{
- rm -f "/etc/apt/sources.list.d/${PROJECT}.list"
+ rm -f "/etc/apt/sources.list.d/${PROJECT}.sources"
}
Install_apt_preferences ()
@@ -33,20 +33,70 @@ Remove_apt_preferences ()
Configure_apt_sources ()
{
- ARCHIVE="${1}"
+ # Configure repositories: ${release}, ${release}-security, ${release}-updates, ${release}-backports
+ SUITES=""
- case "${ARCHIVE}" in
- *-extras)
- AREAS="${ARCHIVE_AREAS}"
- ;;
+ for ARCHIVE in ${ARCHIVES}
+ do
+ case "${ARCHIVE}" in
+ *-extras)
+ ;;
- *)
- AREAS="$(echo ${ARCHIVE_AREAS} | sed -e 's| restricted||')"
- ;;
- esac
+ *)
+ SUITES="${SUITES} ${ARCHIVE}"
+
+ Configure_apt_preferences ${ARCHIVE}
+ ;;
+ esac
+ done
+
+ COMPONENTS="$(echo ${ARCHIVE_AREAS} | sed -e 's| restricted||')"
+ SUITES="$(echo ${SUITES} | sed -e 's|^ *||')"
+
+ if [ -n "${SUITES}" ]
+ then
+ Configure_apt_sources_stanza "${SUITES}" "${COMPONENTS}"
+ fi
+
+ # Configure repositories: ${release}-extras, ${release}-backports-extras
+ SUITES=""
-cat >> "/etc/apt/sources.list.d/${PROJECT}.list" << EOF
-deb [signed-by=/usr/share/progress-linux/pgp-keys/apt.progress-linux.org.gpg] ${PACKAGES} ${ARCHIVE} ${AREAS}
+ for ARCHIVE in ${ARCHIVES}
+ do
+ case "${ARCHIVE}" in
+ *-extras)
+ SUITES="${SUITES} ${ARCHIVE}"
+
+ Configure_apt_preferences ${ARCHIVE}
+ ;;
+
+ *)
+ ;;
+ esac
+ done
+
+ COMPONENTS="${ARCHIVE_AREAS}"
+ SUITES="$(echo ${SUITES} | sed -e 's|^ *||')"
+
+ if [ -n "${SUITES}" ]
+ then
+ Configure_apt_sources_stanza "${SUITES}" "${COMPONENTS}"
+ fi
+}
+
+Configure_apt_sources_stanza ()
+{
+ SUITES="${1}"
+ COMPONENTS="${2}"
+
+cat >> "/etc/apt/sources.list.d/${PROJECT}.sources" << EOF
+
+Types: deb
+URIs: ${PACKAGES}
+Suites: ${SUITES}
+Components: ${COMPONENTS}
+PDiffs: no
+Signed-By: ${KEY}
EOF
}
@@ -118,9 +168,13 @@ Remove_ssh_known_hosts ()
fi
}
-Remove_apt_keys ()
+Clean ()
{
- rm -f "/etc/apt/trusted.gpg.d/${PROJECT}.gpg"
+ # Remove apt keys
+ rm -f "/etc/apt/trusted.gpg.d/${PROJECT}.gpg"
+
+ # Remove apt lists
+ rm -f "/etc/apt/sources.list.d/${PROJECT}.list"
}
case "${1}" in
@@ -175,11 +229,7 @@ case "${1}" in
Install_apt_sources
Install_apt_preferences
- for ARCHIVE in ${ARCHIVES}
- do
- Configure_apt_sources ${ARCHIVE}
- Configure_apt_preferences ${ARCHIVE}
- done
+ Configure_apt_sources
else
Remove_apt_sources
Remove_apt_preferences
@@ -189,7 +239,7 @@ case "${1}" in
Configure_ssh_known_hosts
# upgrading from buster
- Remove_apt_keys
+ Clean
;;
abort-upgrade|abort-remove|abort-deconfigure)