diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-04-28 12:25:30 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-05-01 17:08:50 +0100 |
commit | a4fca1d52386924f25a18f6c4ed94e1a7bbac8e4 (patch) | |
tree | b75810ef1f906d0fcba0e9c71a6c9d66a5927e75 /scripts/lib/devtool/standard.py | |
parent | 24e5ad268ceb3272a370f67ac3ee02f38f92f2ee (diff) | |
download | poky-a4fca1d52386924f25a18f6c4ed94e1a7bbac8e4.tar.gz |
recipetool: ensure git clone is standalone when extracting
If -x is specified and the specified URI was a git repository, we need
to ensure that the resulting clone is a sandalone and not one that has
pointers into the temporary fetch location or DL_DIR (since the git
fetcher does a local clone with -s). Split out the code from devtool
that already does this for "devtool modify -x" and reuse that.
(From OE-Core rev: fc47e8652ef32e7399f57c80593df90dc52d8b84)
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/standard.py')
-rw-r--r-- | scripts/lib/devtool/standard.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py index 94b5e0bdd1..f90d464432 100644 --- a/scripts/lib/devtool/standard.py +++ b/scripts/lib/devtool/standard.py | |||
@@ -23,6 +23,7 @@ import glob | |||
23 | import tempfile | 23 | import tempfile |
24 | import logging | 24 | import logging |
25 | import argparse | 25 | import argparse |
26 | import scriptutils | ||
26 | from devtool import exec_build_env_command, setup_tinfoil | 27 | from devtool import exec_build_env_command, setup_tinfoil |
27 | 28 | ||
28 | logger = logging.getLogger('devtool') | 29 | logger = logging.getLogger('devtool') |
@@ -236,12 +237,7 @@ def _extract_source(srctree, keep_temp, devbranch, d): | |||
236 | # Handle if S is set to a subdirectory of the source | 237 | # Handle if S is set to a subdirectory of the source |
237 | srcsubdir = os.path.join(workdir, os.path.relpath(srcsubdir, workdir).split(os.sep)[0]) | 238 | srcsubdir = os.path.join(workdir, os.path.relpath(srcsubdir, workdir).split(os.sep)[0]) |
238 | 239 | ||
239 | if os.path.exists(os.path.join(srcsubdir, '.git')): | 240 | scriptutils.git_convert_standalone_clone(srcsubdir) |
240 | alternatesfile = os.path.join(srcsubdir, '.git', 'objects', 'info', 'alternates') | ||
241 | if os.path.exists(alternatesfile): | ||
242 | # This will have been cloned with -s, so we need to convert it to a full clone | ||
243 | bb.process.run('git repack -a', cwd=srcsubdir) | ||
244 | os.remove(alternatesfile) | ||
245 | 241 | ||
246 | patchdir = os.path.join(srcsubdir, 'patches') | 242 | patchdir = os.path.join(srcsubdir, 'patches') |
247 | haspatches = False | 243 | haspatches = False |