diff -Nru rust-debcargo-2.7.8/debian/changelog rust-debcargo-2.7.8/debian/changelog --- rust-debcargo-2.7.8/debian/changelog 2025-04-04 19:17:48.000000000 +0200 +++ rust-debcargo-2.7.8/debian/changelog 2025-04-23 20:09:01.000000000 +0200 @@ -1,3 +1,11 @@ +rust-debcargo (2.7.8-4) unstable; urgency=medium + + * Package debcargo 2.7.8 from crates.io using debcargo 2.7.8 + * Default to M-A:foreign for bin packages (Closes: #1103920) + * Change M-A to foreign instead of allowed + + -- Fabian Grünbichler Wed, 23 Apr 2025 20:09:01 +0200 + rust-debcargo (2.7.8-3) unstable; urgency=medium * Package debcargo 2.7.8 from crates.io using debcargo 2.7.8 diff -Nru rust-debcargo-2.7.8/debian/control rust-debcargo-2.7.8/debian/control --- rust-debcargo-2.7.8/debian/control 2025-04-04 19:17:48.000000000 +0200 +++ rust-debcargo-2.7.8/debian/control 2025-04-23 20:09:01.000000000 +0200 @@ -91,7 +91,7 @@ Package: debcargo Architecture: any -Multi-Arch: allowed +Multi-Arch: foreign Section: devel Depends: ${misc:Depends}, diff -Nru rust-debcargo-2.7.8/debian/patches/0001-control-default-to-Multi-Arch-foreign-for-bin-packag.patch rust-debcargo-2.7.8/debian/patches/0001-control-default-to-Multi-Arch-foreign-for-bin-packag.patch --- rust-debcargo-2.7.8/debian/patches/0001-control-default-to-Multi-Arch-foreign-for-bin-packag.patch 1970-01-01 01:00:00.000000000 +0100 +++ rust-debcargo-2.7.8/debian/patches/0001-control-default-to-Multi-Arch-foreign-for-bin-packag.patch 2025-04-23 20:09:01.000000000 +0200 @@ -0,0 +1,57 @@ +From 48645b6bd144449e39331e9c8e291293ce05634d Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= +Date: Wed, 23 Apr 2025 18:07:37 +0200 +Subject: [PATCH 1/2] control: default to 'Multi-Arch: foreign' for 'bin' + package +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +'allowed' should be the exception, not the default. + +Fixes: #1103920 + +Signed-off-by: Fabian Grünbichler +--- + src/debian/control.rs | 2 +- + src/debian/control/tests.rs | 4 ++-- + 2 files changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/debian/control.rs b/src/debian/control.rs +index c48147f..f51f1e4 100644 +--- a/src/debian/control.rs ++++ b/src/debian/control.rs +@@ -485,7 +485,7 @@ impl Package { + Package { + name, + arch: "any".to_string(), +- multi_arch: "allowed".to_string(), ++ multi_arch: "foreign".to_string(), + section: section.map(|s| s.to_string()), + depends: vec![ + "${misc:Depends}".to_string(), +diff --git a/src/debian/control/tests.rs b/src/debian/control/tests.rs +index bfad24b..8e49429 100644 +--- a/src/debian/control/tests.rs ++++ b/src/debian/control/tests.rs +@@ -167,7 +167,7 @@ fn test_package_new_bin() { + let instance = Package::new_bin(basename, name_suffix, section, summary, description); + + assert_eq!("any", instance.arch); +- assert_eq!("allowed", instance.multi_arch); ++ assert_eq!("foreign", instance.multi_arch); + assert_eq!(Some("rust".to_owned()), instance.section); + assert_eq!( + vec!["${misc:Depends}", "${shlibs:Depends}", "${cargo:Depends}"], +@@ -201,7 +201,7 @@ fn test_package_display() { + ); + let instance = Package::new_bin(basename, name_suffix, section, summary, description); + +- let expected = "Package: rsa\nArchitecture: any\nMulti-Arch: allowed\nSection: rust\nDepends:\n ${misc:Depends},\n ${shlibs:Depends},\n ${cargo:Depends}\nRecommends:\n ${cargo:Recommends}\nSuggests:\n ${cargo:Suggests}\nProvides:\n ${cargo:Provides}\nBuilt-Using: ${cargo:Built-Using}\nStatic-Built-Using: ${cargo:Static-Built-Using}\nDescription: \n description_start\n .\n empty lines\n .\n description_stop\n"; ++ let expected = "Package: rsa\nArchitecture: any\nMulti-Arch: foreign\nSection: rust\nDepends:\n ${misc:Depends},\n ${shlibs:Depends},\n ${cargo:Depends}\nRecommends:\n ${cargo:Recommends}\nSuggests:\n ${cargo:Suggests}\nProvides:\n ${cargo:Provides}\nBuilt-Using: ${cargo:Built-Using}\nStatic-Built-Using: ${cargo:Static-Built-Using}\nDescription: \n description_start\n .\n empty lines\n .\n description_stop\n"; + + assert_eq!(expected, instance.to_string()); + } +-- +2.49.0 + diff -Nru rust-debcargo-2.7.8/debian/patches/0002-control-make-Multi-Arch-configurable.patch rust-debcargo-2.7.8/debian/patches/0002-control-make-Multi-Arch-configurable.patch --- rust-debcargo-2.7.8/debian/patches/0002-control-make-Multi-Arch-configurable.patch 1970-01-01 01:00:00.000000000 +0100 +++ rust-debcargo-2.7.8/debian/patches/0002-control-make-Multi-Arch-configurable.patch 2025-04-23 20:09:01.000000000 +0200 @@ -0,0 +1,73 @@ +From d6cab54b8e9dc4fe2b44e72019cf0d65d2b213e6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fabian=20Gr=C3=BCnbichler?= +Date: Wed, 23 Apr 2025 18:18:51 +0200 +Subject: [PATCH 2/2] control: make Multi-Arch configurable +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +to allow overriding if needed, without the need to override all of +debian/control. + +Signed-off-by: Fabian Grünbichler +--- + debcargo.toml.example | 4 ++++ + src/config.rs | 5 +++++ + src/debian/control.rs | 3 +++ + 3 files changed, 12 insertions(+) + +diff --git a/debcargo.toml.example b/debcargo.toml.example +index 862b6c2..ca8d519 100644 +--- a/debcargo.toml.example ++++ b/debcargo.toml.example +@@ -196,6 +196,10 @@ uploaders = [ "foo bar " ] + #PLACEHOLDER + #""" + ++# Value for the Multi-Arch field of the package. If omitted, debcargo will ++# automatically set 'foreign' for 'bin', and 'same' for all 'lib' packages. ++#multi_arch = "no|same|foreign|allowed" ++ + # Additional Depends on top of the ones generated by debcargo. This should be + # used to pull in system libraries for crates that need them to build. You'll + # want the -dev versions of the library packages, since our crate packages are +diff --git a/src/config.rs b/src/config.rs +index 773d739..f445e53 100644 +--- a/src/config.rs ++++ b/src/config.rs +@@ -76,6 +76,7 @@ pub struct PackageOverride { + section: Option, + summary: Option, + description: Option, ++ multi_arch: Option, + depends: Option>, + recommends: Option>, + suggests: Option>, +@@ -219,6 +220,10 @@ impl Config { + self.with_package(key, |pkg| pkg.description.as_deref()) + } + ++ pub fn package_multi_arch(&self, key: PackageKey) -> Option<&str> { ++ self.with_package(key, |pkg| pkg.multi_arch.as_deref()) ++ } ++ + pub fn package_depends(&self, key: PackageKey) -> Option<&Vec> { + self.with_package(key, |pkg| pkg.depends.as_ref()) + } +diff --git a/src/debian/control.rs b/src/debian/control.rs +index f51f1e4..a319024 100644 +--- a/src/debian/control.rs ++++ b/src/debian/control.rs +@@ -587,6 +587,9 @@ impl Package { + .flatten() + .map(|s| s.to_string()), + ); ++ if let Some(multi_arch) = config.package_multi_arch(key) { ++ self.multi_arch = multi_arch.to_owned(); ++ } + } + } + +-- +2.49.0 + diff -Nru rust-debcargo-2.7.8/debian/patches/series rust-debcargo-2.7.8/debian/patches/series --- rust-debcargo-2.7.8/debian/patches/series 2025-04-04 19:17:48.000000000 +0200 +++ rust-debcargo-2.7.8/debian/patches/series 2025-04-23 20:09:01.000000000 +0200 @@ -1 +1,3 @@ relax-git2.patch +0001-control-default-to-Multi-Arch-foreign-for-bin-packag.patch +0002-control-make-Multi-Arch-configurable.patch