fix(bundler): replace empty RPM release value with 1 (#13909)

Co-authored-by: Fabian-Lars <github@fabianlars.de>
This commit is contained in:
Andrew Voynov 2025-07-30 01:20:25 +05:00 committed by GitHub
parent 9c938be452
commit bc6b125b24
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View File

@ -0,0 +1,5 @@
---
tauri-bundler: "patch:bug"
---
The bundler now falls back to `1` for the release in case an empty string was provided instead of using `-.` in the file name.

View File

@ -21,7 +21,10 @@ use super::freedesktop;
pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
let product_name = settings.product_name();
let version = settings.version_string();
let release = settings.rpm().release.as_str();
let release = match settings.rpm().release.as_str() {
"" => "1", // Considered the default. If left empty, you get file with "-.".
v => v,
};
let epoch = settings.rpm().epoch;
let arch = match settings.binary_arch() {
Arch::X86_64 => "x86_64",
@ -234,6 +237,5 @@ pub fn bundle_project(settings: &Settings) -> crate::Result<Vec<PathBuf>> {
let mut f = fs::File::create(&package_path)?;
pkg.write(&mut f)?;
Ok(vec![package_path])
}