diff options
author | Helmut Grohne <helmut@subdivi.de> | 2018-01-07 20:01:59 +0100 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2018-01-07 20:01:59 +0100 |
commit | 4b770f049f69d0c31e30e394e55c0bc60c24f6e4 (patch) | |
tree | aaf1c4d3337fc1b3292fb70f004fa3dd11ff52ac | |
parent | 999130ccd2eaee7662e5983308b28db1d71a2cf6 (diff) | |
download | debian-dedup-4b770f049f69d0c31e30e394e55c0bc60c24f6e4.tar.gz |
multiarchanalyze: give examples when representing arch sets
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 <ukleinek@debian.org>
-rwxr-xr-x | multiarchanalyze.py | 10 |
1 files 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 = {} |