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:33:00 +0000 |
commit | 860574edb29e48daa37340c275900046abea639f (patch) | |
tree | ed3573191fd8ecf14042f313f0c75f8c44cb8652 /scripts/lib/devtool/upgrade.py | |
parent | 66a781c7e1dc74f4cfc1e80b4482d4aa1b7776dc (diff) | |
download | poky-860574edb29e48daa37340c275900046abea639f.tar.gz |
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
(From OE-Core rev: 4f7595a514661f0e2418393286849a1cb6c46f0d)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/devtool/upgrade.py')
-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 | |||
188 | raise DevtoolError(e) | 188 | raise DevtoolError(e) |
189 | 189 | ||
190 | tmpsrctree = _get_srctree(tmpdir) | 190 | tmpsrctree = _get_srctree(tmpdir) |
191 | srctree = os.path.abspath(srctree) | ||
192 | |||
193 | # Delete all sources so we ensure no stray files are left over | ||
194 | for item in os.listdir(srctree): | ||
195 | if item in ['.git', 'oe-local-files']: | ||
196 | continue | ||
197 | itempath = os.path.join(srctree, item) | ||
198 | if os.path.isdir(itempath): | ||
199 | shutil.rmtree(itempath) | ||
200 | else: | ||
201 | os.remove(itempath) | ||
191 | 202 | ||
192 | scrtree = os.path.abspath(srctree) | 203 | # Copy in new ones |
193 | |||
194 | _copy_source_code(tmpsrctree, srctree) | 204 | _copy_source_code(tmpsrctree, srctree) |
195 | 205 | ||
196 | (stdout,_) = __run('git ls-files --modified --others --exclude-standard') | 206 | (stdout,_) = __run('git ls-files --modified --others --exclude-standard') |