Merge pull request #845 from sever-sever/T6912

T6912: Fix build package script dependencies
This commit is contained in:
Christian Breunig 2024-11-26 07:49:08 +01:00 committed by GitHub
commit dcf1d920ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 11 additions and 10 deletions

View File

@ -75,12 +75,11 @@ def prepare_package(repo_dir: Path, install_data: str) -> None:
raise 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 """Build a package from the repository
Args: Args:
package (list): List of Packages from toml package (list): List of Packages from toml
dependencies (list): List of additional dependencies
patch_dir (Path): Directory containing patches patch_dir (Path): Directory containing patches
""" """
repo_name = package['name'] repo_name = package['name']
@ -94,9 +93,6 @@ def build_package(package: list, dependencies: list, patch_dir: Path) -> None:
# Check out the specific commit # Check out the specific commit
run(['git', 'checkout', package['commit_id']], cwd=repo_dir, check=True) run(['git', 'checkout', package['commit_id']], cwd=repo_dir, check=True)
# Ensure dependencies
ensure_dependencies(dependencies)
# Apply patches if any # Apply patches if any
if (repo_dir / 'patches'): if (repo_dir / 'patches'):
apply_patches(repo_dir, patch_dir) apply_patches(repo_dir, patch_dir)
@ -177,11 +173,14 @@ if __name__ == '__main__':
packages = config['packages'] packages = config['packages']
patch_dir = Path(args.patch_dir) patch_dir = Path(args.patch_dir)
for package in packages: # Load global dependencies
dependencies = package.get('dependencies', {}).get('packages', []) global_dependencies = config.get('dependencies', {}).get('packages', [])
if global_dependencies:
ensure_dependencies(global_dependencies)
for package in packages:
# Build the package # Build the package
build_package(package, dependencies, patch_dir) build_package(package, patch_dir)
# Clean up build dependency packages after build # Clean up build dependency packages after build
cleanup_build_deps(Path(package['name'])) cleanup_build_deps(Path(package['name']))

View File

@ -6,3 +6,4 @@ libyang/
*.changes *.changes
*.deb *.deb
*.dsc *.dsc
*.tar.gz

View File

@ -16,7 +16,7 @@ commit_id = "stable/9.1"
scm_url = "https://github.com/FRRouting/frr.git" 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" build_cmd = "sudo dpkg -i ../*.deb; sudo dpkg-buildpackage -us -uc -tc -b -Ppkg.frr.rtrlib,pkg.frr.lua"
[packages.dependencies] [dependencies]
packages = [ packages = [
"chrpath", "chrpath",
"gawk", "gawk",

View File

@ -6,3 +6,4 @@ libtacplus-map/
*.changes *.changes
*.deb *.deb
*.dsc *.dsc
*.tar.gz

View File

@ -16,7 +16,7 @@ commit_id = "master"
scm_url = "https://github.com/vyos/libnss-tacplus.git" 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" build_cmd = "sudo dpkg -i ../libtac*.deb ../libpam-tacplus*.deb; dpkg-buildpackage -us -uc -tc -b"
[packages.dependencies] [dependencies]
packages = [ packages = [
"libpam-dev", "libpam-dev",
"autoconf-archive", "autoconf-archive",