mirror of
https://github.com/vyos/vyos-build.git
synced 2025-10-01 20:28:40 +02:00
T6912: Fix build package script dependencies
Install dependencies declared in the package.toml file does not work due to the wrong logic. Set global dependencies instaed of dependencies per package.
This commit is contained in:
parent
50f8304f92
commit
aa40b27d9e
@ -75,12 +75,11 @@ def prepare_package(repo_dir: Path, install_data: str) -> None:
|
||||
raise
|
||||
|
||||
|
||||
def build_package(package: list, dependencies: list, patch_dir: Path) -> None:
|
||||
def build_package(package: list, patch_dir: Path) -> None:
|
||||
"""Build a package from the repository
|
||||
|
||||
Args:
|
||||
package (list): List of Packages from toml
|
||||
dependencies (list): List of additional dependencies
|
||||
patch_dir (Path): Directory containing patches
|
||||
"""
|
||||
repo_name = package['name']
|
||||
@ -94,9 +93,6 @@ def build_package(package: list, dependencies: list, patch_dir: Path) -> None:
|
||||
# Check out the specific commit
|
||||
run(['git', 'checkout', package['commit_id']], cwd=repo_dir, check=True)
|
||||
|
||||
# Ensure dependencies
|
||||
ensure_dependencies(dependencies)
|
||||
|
||||
# Apply patches if any
|
||||
if (repo_dir / 'patches'):
|
||||
apply_patches(repo_dir, patch_dir)
|
||||
@ -177,11 +173,15 @@ if __name__ == '__main__':
|
||||
packages = config['packages']
|
||||
patch_dir = Path(args.patch_dir)
|
||||
|
||||
for package in packages:
|
||||
dependencies = package.get('dependencies', {}).get('packages', [])
|
||||
# Load global dependencies
|
||||
global_dependencies = config.get('dependencies', {}).get('packages', [])
|
||||
if global_dependencies:
|
||||
print(global_dependencies)
|
||||
ensure_dependencies(global_dependencies)
|
||||
|
||||
for package in packages:
|
||||
# Build the package
|
||||
build_package(package, dependencies, patch_dir)
|
||||
build_package(package, patch_dir)
|
||||
|
||||
# Clean up build dependency packages after build
|
||||
cleanup_build_deps(Path(package['name']))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user