Skip to content

Conversation

@LaurenceJJones
Copy link
Member

@LaurenceJJones LaurenceJJones commented Oct 6, 2025

fix #77

Features added:
- Version comparison between current and new binaries
- Smart upgrade detection (skips if versions are same or new version is older)
- Force upgrade option (--force/-f) to override version checks
- Help option (--help/-h) with usage information
- User confirmation prompt for interactive upgrades
- Informative messages about version differences

This addresses user requests for:
- Checking if upgrade is actually needed before proceeding
- Ability to force upgrade when building from source
- Better user experience with clear feedback about version changes

Functions added to _bouncer.sh:
- get_bouncer_version(): Extract version from binary --version output
- version_compare(): Compare semantic versions (major.minor.patch)
- check_upgrade_needed(): Main logic for upgrade decision making

Features added:
- Version comparison between current and new binaries
- Smart upgrade detection (skips if versions are same or new version is older)
- Force upgrade option (--force/-f) to override version checks
- Help option (--help/-h) with usage information
- User confirmation prompt for interactive upgrades
- Informative messages about version differences

This addresses user requests for:
- Checking if upgrade is actually needed before proceeding
- Ability to force upgrade when building from source
- Better user experience with clear feedback about version changes

Functions added to _bouncer.sh:
- get_bouncer_version(): Extract version from binary --version output
- version_compare(): Compare semantic versions (major.minor.patch)
- check_upgrade_needed(): Main logic for upgrade decision making
Copy link
Contributor

@sabban sabban left a comment

Choose a reason for hiding this comment

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

I would rather keep this file as much as the same as the other bouncer.

I am not against it, but if changed here maybe it's worth changing it for every bouncer.

@sabban sabban requested a review from mmetc October 6, 2025 16:57
@mmetc
Copy link
Contributor

mmetc commented Oct 7, 2025

A few things

  • the _bouncer.sh script is supposed to be common functions for all the "similar" bouncers, are you proposing this for the firewall, custom etc. RCs as well?
  • package managers like apt allow prompts and any interactive flow through the distribution plumbing, see debconf templates for example: https://goreleaser.com/cookbooks/debconf-templates/
  • weird pattern matching
  • If the use case is "install from sources", the user is perfectly capable to decide if they want to upgrade or not, I think by comparing the version numbers we are scratching an itch we don't have

@LaurenceJJones LaurenceJJones marked this pull request as draft October 7, 2025 10:31
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.

[upgrade.sh]: Check version is higher or lower

4 participants