MCPcopy Index your code
hub / github.com/kivy/python-for-android / apply_patches

Method apply_patches

pythonforandroid/recipe.py:561–585  ·  view source on GitHub ↗

Apply any patches for the Recipe. .. versionchanged:: 0.6.0 Add ability to apply patches from any dir via kwarg `build_dir`

(self, arch, build_dir=None)

Source from the content-addressed store, hash-verified

559 return exists(join(build_dir, '.patched'))
560
561 def apply_patches(self, arch, build_dir=None):
562 '''Apply any patches for the Recipe.
563
564 .. versionchanged:: 0.6.0
565 Add ability to apply patches from any dir via kwarg `build_dir`'''
566 if self.patches:
567 info_main('Applying patches for {}[{}]'
568 .format(self.name, arch.arch))
569
570 if self.is_patched(arch):
571 info_main('{} already patched, skipping'.format(self.name))
572 return
573
574 build_dir = build_dir if build_dir else self.get_build_dir(arch.arch)
575 for patch in self.patches:
576 if isinstance(patch, (tuple, list)):
577 patch, patch_check = patch
578 if not patch_check(arch=arch, recipe=self):
579 continue
580
581 self.apply_patch(
582 patch.format(version=self.version, arch=arch.arch),
583 arch.arch, build_dir=build_dir)
584
585 touch(join(build_dir, '.patched'))
586
587 def should_build(self, arch):
588 '''Should perform any necessary test and return True only if it needs

Callers 1

build_recipesFunction · 0.45

Calls 6

is_patchedMethod · 0.95
get_build_dirMethod · 0.95
apply_patchMethod · 0.95
info_mainFunction · 0.90
touchFunction · 0.90
formatMethod · 0.80

Tested by

no test coverage detected