summaryrefslogtreecommitdiffstats
path: root/meta/classes
diff options
context:
space:
mode:
authorPablo Saavedra <psaavedra@igalia.com>2018-07-06 11:50:23 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-06 22:55:02 +0100
commit303fb675f251de2e9719a02c525b5240bb23e65f (patch)
treece9ec5b6de74cc781b31775e793a384b3e27f0a6 /meta/classes
parent87b9992ae710cc405b1e4a07a5bfc7a283e80664 (diff)
downloadpoky-303fb675f251de2e9719a02c525b5240bb23e65f.tar.gz
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. (From OE-Core rev: db6ce9d8838b1f9064604654ab579da3e237f361) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r--meta/classes/patch.bbclass2
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/classes/patch.bbclass b/meta/classes/patch.bbclass
index 2fc6925e49..3e0a181821 100644
--- a/meta/classes/patch.bbclass
+++ b/meta/classes/patch.bbclass
@@ -33,7 +33,7 @@ python patch_task_patch_prefunc() {
33 if (testsrcdir + os.sep).startswith(workdir + os.sep): 33 if (testsrcdir + os.sep).startswith(workdir + os.sep):
34 # Double-check that either workdir or S or some directory in-between is a git repository 34 # Double-check that either workdir or S or some directory in-between is a git repository
35 found = False 35 found = False
36 while testsrcdir != '/': 36 while testsrcdir != workdir:
37 if os.path.exists(os.path.join(testsrcdir, '.git')): 37 if os.path.exists(os.path.join(testsrcdir, '.git')):
38 found = True 38 found = True
39 break 39 break