%PDF- %PDF-
Direktori : /var/lib/dpkg/info/ |
Current File : /var/lib/dpkg/info/thunderbird.preinst |
#!/bin/sh set -e skip_unusable_snapd() { if [ -e "/run/snapd.socket" ]; then # Snapd is present, run the upgrade return 1 fi return 0 } case "$1" in install|upgrade) . /usr/share/debconf/confmodule echo "=> Installing the thunderbird snap" # Warn about downtime if [ -e "/usr/lib/thunderbird/thunderbird" ]; then db_input high thunderbird/snap-upgrade-warning || true db_go fi # Check store connectivity echo "==> Checking connectivity with the snap store" COUNT=0 SKIP=false while :; do if skip_unusable_snapd; then echo "===> System doesn't have a working snapd, skipping" SKIP=true break fi snap info thunderbird >/dev/null 2>&1 && break db_fset thunderbird/snap-no-connectivity seen false if ! db_input critical thunderbird/snap-no-connectivity; then db_go if [ "${COUNT}" = "0" ]; then echo "===> Unable to contact the store, trying every minute for the next 30 minutes" elif [ "${COUNT}" = "10" ]; then echo "===> Still unable to contact the store, trying for another 20 minutes" elif [ "${COUNT}" = "20" ]; then echo "===> Still unable to contact the store, trying for another 10 minutes" elif [ "${COUNT}" = "30" ]; then echo "===> Still unable to contact the store, aborting" exit 1 fi sleep 1m else db_go db_get thunderbird/snap-no-connectivity if [ "${RET}" = "Abort" ]; then echo "===> Aborting at user request" exit 1 elif [ "${RET}" = "Skip" ]; then echo "===> Skipping at user request" SKIP=true break fi if [ "${COUNT}" = "0" ]; then echo "===> Unable to contact the store" fi fi COUNT=$((COUNT+1)) done if ! ${SKIP}; then # Install the snap echo "==> Installing the thunderbird snap" snap install thunderbird echo "=> Snap installation complete" fi ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument \`$1'" >&2 exit 1 ;; esac # Automatically added by dh_installdeb/13.14.1ubuntu5 dpkg-maintscript-helper rm_conffile /etc/thunderbird/syspref.js -- "$@" dpkg-maintscript-helper rm_conffile /etc/apport/report-ignore/thunderbird -- "$@" # End automatically added section exit 0