Commits

Michał Górny committed a01d34b

Fall back to other files when getting mtime.

Fixes: https://github.com/mgorny/eclean-kernel/issues/2

  • Participants
  • Parent commits 8f3375c

Comments (0)

Files changed (1)

File ecleankernel/kernel.py

 
 	@property
 	def mtime(self):
-		return os.path.getmtime(self.vmlinuz)
+		# prefer vmlinuz, fallback to anything
+		# XXX: or maybe max()? min()?
+		for p in self.parts:
+			path = getattr(self, p)
+			if path is not None:
+				return os.path.getmtime(path)
 
 	def unrefall(self):
 		del self.vmlinuz