diff --git a/incus.py b/incus.py new file mode 100755 index 0000000..127b7de --- /dev/null +++ b/incus.py @@ -0,0 +1,48 @@ +#! /usr/bin/env python3 +"""Mirror local Incus.""" + +from pathlib import Path +import os + +from rwx.fs import make_directory, wipe + + +ROOT = "https://images.linuxcontainers.org" + +IMAGES = f"{ROOT}/images" +META = f"{ROOT}/meta" + +STREAMS = f"{META}/simplestreams/v1" + +WANTED = { + "architectures": [ + "amd64", + "arm64", + ], + "images": { + "debian", + "arm64", + }, +} + + + +def main() -> None: + root = Path(__file__).resolve().parent / "root" + # root path + root = root / "incus" + wipe(root) + make_directory(root) + # symlink + (root / "streams").symlink_to(os.sep.join(["meta", "simplestreams"])) + # meta + meta = root / "meta" + # streams + streams = meta / "simplestreams" / "v1" + make_directory(streams) + # images + streams = root / "images" + + +if __name__ == "__main__": + main()