Commits

Michał Górny committed 290c92e

Mark files as modified after sorting only when changed.

  • Participants
  • Parent commits adbd857

Comments (0)

Files changed (1)

File lib/flaggie/packagefile.py

 				self.modified = True
 
 			def sort(self):
-				self.flags.sort()
-				self.modified = True
+				newflags = sorted(self.flags)
+				if newflags != self.flags:
+					self.flags = newflags
+					self.modified = True
 
 			def __lt__(self, other):
 				return self.package < other.package
 			f.close()
 
 		def sort(self):
-			list.sort(self)
-			self.modified = True
+			newlist = sorted(self)
+			if newlist != self:
+				self[:] = newlist
+				self.modified = True
 
 		@property
 		def modified(self):