diff options
Diffstat (limited to 'scripts/lib/devtool/standard.py')
| -rw-r--r-- | scripts/lib/devtool/standard.py | 37 |
1 files changed, 1 insertions, 36 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 87d3f5dc04..06c508c838 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
| @@ -442,41 +442,6 @@ class BbTaskExecutor(object): | |||
| 442 | self.executed.append(func) | 442 | self.executed.append(func) |
| 443 | 443 | ||
| 444 | 444 | ||
| 445 | class PatchTaskExecutor(BbTaskExecutor): | ||
| 446 | def __init__(self, rdata): | ||
| 447 | import oe.patch | ||
| 448 | self.check_git = False | ||
| 449 | self.useroptions = [] | ||
| 450 | oe.patch.GitApplyTree.gitCommandUserOptions(self.useroptions, d=rdata) | ||
| 451 | super(PatchTaskExecutor, self).__init__(rdata) | ||
| 452 | |||
| 453 | def exec_func(self, func, report): | ||
| 454 | from oe.patch import GitApplyTree | ||
| 455 | srcsubdir = self.rdata.getVar('S', True) | ||
| 456 | haspatches = False | ||
| 457 | if func == 'do_patch': | ||
| 458 | patchdir = os.path.join(srcsubdir, 'patches') | ||
| 459 | if os.path.exists(patchdir): | ||
| 460 | if os.listdir(patchdir): | ||
| 461 | haspatches = True | ||
| 462 | else: | ||
| 463 | os.rmdir(patchdir) | ||
| 464 | |||
| 465 | super(PatchTaskExecutor, self).exec_func(func, report) | ||
| 466 | if self.check_git and os.path.exists(srcsubdir): | ||
| 467 | if func == 'do_patch': | ||
| 468 | if os.path.exists(patchdir): | ||
| 469 | shutil.rmtree(patchdir) | ||
| 470 | if haspatches: | ||
| 471 | stdout, _ = bb.process.run('git status --porcelain patches', cwd=srcsubdir) | ||
| 472 | if stdout: | ||
| 473 | bb.process.run('git checkout patches', cwd=srcsubdir) | ||
| 474 | |||
| 475 | stdout, _ = bb.process.run('git status --porcelain', cwd=srcsubdir) | ||
| 476 | if stdout: | ||
| 477 | bb.process.run('git add .; git %s commit -a -m "Committing changes from %s\n\n%s"' % (' '.join(self.useroptions), func, GitApplyTree.ignore_commit_prefix + ' - from %s' % func), cwd=srcsubdir) | ||
| 478 | |||
| 479 | |||
| 480 | def _prep_extract_operation(config, basepath, recipename, tinfoil=None): | 445 | def _prep_extract_operation(config, basepath, recipename, tinfoil=None): |
| 481 | """HACK: Ugly workaround for making sure that requirements are met when | 446 | """HACK: Ugly workaround for making sure that requirements are met when |
| 482 | trying to extract a package. Returns the tinfoil instance to be used.""" | 447 | trying to extract a package. Returns the tinfoil instance to be used.""" |
| @@ -563,7 +528,7 @@ def _extract_source(srctree, keep_temp, devbranch, sync, d): | |||
| 563 | # We don't want to move the source to STAGING_KERNEL_DIR here | 528 | # We don't want to move the source to STAGING_KERNEL_DIR here |
| 564 | crd.setVar('STAGING_KERNEL_DIR', '${S}') | 529 | crd.setVar('STAGING_KERNEL_DIR', '${S}') |
| 565 | 530 | ||
| 566 | task_executor = PatchTaskExecutor(crd) | 531 | task_executor = BbTaskExecutor(crd) |
| 567 | 532 | ||
| 568 | crd.setVar('EXTERNALSRC_forcevariable', '') | 533 | crd.setVar('EXTERNALSRC_forcevariable', '') |
| 569 | 534 | ||
