diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2016-02-24 10:14:32 +1300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-02-28 11:32:36 +0000 |
commit | 4f7595a514661f0e2418393286849a1cb6c46f0d (patch) | |
tree | 65f6c65e98620c772fcd86cd04884f419fecb1d2 /scripts | |
parent | a4f3e6d5f4c549e36cce1e18801a565a3a3c9b0a (diff) | |
download | openembedded-core-4f7595a514661f0e2418393286849a1cb6c46f0d.tar.gz openembedded-core-4f7595a514661f0e2418393286849a1cb6c46f0d.tar.bz2 openembedded-core-4f7595a514661f0e2418393286849a1cb6c46f0d.zip |
devtool: upgrade: fix several issues with extraction of new source
Fix several issues when extracting the new version source over the top
of the old one (when the recipe is not fetching from a git repo):
* Delete the old source first so we ensure files deleted in the new
version are deleted. This also has the side-effect of fixing any
issues where files aren't marked writeable in the old source and thus
overwriting them failed (harfbuzz 1.1.3 contains such files).
* Fix incorrect variable name in abspath statement that made it a no-op
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/lib/devtool/upgrade.py | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py index fab7b15e3f..fae20efc59 100644 --- a/scripts/lib/devtool/upgrade.py +++ b/scripts/lib/devtool/upgrade.py @@ -188,9 +188,19 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, branch, keep_temp, tin raise DevtoolError(e) tmpsrctree = _get_srctree(tmpdir) + srctree = os.path.abspath(srctree) + + # Delete all sources so we ensure no stray files are left over + for item in os.listdir(srctree): + if item in ['.git', 'oe-local-files']: + continue + itempath = os.path.join(srctree, item) + if os.path.isdir(itempath): + shutil.rmtree(itempath) + else: + os.remove(itempath) - scrtree = os.path.abspath(srctree) - + # Copy in new ones _copy_source_code(tmpsrctree, srctree) (stdout,_) = __run('git ls-files --modified --others --exclude-standard') |