patchupdate.py: Ignore categories for disabled patches.

This commit is contained in:
Sebastian Lackner 2015-05-08 19:20:42 +02:00
parent 0a1e04b9f2
commit bd4c1e3006

View File

@ -75,6 +75,7 @@ class PatchSet(object):
self.changes = []
self.disabled = False
self.ifdefined = None
self.categories = []
self.files = []
self.patches = []
@ -302,9 +303,7 @@ def read_patchset(revision = None):
val = "category-%s" % val
if name_to_id.has_key(val):
raise PatchUpdaterError("Category name in definition file %s collides with patchset %s" % (filename, val))
if not categories.has_key(val):
categories[val] = set()
categories[val].add(i)
patch.categories.append(val)
elif key == "fixes":
r = re.match("^[0-9]+$", val)
@ -330,6 +329,14 @@ def read_patchset(revision = None):
elif revision is None:
print "WARNING: Ignoring unknown command in definition file %s: %s" % (filename, line)
# If patch is not disabled then finally add it to the category
if not patch.disabled:
for category in patch.categories:
if not categories.has_key(category):
categories[category] = set()
categories[category].add(i)
# Add virtual targets for all the categories
for category, indices in categories.iteritems():
patch = PatchSet(category, directory)