1 |
commit: 4c578f0280638442da5a3f60d0b568c38de09b06 |
2 |
Author: Michał Górny <mgorny <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Feb 24 06:59:07 2020 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Feb 24 06:59:07 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/qa-scripts.git/commit/?id=4c578f02 |
7 |
|
8 |
genrdeps: Deduplicate USE flags in output |
9 |
|
10 |
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org> |
11 |
|
12 |
genrdeps-index.py | 6 +++--- |
13 |
1 file changed, 3 insertions(+), 3 deletions(-) |
14 |
|
15 |
diff --git a/genrdeps-index.py b/genrdeps-index.py |
16 |
index d0d6a31..cdb94c0 100755 |
17 |
--- a/genrdeps-index.py |
18 |
+++ b/genrdeps-index.py |
19 |
@@ -28,7 +28,7 @@ GROUPS = ( |
20 |
) |
21 |
|
22 |
|
23 |
-def process_deps(deps, useflags=()): |
24 |
+def process_deps(deps, useflags=frozenset()): |
25 |
for d in deps: |
26 |
if isinstance(d, atom): |
27 |
yield DepTuple(d.key, d.blocks, useflags) |
28 |
@@ -43,7 +43,7 @@ def process_deps(deps, useflags=()): |
29 |
r = next(iter(d.restriction.vals)) |
30 |
if d.restriction.negate: |
31 |
r = '!' + r |
32 |
- for sd in process_deps(d, useflags + (r,)): |
33 |
+ for sd in process_deps(d, useflags | frozenset((r,))): |
34 |
yield sd |
35 |
else: |
36 |
raise AssertionError("Unknown dep type: " + d.__class__) |
37 |
@@ -85,7 +85,7 @@ def main(): |
38 |
if blocks: |
39 |
dep = '[B]' + dep |
40 |
if flags: |
41 |
- dep += ':' + '+'.join(flags) |
42 |
+ dep += ':' + '+'.join(sorted(flags)) |
43 |
f.write(dep + '\n') |
44 |
|
45 |
for g, gi in GROUPS: |