From f6c7acb4363d39574e13e4fea2a0b2d1e3712b92 Mon Sep 17 00:00:00 2001
From: Andre Moreira Magalhaes <andre.magalhaes@collabora.com>
Date: Wed, 9 Mar 2022 21:36:03 -0300
Subject: [PATCH] dh_dwarf2sources: Add arch suffix to bin2sources files

The bin2sources file may differ between architectures which may cause failures
when trying to install the same packages for multiple archs (multiarch support)
given they are installed in a arch independent directory.

Fix that by adding the architecture as suffix to the file.

Signed-off-by: Andre Moreira Magalhaes <andre.magalhaes@collabora.com>
---
 dh_dwarf2sources | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dh_dwarf2sources b/dh_dwarf2sources
index d54e8b8..3db9cee 100755
--- a/dh_dwarf2sources
+++ b/dh_dwarf2sources
@@ -91,7 +91,8 @@ for my $package (@{$dh{DOPACKAGES}}) {
 		print "Package $package puts doc $package_doc\n";
 		$fname_dir = "usr/share/doc/$package_doc";
 	}
-	my $fname_list = "$fname_dir/" . $package . "_bin2sources.json";
+	my $arch = package_binary_arch($package);
+	my $fname_list = "$fname_dir/" . $package . "_bin2sources_" . $arch . ".json";
 	print "Checking file $fname_list\n";
 	if (-e "$tmp/$fname_list") {
 		print "File $tmp/$fname_list already exists, skipping\n";
-- 
GitLab