From 4b770f049f69d0c31e30e394e55c0bc60c24f6e4 Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Sun, 7 Jan 2018 20:01:59 +0100 Subject: multiarchanalyze: give examples when representing arch sets MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Uwe Kleine-König said that knowing example architectures for file conflicts would be incredibly useful. The old presentation of architecture sets would collapse sets that are too big to a single count. This makes it difficult to find any colliding pair. Now, we'll now give at least two example architectures in addition to the count. Reported-By: Uwe Kleine-König --- multiarchanalyze.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/multiarchanalyze.py b/multiarchanalyze.py index d1947a2..b12fc79 100755 --- a/multiarchanalyze.py +++ b/multiarchanalyze.py @@ -42,10 +42,12 @@ def show_archset(archs, limit=3): @type archs: set(str) @rtype: str """ - archs = set(archs) - if len(archs) > limit: - return "%d archs" % len(archs) - return ", ".join(sorted(archs)) + archs = sorted(set(archs)) + if len(archs) <= limit: + return ", ".join(archs) + assert limit > 2 + limit = limit - 1 + return "%s, and %d more" % (", ".join(archs[:limit]), len(archs) - limit) def show_combinations(combinations): edges = {} -- cgit v1.2.3