Commits

Michał Górny  committed ebc477b

Sort cleanup actions too.

  • Participants
  • Parent commits c58ae3c

Comments (0)

Files changed (1)

File lib/flaggie/cleanup.py

 		for f in pfiles:
 			self._perform(f)
 
+	def __lt__(self, other):
+		try:
+			idx = [cleanupact_order.index(x.__class__) for x in (self, other)]
+		except ValueError: # cleanup actions always go to the end
+			return False
+		return idx[0] < idx[1]
+
 class DropIneffective(BaseCleanupAction):
 	def _perform(self, f):
 		cache = {}
 	def _perform(self, f):
 		for pe in f:
 			pe.sort()
+
+cleanupact_order = (DropUnmatchedPkgs, DropIneffective, SortEntries, SortFlags)