Skip to content

Commit

Permalink
Merge pull request #845 from sever-sever/T6912
Browse files Browse the repository at this point in the history
T6912: Fix build package script dependencies
  • Loading branch information
c-po authored Nov 26, 2024
2 parents 50f8304 + 8e669e3 commit dcf1d92
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
15 changes: 7 additions & 8 deletions scripts/package-build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand All @@ -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)
Expand Down Expand Up @@ -177,11 +173,14 @@ def copy_packages(repo_dir: Path) -> None:
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:
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']))
Expand Down
1 change: 1 addition & 0 deletions scripts/package-build/frr/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ libyang/
*.changes
*.deb
*.dsc
*.tar.gz
2 changes: 1 addition & 1 deletion scripts/package-build/frr/package.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ commit_id = "stable/9.1"
scm_url = "https://github.com/FRRouting/frr.git"
build_cmd = "sudo dpkg -i ../*.deb; sudo dpkg-buildpackage -us -uc -tc -b -Ppkg.frr.rtrlib,pkg.frr.lua"

[packages.dependencies]
[dependencies]
packages = [
"chrpath",
"gawk",
Expand Down
1 change: 1 addition & 0 deletions scripts/package-build/tacacs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ libtacplus-map/
*.changes
*.deb
*.dsc
*.tar.gz
2 changes: 1 addition & 1 deletion scripts/package-build/tacacs/package.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ commit_id = "master"
scm_url = "https://github.com/vyos/libnss-tacplus.git"
build_cmd = "sudo dpkg -i ../libtac*.deb ../libpam-tacplus*.deb; dpkg-buildpackage -us -uc -tc -b"

[packages.dependencies]
[dependencies]
packages = [
"libpam-dev",
"autoconf-archive",
Expand Down

0 comments on commit dcf1d92

Please sign in to comment.