feat: add managed sources

Signed-off-by: sisungo <[email protected]>
This commit is contained in:
2026-09-30 06:32:54 +00:00
parent c62b2fc8f6
commit 67a7ccf9ab
59 changed files with 215 additions and 114 deletions
+13 -8
View File
@@ -52,14 +52,7 @@ def zip_common_root(zip_file: zipfile.ZipFile) -> str | None:
return root
def sources_dir_name() -> str:
with open("./target/sources.tag") as file:
return file.read()
def source_url(url: str):
if os.path.exists("./target/sources.tag"):
return
def download_decompress(url: str) -> str:
download_path = f"./target/{filename(url)}"
download(url, download_path)
@@ -83,6 +76,18 @@ def source_url(url: str):
with tarfile.open(download_path, "r") as tar:
tar.extractall(extract_dir)
return sources_dir
def sources_dir_name() -> str:
with open("./target/sources.tag") as file:
return file.read()
def source_url(url: str):
if os.path.exists("./target/sources.tag"):
return
sources_dir = download_decompress(url)
with open("./target/sources.tag", "wt+") as file:
file.write(sources_dir)