]> code.ossystems Code Review - openembedded-core.git/commitdiff
combo-layer: fix file_exclude for empty commits
authorPatrick Ohly <patrick.ohly@intel.com>
Fri, 27 Mar 2015 13:53:12 +0000 (14:53 +0100)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 29 Mar 2015 22:07:19 +0000 (23:07 +0100)
The code detecting empty patches after removing files with
file_exclude failed for commits which were already empty before (like
the initial commit in some repos): such patches are completely empty
files, without a From line.

Detect that case and just let the normal empty patch detection deal
with it.

Signed-off-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
scripts/combo-layer

index fa6057927206e177c459c788a0b538f8037346c4..5d61fb1c16f84b3d346628c872d874a1a9a73e31 100755 (executable)
@@ -665,6 +665,10 @@ def action_update(conf, args):
                     # Empty, ignore it. Must also remove from revlist.
                     with open(patch, 'r') as f:
                         fromline = f.readline()
+                    if not fromline:
+                        # Patch must have been empty to start with. No need
+                        # to remove it.
+                        continue
                     m = re.match(r'''^From ([0-9a-fA-F]+) .*\n''', fromline)
                     rev = m.group(1)
                     logger.debug('skipping empty patch %s = %s' % (patch, rev))