Open am97 opened 2 weeks ago
We're about to do the 1.121.0 release, but I want to comment here to thank you for this PR and make sure we didn't run the risk of appearing ungrateful.
I'll set some reminders to make sure we review this before 1.122.0.
Paging @daeraxa, the reporter of #544 more than a year ago, in case they're in a better position to verify.
Identify the Bug
Fixes #544
Description of the Change
Currently, when pulsar rpm is upgraded, the
post-uninstall.sh
script is run afterpost-install.sh
.Inspecting the RPM for the current release with
rpm -qp Linux.pulsar-1.120.0.x86_64.rpm --scripts
shows that electron-builder placed the scripts in the%post
and%postun
sections, described here: https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#orderingAs you can see,
%postun
is there also on upgrades (as the old package is uninstalled). There's a method that a scriptlet in%postun
can use to check if we're doing an upgrade or a removal, which relies on the first argument supplied to the scriptlet ($1
). Check for example the output for the Caddy package on my system (rpm -q caddy --scripts
): caddy_rpm_scripts.logThis PR adds a separate
post-uninstall-rpm.sh
script which terminates early if we're performing an upgrade. I did not include the check onpost-uninstall.sh
as other package managers may pass different kind of args to the scripts.Alternate Designs
Keep a single
post-uninstall.sh
script and add extra checks to determine if we are in a RPM, however that would add more complexity.Possible Drawbacks
Different post-uninstall scripts to keep in sync
Verification Process
/usr/bin/pulsar
missing, as thepost-uninstall.sh
from the old package was used/usr/bin/pulsar
exists this time !Release Notes