diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-02-19 16:40:04 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-02-23 08:08:20 +0000 |
commit | dccdde4321c48a571677995a4e1dfc583e899cbe (patch) | |
tree | bc72502148735cee53fda16ffa0b29e050e65b90 /scripts/lib/devtool | |
parent | 73a5bdc7921791b954ca717293e76c7e3091a19e (diff) | |
download | openembedded-core-dccdde4321c48a571677995a4e1dfc583e899cbe.tar.gz openembedded-core-dccdde4321c48a571677995a4e1dfc583e899cbe.tar.bz2 openembedded-core-dccdde4321c48a571677995a4e1dfc583e899cbe.zip |
devtool: fix broken clones of git recipes
Because we move the workdir when extracting source, then move the source
and delete the temporary workdir, you lose the indirection symlink
pointed to by the alternates file (which is created when the fetcher
clones it from DL_DIR with -s) and the resulting repository is broken.
In any case, for a source repo that the user may put their own changes
into, we can't really rely on a clone made with -s in case the
original goes away - because of cleanall, DL_DIR disappearing, etc. So
repack the repository so that it is a complete, non-shared clone after
unpacking.
(While I'm at it, add a test for devtool modify with a git recipe which
verifies that this works.)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/devtool')
-rw-r--r-- | scripts/lib/devtool/standard.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index bf18aae686..cabf3feaf3 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py @@ -202,6 +202,13 @@ def _extract_source(srctree, keep_temp, devbranch, d): # Handle if S is set to a subdirectory of the source srcsubdir = os.path.join(workdir, os.path.relpath(srcsubdir, workdir).split(os.sep)[0]) + if os.path.exists(os.path.join(srcsubdir, '.git')): + alternatesfile = os.path.join(srcsubdir, '.git', 'objects', 'info', 'alternates') + if os.path.exists(alternatesfile): + # This will have been cloned with -s, so we need to convert it to a full clone + bb.process.run('git repack -a', cwd=srcsubdir) + os.remove(alternatesfile) + patchdir = os.path.join(srcsubdir, 'patches') haspatches = False if os.path.exists(patchdir): |