diff options
author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2011-11-07 12:07:02 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-11-07 13:58:39 +0000 |
commit | 5754bc7bcc2f57b6b56e67e2900eeaab5bc184d8 (patch) | |
tree | 28ee5df209e765b4feeca10a82116f79e04f3e33 /scripts/combo-layer | |
parent | cc34f1bf136409d2e31c443dd5334c3a35d208af (diff) | |
download | openembedded-core-5754bc7bcc2f57b6b56e67e2900eeaab5bc184d8.tar.gz openembedded-core-5754bc7bcc2f57b6b56e67e2900eeaab5bc184d8.tar.bz2 openembedded-core-5754bc7bcc2f57b6b56e67e2900eeaab5bc184d8.zip |
scripts/combo-layer: skip empty commits
If a commit is empty (for example, commits brought over from svn where
only properties were changed) then attempting to apply it with "git am"
will result in the error "Patch format detection failed", so skip it
instead.
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Diffstat (limited to 'scripts/combo-layer')
-rwxr-xr-x | scripts/combo-layer | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/scripts/combo-layer b/scripts/combo-layer index 597d6cb835..b4b1e4891e 100755 --- a/scripts/combo-layer +++ b/scripts/combo-layer @@ -252,18 +252,21 @@ def action_apply_patch(conf, args): for line in open(repo['patchlist']): patchfile = line.split()[0] lastrev = line.split()[1] - cmd = "git am --keep-cr -s -p1 %s" % patchfile - logger.info("Apply %s" % patchfile ) - try: - runcmd(cmd) - except subprocess.CalledProcessError: - logger.info('running "git am --abort" to cleanup repo') - runcmd("git am --abort") - logger.error('"%s" failed' % cmd) - logger.info("please manually apply patch %s" % patchfile) - logger.info("After applying, run this tool again to apply the remaining patches") - conf.update(name, "last_revision", lastrev) - sys.exit(0) + if os.path.getsize(patchfile) == 0: + logger.info("(skipping %s - no changes)", lastrev) + else: + cmd = "git am --keep-cr -s -p1 %s" % patchfile + logger.info("Apply %s" % patchfile ) + try: + runcmd(cmd) + except subprocess.CalledProcessError: + logger.info('running "git am --abort" to cleanup repo') + runcmd("git am --abort") + logger.error('"%s" failed' % cmd) + logger.info("please manually apply patch %s" % patchfile) + logger.info("After applying, run this tool again to apply the remaining patches") + conf.update(name, "last_revision", lastrev) + sys.exit(0) conf.update(name, "last_revision", lastrev) def action_splitpatch(conf, args): |