summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/devtool')
-rw-r--r--scripts/lib/devtool/upgrade.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index 18c5b66a29..cb6dce378a 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -32,7 +32,7 @@ def _run(cmd, cwd=''):
32 32
33def _get_srctree(tmpdir): 33def _get_srctree(tmpdir):
34 srctree = tmpdir 34 srctree = tmpdir
35 dirs = os.listdir(tmpdir) 35 dirs = scriptutils.filter_src_subdirs(tmpdir)
36 if len(dirs) == 1: 36 if len(dirs) == 1:
37 srctree = os.path.join(tmpdir, dirs[0]) 37 srctree = os.path.join(tmpdir, dirs[0])
38 return srctree 38 return srctree
@@ -281,7 +281,8 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, srcbranch, branch, kee
281 logger.info('Preserving temporary directory %s' % tmpsrctree) 281 logger.info('Preserving temporary directory %s' % tmpsrctree)
282 else: 282 else:
283 shutil.rmtree(tmpsrctree) 283 shutil.rmtree(tmpsrctree)
284 shutil.rmtree(tmpdir) 284 if tmpdir != tmpsrctree:
285 shutil.rmtree(tmpdir)
285 286
286 return (rev, md5, sha256, srcbranch, srcsubdir_rel) 287 return (rev, md5, sha256, srcbranch, srcsubdir_rel)
287 288