summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorPaul Eggleton <paul.eggleton@linux.intel.com>2017-09-28 16:46:14 +1300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-11-11 12:14:27 +0000
commit7bab0de6cb9c973a96b9bd8ab55b8f50a1087f34 (patch)
tree69c19504fe964f53d16007d3e8a74be6c5849fe5 /scripts
parent7b59e0b8776b874ca3cbc5f2d46c9769da6b8655 (diff)
downloadpoky-7bab0de6cb9c973a96b9bd8ab55b8f50a1087f34.tar.gz
devtool: upgrade: improve performance and show progress when adding files
When devtool upgrade is upgrading to a new version where the source is fetched as an archive (e.g. a tarball), we create a single commit in the git repository that is the upgrade from the old version to the new. We do this by extracting the old source, committing it, deleting all files, copying in the new files, running git add on each new/changed/deleted file, and then committing the result. When a lot of files have changed in an upgrade (such as QEMU 2.8.1.1 -> 2.10.0) the penultimate step of running git add it can take quite a long time; in order to reduce this and show some feedback to the user, run git add with batches of 100 files at once and also show a progress bar. In a local test with the aforementioned QEMU upgrade it took the time down from over 7 minutes down to about 13 seconds. Fixes [YOCTO #11948]. (From OE-Core rev: 8b184f6c874b60324ee107af53853687173d3434) 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')
-rw-r--r--scripts/lib/devtool/upgrade.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index 073002ba49..441dd35bbd 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -251,8 +251,15 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, srcbranch, branch, kee
251 _copy_source_code(tmpsrctree, srctree) 251 _copy_source_code(tmpsrctree, srctree)
252 252
253 (stdout,_) = __run('git ls-files --modified --others --exclude-standard') 253 (stdout,_) = __run('git ls-files --modified --others --exclude-standard')
254 for f in stdout.splitlines(): 254 filelist = stdout.splitlines()
255 __run('git add -A "%s"' % f) 255 pbar = bb.ui.knotty.BBProgress('Adding changed files', len(filelist))
256 pbar.start()
257 batchsize = 100
258 for i in range(0, len(filelist), batchsize):
259 batch = filelist[i:i+batchsize]
260 __run('git add -A %s' % ' '.join(['"%s"' % item for item in batch]))
261 pbar.update(i)
262 pbar.finish()
256 263
257 useroptions = [] 264 useroptions = []
258 oe.patch.GitApplyTree.gitCommandUserOptions(useroptions, d=rd) 265 oe.patch.GitApplyTree.gitCommandUserOptions(useroptions, d=rd)