]> code.ossystems Code Review - openembedded-core.git/commit
patch: Jail patch_task_patch_prefunc in classes/patch into the workdir
authorPablo Saavedra <psaavedra@igalia.com>
Fri, 6 Jul 2018 09:50:23 +0000 (11:50 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 6 Jul 2018 21:54:56 +0000 (22:54 +0100)
commitdb6ce9d8838b1f9064604654ab579da3e237f361
tree53aa0df2cbd133c9a056753913b97d6c967d99c2
parentd942ec4ff649782d22afe49fd48839dbbfedc871
patch: Jail patch_task_patch_prefunc in classes/patch into the workdir

With PATCHTOOL=git patches the changes in the patch_task_postfunc
of the classes/patch. This works OK when the S dir is a Git repo
but doesn't if the source is a tarball.

The while condition in the patch_task_patch_prefunc must be
jailed into the WORKDIR. In the opposite, when you are executing
the recipe out of a Git subtree the function simply fails but when
your recipes are into a Git repo the patch_task_postfunc execute a
commit over your BSP local Git repo adding the changes in an
arbitrary Git repo found in the path from the SOURCE directory to
the '/'. This situation is highly probable in  cases like ~home
directories under the control of a .git repo or Yocto BSP which
manage the meta layers as git submodules.

This patch fix the changes introduced in

  classes/patch: when PATCHTOOL = "git" double-check the repository
  commit: 86ab56b55164393924b5e688b20e8f3f3f8fc578
  Author: Paul Eggleton <paul.eggleton@linux.intel.com>
  Date:   Tue Dec 5 14:36:58 2017 +1300

  classes/patch: when PATCHTOOL = "git" double-check the repository

  If a bug is present or the user has set PATCHTOOL = "git" on a source
  tree that isn't git, if we try to perform git operations (such as
  committing or changing branches) when extracting source, then we might
  in fact be running those operations on the metadata repository if the
  build directory is underneath, say, poky or OE-Core, and that could
  make a mess. Check if the source tree is a git repository and refuse
  to continue if it isn't.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes/patch.bbclass