1
# Copyright (C) 2009-2012 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
"""Install kdelibs5-dev if kdeblibs4-dev is installed."""
17
from __future__ import absolute_import, print_function, unicode_literals
21
'Kdelibs4devToKdelibs5devPlugin',
25
from janitor.plugincore.core.missing_package_cruft import MissingPackageCruft
26
from janitor.plugincore.i18n import setup_gettext
27
from janitor.plugincore.plugin import Plugin
32
class Kdelibs4devToKdelibs5devPlugin(Plugin):
33
"""Plugin to install kdelibs5-dev if kdelibs4-dev is installed.
39
self.condition = ['from_hardyPostDistUpgradeCache']
42
fromp = 'kdelibs4-dev'
44
cache = self.app.apt_cache
45
if (fromp in cache and cache[fromp].is_installed and
46
top in cache and not cache[top].is_installed):
47
yield MissingPackageCruft(
49
_('When upgrading, if kdelibs4-dev is installed, '
50
'kdelibs5-dev needs to be installed. See '
51
'bugs.launchpad.net, bug #279621 for details.'))