summaryrefslogtreecommitdiff
path: root/.gitlab-ci/check-missing-install-tag.py
blob: 1bf89a9c9cd5d6f9a975d550f82c1f790fe262ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env python3

"""
This script checks Meson configuration logs to verify no installed file is
missing installation tag.
"""

import argparse
import json
from pathlib import Path


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument("builddir", type=Path)
    args = parser.parse_args()

    success = True
    path = args.builddir / "meson-info" / "intro-install_plan.json"
    with path.open(encoding="utf-8") as f:
        install_plan = json.load(f)
        for target in install_plan.values():
            for info in target.values():
                if not info["tag"]:
                    print('Missing install_tag for', info["destination"])
                    success = False
    return 0 if success else 1


if __name__ == "__main__":
    exit(main())