vinix-ports / ports / ca-certificates / make-config.py
9 lines · 8 sloc · 472 bytes · c33d8afc2906b8dd9a8b905224eccd49a44f7ad5
Raw
1"""Write update-ca-certificates' default trust selections from the matching Vinix bundle."""
2from pathlib import Path
3import os
4
5certs = Path(os.environ["VPAC_MAKEPKG_ROOT"]) / "usr/share/ca-certificates"
6files = sorted(path.relative_to(certs).as_posix() for path in (certs / "mozilla").glob("*.crt"))
7if "mozilla/ISRG_Root_X1.crt" not in files:
8 raise SystemExit("missing packaged Mozilla authorities")
9Path("ca-certificates.conf").write_text("\n".join(files) + "\n")
10