1
# Copyright (C) 2009 Canonical, Ltd.
3
# This program is free software: you can redistribute it and/or modify it
4
# under the terms of the GNU General Public License as published by the Free
5
# Software Foundation, version 3 of the License.
7
# This program is distributed in the hope that it will be useful, but WITHOUT
8
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
9
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
# You should have received a copy of the GNU General Public License along with
13
# this program. If not, see <http://www.gnu.org/licenses/>.
15
"""Remove lilo if grub is also installed."""
17
from __future__ import absolute_import, print_function, unicode_literals
28
from janitor.plugincore.i18n import setup_gettext
29
from janitor.plugincore.core.package_cruft import PackageCruft
30
from janitor.plugincore.plugin import Plugin
35
class RemoveLiloPlugin(Plugin):
36
"""Plugin to remove lilo if grub is also installed."""
39
self.condition = ['jauntyPostDistUpgradeCache']
41
def get_description(self):
42
return _('Remove lilo since grub is also installed.'
43
'(See bug #314004 for details.)')
46
if 'lilo' in self.app.apt_cache and 'grub' in self.app.apt_cache:
47
lilo = self.app.apt_cache['lilo']
48
grub = self.app.apt_cache['grub']
49
if lilo.is_installed and grub.is_installed:
50
if not os.path.exists('/etc/lilo.conf'):
51
yield PackageCruft(lilo, self.description)
53
logging.warning('lilo and grub installed, but '