summaryrefslogtreecommitdiff
path: root/scripts/package-build
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2024-11-25 14:37:10 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2024-11-25 14:37:10 +0000
commitaa40b27d9eea7bf9e5c7d1c173c352cf0bc00e6e (patch)
tree203b7a5ae04c52ea2668b5bc4d734a2e50825823 /scripts/package-build
parent50f8304f92033525b780d9c290b9ea93529b8644 (diff)
downloadvyos-build-aa40b27d9eea7bf9e5c7d1c173c352cf0bc00e6e.tar.gz
vyos-build-aa40b27d9eea7bf9e5c7d1c173c352cf0bc00e6e.zip
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.
Diffstat (limited to 'scripts/package-build')
-rwxr-xr-xscripts/package-build/build.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/scripts/package-build/build.py b/scripts/package-build/build.py
index 0648b564..e6ba8a8f 100755
--- a/scripts/package-build/build.py
+++ b/scripts/package-build/build.py
@@ -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']))