summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2015-02-19 16:39:51 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-02-23 17:35:27 +0000
commitf205ccaf48ac36f4b26efc4aeb2e9d2939b28646 (patch)
tree170924a8e7883a7bfa2a55a509d76ac01131c323 /meta/lib
parent5eb9ffe1e0c161e1128558495866aa4a68aab58a (diff)
downloadast2050-yocto-poky-f205ccaf48ac36f4b26efc4aeb2e9d2939b28646.zip
ast2050-yocto-poky-f205ccaf48ac36f4b26efc4aeb2e9d2939b28646.tar.gz
lib/oe/patch: fix PATCHTOOL = "git" with source in a subdirectory
For recipes that have their actual source in a subdirectory of what is fetched (e.g. mkelfimage), we need to find the root of the repository within the GitApplyTree code that attempts to set up the required git hooks and use that, rather than expecting the root to be the same as ${S}. (From OE-Core rev: d820303f64ea610338ec11ffd79269e7831d1da9) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/patch.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/meta/lib/oe/patch.py b/meta/lib/oe/patch.py
index b838be8..f68d40f 100644
--- a/meta/lib/oe/patch.py
+++ b/meta/lib/oe/patch.py
@@ -313,9 +313,12 @@ class GitApplyTree(PatchTree):
return runcmd(["sh", "-c", " ".join(shellcmd)], self.dir)
# Add hooks which add a pointer to the original patch file name in the commit message
- commithook = os.path.join(self.dir, '.git', 'hooks', 'commit-msg')
+ reporoot = (runcmd("git rev-parse --show-toplevel".split(), self.dir) or '').strip()
+ if not reporoot:
+ raise Exception("Cannot get repository root for directory %s" % self.dir)
+ commithook = os.path.join(reporoot, '.git', 'hooks', 'commit-msg')
commithook_backup = commithook + '.devtool-orig'
- applyhook = os.path.join(self.dir, '.git', 'hooks', 'applypatch-msg')
+ applyhook = os.path.join(reporoot, '.git', 'hooks', 'applypatch-msg')
applyhook_backup = applyhook + '.devtool-orig'
if os.path.exists(commithook):
shutil.move(commithook, commithook_backup)
OpenPOWER on IntegriCloud