From 7fd673e4ba4a301b8a53f7b3fecf3b0208f237e6 Mon Sep 17 00:00:00 2001
From: Helmut Grohne <helmut@subdivi.de>
Date: Sun, 16 Jan 2022 19:19:41 +0100
Subject: multiarchanalyze: disable transitive m-a:same hints

It is a long-standing disagreement with lintian. Until now, the hinter
emitted hints when some package could plausibly be marked M-A:same even
when dependencies couldn't. lintian complains about that when such a
dependency comes from the same source package. We now follow lintian.
This deletes around 2000 hints and will cause people to have to apply
hints multiple times. For instance your libfoo-dev package will only be
flagged after your libfooN was flagged. So be it.
---
 multiarchanalyze.sql | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

(limited to 'multiarchanalyze.sql')

diff --git a/multiarchanalyze.sql b/multiarchanalyze.sql
index 48e95c9..57f5f9b 100644
--- a/multiarchanalyze.sql
+++ b/multiarchanalyze.sql
@@ -35,7 +35,8 @@ CREATE VIEW contentconflict AS
  * provides. */
 DROP VIEW IF EXISTS archdepcandidate;
 CREATE VIEW archdepcandidate AS
-	SELECT p1.id AS dependerid, p2.id AS dependeeid
+	SELECT p1.id AS dependerid, p2.id AS dependeeid,
+		p2.multiarch IS 'same' AS ismasame
 	FROM package AS p1, depends AS d, package AS p2
 	WHERE p1.id = d.pid
 		AND d.dependee = p2.name
@@ -46,7 +47,8 @@ CREATE VIEW archdepcandidate AS
 			OR p2.architecture = 'all'
 			OR p2.architecture = d.archqual)
 	UNION ALL
-	SELECT p1.id AS dependerid, p2.id AS dependeeid
+	SELECT p1.id AS dependerid, p2.id AS dependeeid,
+		p2.multiarch IS 'same' AS ismasame
 	FROM package AS p1, depends AS d, provides AS r, package AS p2
 	WHERE p1.id = d.pid
 		AND d.dependee = r.provided
@@ -87,7 +89,11 @@ CREATE VIEW archpackage AS
 		exists(
 			SELECT 1 FROM package AS p2, archdepcandidate AS c
 			WHERE p2.name = p1.name AND c.dependerid = p2.id)
-			AS hasarchdeps
+			AS hasarchdeps,
+		exists(
+			SELECT 1 FROM package AS p2, archdepcandidate AS c
+			WHERE p2.name = p1.name AND c.dependerid = p2.id
+				AND NOT c.ismasame) AS hasnoncoinstdeps
 	FROM packageapi AS p1
 	WHERE p1.instances >= 3 AND p1.hasindep = 0;
 
@@ -165,6 +171,7 @@ CREATE VIEW masame_candidate AS
 	SELECT p1.name FROM archpackage AS p1
 	WHERE p1.multiarch = 'no'
 		AND p1.hasscripts = 0
+		AND NOT p1.hasnoncoinstdeps
 		AND NOT EXISTS (
 			SELECT 1 FROM contentconflict
 			WHERE name1 = p1.name AND name2 = p1.name);
-- 
cgit v1.2.3

