Skip to content

fix: prevent launcher breakage when upgrading Linux packages - #209

Merged
boscorat merged 2 commits into
masterfrom
203-bug-linux-install-issue
Sep 11, 2026
Merged

boscorat merged 2 commits into
masterfrom
203-bug-linux-install-issue

Conversation

@boscorat

Copy link
Copy Markdown
Owner

Problem

Fixes #203

During a package upgrade (e.g. 0.2.0 → 0.2.1) on Fedora or Ubuntu, the old package's post-uninstall.sh ran after the new package's post-install.sh, deleting the /usr/bin/openstan symlink, .desktop file, and icons — breaking the app launcher.

Clean installs worked fine because there was no old package to run the removal script.

Changes

  1. packaging/post-uninstall.sh — skip cleanup when any openstan-* versioned directory still exists under /usr/lib (indicates an upgrade, not a full uninstall)
  2. .github/workflows/release.yml — add --replaces openstan to both x86_64 and ARM64 fpm builds so dpkg/dnf coordinate upgrades properly
  3. Remove openstan.desktop at repo root — unused by packaging (packaging/openstan.desktop is the one used by cx_Freeze); its different Icon path was a maintenance risk

Testing

  • Lint, format, and typecheck all pass
  • Manual test: install v0.2.0, then upgrade to v0.2.1 — launcher should survive the upgrade

During a package upgrade (e.g. 0.2.0 → 0.2.1), the old package's
post-uninstall.sh ran after the new post-install.sh, deleting the
symlink, .desktop file, and icons — breaking the app launcher.

- post-uninstall.sh: skip cleanup when another openstan-* versioned
  directory exists (indicates an upgrade, not a full uninstall)
- fpm: add --replaces openstan so dpkg/dnf coordinate upgrades properly
- Remove unused openstan.desktop at repo root (packaging/ version is
  the one used by cx_Freeze)
@boscorat boscorat linked an issue Sep 11, 2026 that may be closed by this pull request
@boscorat
boscorat requested a lite review from Copilot September 11, 2026 07:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The upgrade-detection and fpm metadata changes include correctness/maintainability issues that should be addressed to avoid unintended uninstall behavior and confusing package metadata.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Fixes Linux desktop launcher breakage during package upgrades by preventing the old package’s uninstall script from tearing down desktop integration mid-upgrade, and by cleaning up packaging/release artifacts to reduce future drift.

Changes:

  • Update packaging/post-uninstall.sh to skip desktop cleanup when an openstan-* install directory still exists (upgrade scenario).
  • Add --replaces openstan to the fpm build commands in the release workflow (x86_64 + arm64).
  • Remove the repo-root openstan.desktop file (unused by the packaging path).
File summaries
File Description
packaging/post-uninstall.sh Skips desktop-integration removal during upgrades to avoid breaking launchers.
.github/workflows/release.yml Adjusts fpm packaging arguments for Linux release artifacts.
openstan.desktop Removes an unused desktop entry file at repo root to reduce maintenance risk.
Review details

Suppressed comments (1)

.github/workflows/release.yml:458

  • FPM_COMMON already sets --name openstan, so adding --replaces openstan makes the package declare it replaces itself. That metadata is redundant and can be confusing for future packaging changes; omit it unless you’re explicitly replacing a differently named legacy package.
            --description "Open source bank statement analysis and visualization"
            --license "LGPL-3.0-or-later"
            --replaces openstan
            --after-install  packaging/post-install.sh
            --after-remove   packaging/post-uninstall.sh
  • Files reviewed: 3/3 changed files
  • Comments generated: 2
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread packaging/post-uninstall.sh Outdated
Comment thread .github/workflows/release.yml
- post-uninstall.sh: verify the openstan binary exists inside each
  versioned directory before skipping cleanup (avoids false positives
  from stale directories)
- release.yml: remove redundant --replaces openstan (package already
  declares --name openstan, so replaces-self is a no-op)
@boscorat

Copy link
Copy Markdown
Owner Author

Addressed both review comments:

  1. Upgrade detection — replaced the ls -dt directory check with a loop that verifies the openstan binary actually exists inside each versioned directory (/openstan/openstan). This avoids false positives from stale manually-created directories.

  2. --replaces openstan — removed from both x86_64 and ARM64 fpm blocks. Since the package already declares --name openstan, replaces-self is redundant and confusing. The package was already in place for self-replacement; this flag only matters for replacing a differently-named legacy package.

@boscorat
boscorat merged commit 090d5cc into master Sep 11, 2026
2 checks passed
@boscorat
boscorat deleted the 203-bug-linux-install-issue branch September 11, 2026 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: linux install issue

2 participants