Packaging: remove dead/broken/legacy code from packaging/{rpm,deb}/scripts#6314
Merged
cognifloyd merged 5 commits intomasterfrom Mar 10, 2025
Merged
Packaging: remove dead/broken/legacy code from packaging/{rpm,deb}/scripts#6314cognifloyd merged 5 commits intomasterfrom
packaging/{rpm,deb}/scripts#6314cognifloyd merged 5 commits intomasterfrom
Conversation
/etc/logrotate.d/st2 is already recorded in conffiles, so let dpkg handle conf preservation and restoration. Besides, there was a bug in the code anyway rendering this logic useless. post-remove.sh should have had mv /etc/logrotate.d/st2 /etc/logrotate.d/st2-pkgsaved.disabled but was missing the first argument, so it did nothing. This was hidden by the '|| true' that made it always pass. Since the logic doesn't work, and it is not necessary, just drop it.
A comment in the pre-install.sh files said: > Fix directories permissions on upgrade (different across maint scripts!) > NB! USED FOR COMPATIBILITY ON UPGRADE FROM PREVIOUS VERSIONS OF PACKAGES. > NB! In future package releases reseting permissions SHOULD BE REMOVED. This has been there for many releases. So, let's just remove this. Instead, we rely on the permissions that the st2 package provides, which are defined in BUILD nfpm_content_* metadata. This has the benefit of vastly simplifying the deb install scripts as the upgrade stamp file is no longer required. So, there is no longer a dependency between pre-install and post-install scripts.
guzzijones
approved these changes
Mar 9, 2025
nzlosh
approved these changes
Mar 10, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is working towards doing packaging via pantsbuild. Eventually, I hope to archive and stop using st2-packages.git. This PR begins refactoring
packaging/{rpm,deb}/scripts/*.shcherry-picked in:This refactor PR focuses on removing code from the scripts including dead code, broken code, and legacy code that is now pointless. I recommend reviewing each commit, as the commit description explains what is being removed and why.