implements patch support for repos

With this commit its now possible to patch 3rd party repos before bitbake is started.

Example:

This is our repo:
  .
  ├── kas.yml
  ├── first-patch.patch
  └── quilt-patches
      ├── second-patch.patch
      ├── third-patch.patch
      └── series

Content of kas.yml:
  header:
    version: 8

  repos:
    my:
    third-party:
      url: "git://example.com/third-party.git"
      refspec: "35adf4...34"
      patches:
        01-first:
          repo: my
          path: "first-patch.patch"
        02-second:
          repo: my
          path: "quilt-patches"

Currently only 'git' repositories can be patched.

Signed-off-by: Claudius Heine <ch@denx.de>
This commit is contained in:
Claudius Heine
2018-03-09 08:22:52 +01:00
committed by Daniel Wagner
parent b9032ec025
commit e8851a5fb3
9 changed files with 175 additions and 12 deletions

View File

@@ -184,6 +184,27 @@ def repos_fetch(config, repos):
sys.exit(task.result())
def repos_apply_patches(config, repos):
"""
Applies the patches to the repositories.
"""
tasks = []
for repo in repos:
if not hasattr(asyncio, 'ensure_future'):
# pylint: disable=no-member,deprecated-method
task = asyncio.async(repo.apply_patches_async(config))
else:
task = asyncio.ensure_future(repo.apply_patches_async(config))
tasks.append(task)
loop = asyncio.get_event_loop()
loop.run_until_complete(asyncio.wait(tasks))
for task in tasks:
if task.result():
sys.exit(task.result())
def get_build_environ(config, build_dir):
"""
Create the build environment variables.