summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/upgrade.py
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2020-05-30 00:03:23 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-06-04 13:27:29 +0100
commiteb4e519f4c2c6d8ee5f635bc477de3c4b5d5c2d6 (patch)
tree0db3e2ca7584812c61379809e9e5910bd6db0510 /scripts/lib/devtool/upgrade.py
parent2b9e3c2111ae073b93a4092227fd06f2183812fb (diff)
downloadpoky-eb4e519f4c2c6d8ee5f635bc477de3c4b5d5c2d6.tar.gz
devtool: use -f and don't use --exclude-standard when adding files to workspace
* I see a case where a tarball contains .gitignore and bunch of files which are normally ignored in git, but still included in the tarball (e.g. configure script next to configure.ac) * when devtool is creating a git repo in workspace it won't include these files from tarball in the initial devtool-base commit, because git ls-files won't list them * but then the first .patch file (without git headers) when applied with GitApplyTree._applypatch() will add all these still ignored files to a commit which used to only modify some files, because it's using -f: # Add all files shellcmd = ["git", "add", "-f", "-A", "."] output += runcmd(["sh", "-c", " ".join(shellcmd)], self.dir) at least in this case it would be better to add all ignored files in the initial devtool-base commit and then --force-patch-refresh will just include the small modification as before instead of adding unrelated files, just because they were initially ignored - this behavior will also match with the do_patch task in the actual build where the .gitignore is ignored when unpacking some tarball * my use-case is fixed in setup_git_repo, but similar function is in devtool upgrade, I've changed it there as well (From OE-Core rev: 06a24a615549af3550302a56ea08147000a608f3) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.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.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index f962a71e41..ebe72282bb 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -235,14 +235,14 @@ def _extract_new_source(newpv, srctree, no_patch, srcrev, srcbranch, branch, kee
235 # Copy in new ones 235 # Copy in new ones
236 _copy_source_code(tmpsrctree, srctree) 236 _copy_source_code(tmpsrctree, srctree)
237 237
238 (stdout,_) = __run('git ls-files --modified --others --exclude-standard') 238 (stdout,_) = __run('git ls-files --modified --others')
239 filelist = stdout.splitlines() 239 filelist = stdout.splitlines()
240 pbar = bb.ui.knotty.BBProgress('Adding changed files', len(filelist)) 240 pbar = bb.ui.knotty.BBProgress('Adding changed files', len(filelist))
241 pbar.start() 241 pbar.start()
242 batchsize = 100 242 batchsize = 100
243 for i in range(0, len(filelist), batchsize): 243 for i in range(0, len(filelist), batchsize):
244 batch = filelist[i:i+batchsize] 244 batch = filelist[i:i+batchsize]
245 __run('git add -A %s' % ' '.join(['"%s"' % item for item in batch])) 245 __run('git add -f -A %s' % ' '.join(['"%s"' % item for item in batch]))
246 pbar.update(i) 246 pbar.update(i)
247 pbar.finish() 247 pbar.finish()
248 248