diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2023-11-14 14:28:43 +0100 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2023-11-14 14:41:37 +0100 |
| commit | a680b3d2d0263f236b3024e7b81dd6a19d26bf4c (patch) | |
| tree | a7410185431e57201a2fe8d2c2a5b5ea0121a075 | |
| parent | 5dcf9e3dd16f7982a034de98b30546ea91f15b2d (diff) | |
| download | mullvadvpn-a680b3d2d0263f236b3024e7b81dd6a19d26bf4c.tar.xz mullvadvpn-a680b3d2d0263f236b3024e7b81dd6a19d26bf4c.zip | |
Change - to ~ in rpm version to make dnf treat it as upgrade
| -rw-r--r-- | gui/tasks/distribution.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gui/tasks/distribution.js b/gui/tasks/distribution.js index 0cc1c03546..59348c4f0c 100644 --- a/gui/tasks/distribution.js +++ b/gui/tasks/distribution.js @@ -179,7 +179,7 @@ const config = { fpm: [ '--no-depends', '--version', - getDebVersion(), + getLinuxVersion(), '--before-install', distAssets('linux/before-install.sh'), '--before-remove', @@ -202,6 +202,8 @@ const config = { rpm: { fpm: [ + '--version', + getLinuxVersion(), // Prevents RPM from packaging build-id metadata, some of which is the // same across all electron-builder applications, which causes package // conflicts @@ -427,9 +429,12 @@ function getMacArch() { } } -// Replace '-' between components with a tilde to make the version comparison understand that -// YYYY.NN-dev-HHHHHH > YYYY.NN > YYYY.NN-betaN-dev-HHHHHH > YYYY.NN-betaN. -function getDebVersion() { +// Replace '-' with `~` (tilde) before the beta component, to make the version comparison +// understand that stable `YYYY.NN` is newer than beta `YYYY.NN-betaN`. Both Debian and +// Fedora do this where a tilde denotes a version component that must be sorted as earlier +// than a non-tilde version component +// https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/#_complex_versioning +function getLinuxVersion() { const [version, ...prereleaseParts] = productVersion([]).split('-'); const [major, minor] = version.split('.'); const prerelease = prereleaseParts.join('-'); |
