Skip to content

fix(packaging): deb and rpm versions of a pre-release sort before the final release (0.5.0~beta.1) #1494

Open

Description

@ZhuchkaTriplesix

Part of the Beta channel epic #1499.

Problem

scripts/linux/build_deb.sh writes Version: ${VERSION} and scripts/linux/build_rpm.sh turns - into . (RPM_VERSION="${VERSION//-/.}"). For a pre-release this orders wrong:

  • dpkg: 0.5.0-beta.1 is upstream 0.5.0 with Debian revision beta.1; a final 0.5.0 has no revision, and beta.1 sorts after an empty revision. So dpkg treats the beta as newer than the final release and APT never upgrades beta users to 0.5.0. The correct form is 0.5.0~beta.1: ~ sorts before everything, even the end of the string.
  • rpm: 0.5.0.beta.1 sorts after 0.5.0, so dnf upgrade never moves beta users to 0.5.0. The correct form is 0.5.0~beta.1 (rpm supports ~).

Scope

  • build_deb.sh: DEB_VERSION="${VERSION/-/~}" for Version: (file name keeps the tag form Querya-Desktop-0.5.0-beta.1-linux.deb so the updater's asset suffix rules and SHA256SUMS.txt stay simple).
  • build_rpm.sh: RPM_VERSION="${VERSION/-/\~}"; check the spec's Release and the %{version} macros accept ~.
  • A shell test (test/packaging/ has the pattern, or a bats-free script in scripts/ci/) that builds the version strings and compares them with dpkg --compare-versions / rpmdev-vercmp when available: 0.5.0~beta.1 < 0.5.0, 0.5.0~beta.2 > 0.5.0~beta.1, 0.4.19 < 0.5.0~beta.1.
  • Windows setup (AppVersion in querya.iss) and macOS keep the tag string; check that neither refuses -beta.1.

Acceptance

  • dpkg-deb -I shows Version: 0.5.0~beta.1; rpm -qp --qf '%{VERSION}' shows 0.5.0~beta.1.
  • Installing the 0.5.0 package over 0.5.0~beta.1 is an upgrade in both systems.
  • The version comparison test runs in CI (test/packaging/ section).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium priority / Parity & RefactoringbugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions