[oe-commits] [openembedded-core] 07/17: patch: Jail patch_task_patch_prefunc in classes/patch into the workdir

git at git.openembedded.org git at git.openembedded.org
Fri Jul 6 21:55:36 UTC 2018


This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master
in repository openembedded-core.

commit db6ce9d8838b1f9064604654ab579da3e237f361
Author: Pablo Saavedra <psaavedra at igalia.com>
AuthorDate: Fri Jul 6 11:50:23 2018 +0200

    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 at 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 at linuxfoundation.org>
---
 meta/classes/patch.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/patch.bbclass b/meta/classes/patch.bbclass
index 2fc6925..3e0a181 100644
--- a/meta/classes/patch.bbclass
+++ b/meta/classes/patch.bbclass
@@ -33,7 +33,7 @@ python patch_task_patch_prefunc() {
     if (testsrcdir + os.sep).startswith(workdir + os.sep):
         # Double-check that either workdir or S or some directory in-between is a git repository
         found = False
-        while testsrcdir != '/':
+        while testsrcdir != workdir:
             if os.path.exists(os.path.join(testsrcdir, '.git')):
                 found = True
                 break

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Openembedded-commits mailing list