-if options.keep_kernel:
- dpkg = subprocess.Popen(['dpkg', '--get-selections'],
- stdout=subprocess.PIPE)
- for l in dpkg.stdout:
- pkg, status = l.split()
- if status != 'install':
- continue
- if kernel_pkg_re.match(pkg):
- selection += '%s\tinstall\n' % pkg
+dpkg = subprocess.Popen(['dpkg', '--get-selections'],
+ stdout=subprocess.PIPE)
+for l in dpkg.stdout:
+ pkg, status = l.split()
+ if status != 'install':
+ continue
+ if options.keep_kernel and kernel_pkg_re.match(pkg):
+ selection += '%s\tinstall\n' % pkg
+ if no_remove_re.search(pkg):
+ selection += '%s\tinstall\n' % pkg