Commits

Michał Górny committed 1267c08

Support calling postrm() for bootloader.

  • Participants
  • Parent commits d33a257

Comments (0)

Files changed (1)

File ecleankernel/cli.py

 
 		for k, reason in removals:
 			print('- %s: %s' % (k.version, ', '.join(reason)))
+		if removals and hasattr(bootloader, 'postrm'):
+			print('Bootloader %s config will be updated.' % bootloader.name)
 	else:
 		for k, reason in removals:
 			k.check_writable()
 
+		nremoved = 0
+
 		for k, reason in removals:
 			remove = True
 			while opts.ask:
 			if remove:
 				print('* Removing kernel %s (%s)' % (k.version, ', '.join(reason)))
 				del kernels[k.version]
+				nremoved += 1
+
+		if nremoved:
+			print('Removed %d kernels' % nremoved)
+			if hasattr(bootloader, 'postrm'):
+				bootloader.postrm()
 
 	return 0