build.py: uh slightly better depency stuff
This commit is contained in:
11
build.py
11
build.py
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user