Skip to content

Commit 5ec7445

Browse files
authored
feat(bundler): fallback to publisher for deb maintainer, closes tauri-apps#10777 (tauri-apps#10825)
1 parent 0d2efd9 commit 5ec7445

File tree

7 files changed

+25
-6
lines changed

7 files changed

+25
-6
lines changed

.changes/maintainer-fallback.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri-bundler": patch:enhance
3+
---
4+
5+
The debian `Maintainer` field now defaults to the Cargo.toml authors, but fallbacks to the `publisher` config value and the second part of the bundle identifier.

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/tauri-bundler/src/bundle/linux/debian.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,17 @@ fn generate_control_file(
163163
writeln!(file, "Architecture: {arch}")?;
164164
// Installed-Size must be divided by 1024, see https://www.debian.org/doc/debian-policy/ch-controlfields.html#installed-size
165165
writeln!(file, "Installed-Size: {}", total_dir_size(data_dir)? / 1024)?;
166-
let authors = settings.authors_comma_separated().unwrap_or_default();
166+
let authors = settings
167+
.authors_comma_separated()
168+
.or_else(|| settings.publisher().map(ToString::to_string))
169+
.unwrap_or_else(|| {
170+
settings
171+
.bundle_identifier()
172+
.split('.')
173+
.nth(1)
174+
.unwrap_or(settings.bundle_identifier())
175+
.to_string()
176+
});
167177

168178
writeln!(file, "Maintainer: {authors}")?;
169179
if let Some(section) = &settings.deb().section {

crates/tauri-bundler/src/bundle/settings.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,9 @@ pub struct BundleSettings {
539539
/// the app's identifier.
540540
pub identifier: Option<String>,
541541
/// The app's publisher. Defaults to the second element in the identifier string.
542-
/// Currently maps to the Manufacturer property of the Windows Installer.
542+
///
543+
/// Currently maps to the Manufacturer property of the Windows Installer
544+
/// and the Maintainer field of debian packages if the Cargo.toml does not have the authors field.
543545
pub publisher: Option<String>,
544546
/// A url to the home page of your application. If None, will
545547
/// fallback to [PackageSettings::homepage].

crates/tauri-cli/config.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1546,7 +1546,7 @@
15461546
]
15471547
},
15481548
"publisher": {
1549-
"description": "The application's publisher. Defaults to the second element in the identifier string.\n Currently maps to the Manufacturer property of the Windows Installer.",
1549+
"description": "The application's publisher. Defaults to the second element in the identifier string.\n\n Currently maps to the Manufacturer property of the Windows Installer\n and the Maintainer field of debian packages if the Cargo.toml does not have the authors field.",
15501550
"type": [
15511551
"string",
15521552
"null"

crates/tauri-schema-generator/schemas/config.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1546,7 +1546,7 @@
15461546
]
15471547
},
15481548
"publisher": {
1549-
"description": "The application's publisher. Defaults to the second element in the identifier string.\n Currently maps to the Manufacturer property of the Windows Installer.",
1549+
"description": "The application's publisher. Defaults to the second element in the identifier string.\n\n Currently maps to the Manufacturer property of the Windows Installer\n and the Maintainer field of debian packages if the Cargo.toml does not have the authors field.",
15501550
"type": [
15511551
"string",
15521552
"null"

crates/tauri-utils/src/config.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,9 @@ pub struct BundleConfig {
11421142
/// Produce updaters and their signatures or not
11431143
pub create_updater_artifacts: Updater,
11441144
/// The application's publisher. Defaults to the second element in the identifier string.
1145-
/// Currently maps to the Manufacturer property of the Windows Installer.
1145+
///
1146+
/// Currently maps to the Manufacturer property of the Windows Installer
1147+
/// and the Maintainer field of debian packages if the Cargo.toml does not have the authors field.
11461148
pub publisher: Option<String>,
11471149
/// A url to the home page of your application. If unset, will
11481150
/// fallback to `homepage` defined in `Cargo.toml`.

0 commit comments

Comments
 (0)