Skip to content

Commit

Permalink
T7026: Add apply_patches option for the build packages script
Browse files Browse the repository at this point in the history
Add 'apply_patches' key is set to True (default) in the package configuration
This allows skipping/applying patch application by 'build.py' for specific
packages when desired

Usage:
  apply_patches = false
  • Loading branch information
sever-sever committed Jan 14, 2025
1 parent 844cac8 commit 0f44fc7
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions scripts/package-build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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('/', '_')
Expand Down

0 comments on commit 0f44fc7

Please sign in to comment.