blob: 4b0f611a386f0cc23910ea4b179cc616a58a58c6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
#!/usr/bin/env python3
# Usage: see api-review-gen
# Copyright (C) 2023 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
"""Combine 'mod ...' lines with common values of mod, saving duplication in ...
It was too complicated to put inside a python3 -c '...' string without
either the shell or python getting upset about nesting of quotes of
different types.
"""
import sys;
mods = {}
for line in sys.stdin:
mod, cmake = line.split(" ", 1)
mods.setdefault(mod, set()).add(cmake.strip())
print("\n".join(f"{mod} {' '.join(seq)}" for mod, seq in mods.items()))
|