summaryrefslogtreecommitdiff
path: root/scripts/package-build/build.py
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2025-01-14 11:15:10 +0200
committerGitHub <noreply@github.com>2025-01-14 11:15:10 +0200
commit4b9c86bd9aaafc987fa4a278c8c04c271c3e6e75 (patch)
treeb8b4a4d40a007c8b82e919e1d9932a921c0aeec4 /scripts/package-build/build.py
parent0bd5cb4f5038f560d1b915ef5f62c14e0a9a10b3 (diff)
parent0f44fc7abe063a4f64628404547801a089455154 (diff)
downloadvyos-build-4b9c86bd9aaafc987fa4a278c8c04c271c3e6e75.tar.gz
vyos-build-4b9c86bd9aaafc987fa4a278c8c04c271c3e6e75.zip
Merge pull request #886 from sever-sever/T7026-fix-patches
T7026: Use vpp patches during build as they not applied
Diffstat (limited to 'scripts/package-build/build.py')
-rwxr-xr-xscripts/package-build/build.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/scripts/package-build/build.py b/scripts/package-build/build.py
index 08bda30e..9c1df7b3 100755
--- a/scripts/package-build/build.py
+++ b/scripts/package-build/build.py
@@ -120,9 +120,17 @@ def build_package(package: list, patch_dir: Path) -> None:
print(f"I: pre_build_hook failed for the {repo_name}")
raise
- # Apply patches if any
- if (repo_dir / 'patches'):
- apply_patches(repo_dir, patch_dir / repo_name)
+ # Apply patches if the 'apply_patches' key is set to True (default) in the package configuration
+ # This allows skipping patch application for specific packages when desired
+ #
+ # Usage:
+ # apply_patches = false
+ #
+ # Default to True if the key is missing
+ if package.get('apply_patches', True):
+ # Check if the 'patches' directory exists in the repository
+ if (repo_dir / 'patches'):
+ apply_patches(repo_dir, patch_dir / repo_name)
# Sanitize the commit ID and build a tarball for the package
commit_id_sanitized = package['commit_id'].replace('/', '_')