Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow aborted upgrades to fail gracefully #1921

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions templates/deb/postinst_upgrade.sh.erb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ then
# package is installed later, called "Config-Files" state.
# basically, that still looks a _lot_ like an upgrade to me.
after_upgrade "${2}"
elif [ "${1}" = "abort-upgrade" ]; then
# nothing to do for postinst if we're just aborting an upgrade
:
elif echo "${1}" | grep -E -q "(abort|fail)"
then
echo "Failed to install before the post-installation script was run." >&2
Expand Down
2 changes: 1 addition & 1 deletion templates/deb/postrm_upgrade.sh.erb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ then
# 'apt-get purge' runs 'on remove' section, then this section.
# There is no equivalent in RPM or ARCH.
after_purge
elif [ "${1}" = "upgrade" ]
elif [ "${1}" = "upgrade" -o "${1}" = "abort-upgrade" ]
then
# This represents the case where the old package's postrm is called after
# the 'preinst' script is called.
Expand Down