build.py: uh slightly better depency stuff

This commit is contained in:
2026-01-03 10:29:20 +01:00
parent 727990282b
commit 10cc4f968f

View File

@@ -69,18 +69,29 @@ def fetch_manifest(pkgname, pkgver=None):
def rebuild_package(packages, repo_dir=None):
if isinstance(packages, str):
packages = [packages]
db = load_db() # <-- load db once
for pkg in packages:
if pkg not in db["installed"]:
print(f"[fempkg] Skipping rebuild of {pkg}: not installed.")
continue
print(f"[fempkg] Rebuilding dependency: {pkg}")
dep_recipe = None
if repo_dir:
dep_recipe = os.path.join(repo_dir, f"{pkg}.recipe.py")
if not os.path.exists(dep_recipe):
print(f"Warning: recipe for {pkg} not found in {repo_dir}.")
dep_recipe = None
if not dep_recipe:
dep_recipe = fetch_recipe(pkg)
build_package(dep_recipe, repo_dir, force_rebuild=True)
def extract_tar_zst_with_progress(tar_path, dest="/"):
"""
Extract a .tar.zst archive with a progress bar.