From 0dd6c40cba3c1919c44b88eda1f8f75aed6e70b9 Mon Sep 17 00:00:00 2001
From: Helmut Grohne <helmut@subdivi.de>
Date: Sun, 26 Feb 2023 21:22:12 +0100
Subject: multiarchanalyze: emit a hint for rust packages needing the ma
 workaround

---
 multiarchanalyze.sql | 13 +++++++++++++
 1 file changed, 13 insertions(+)

(limited to 'multiarchanalyze.sql')

diff --git a/multiarchanalyze.sql b/multiarchanalyze.sql
index 57f5f9b..b94a367 100644
--- a/multiarchanalyze.sql
+++ b/multiarchanalyze.sql
@@ -223,4 +223,17 @@ CREATE VIEW maforeign_library AS
 			WHERE pid = p.id
 				AND filename REGEXP '^\./(usr/)?s?bin/.*');
 
+/* Packages that should employ the m-a:interpreter workaround, because they
+ *  * are known to expose the architecture of their dependencies (e.g. rust libraries)
+ *  * are currently architecture-independent and multiarch:foreign
+ *  * have an architecture-dependent dependency
+ */
+DROP VIEW IF EXISTS maworkaround_packages;
+CREATE VIEW maworkaround_packages AS
+	SELECT name
+	FROM indeppackage AS i
+	WHERE name LIKE 'librust%-dev'
+		AND multiarch = 'foreign'
+		AND EXISTS (SELECT 1 FROM archdepcandidate WHERE dependerid = i.id);
+
 COMMIT;
-- 
cgit v1.2.3

