Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --- a/usr/lib/linuxmint/mintlocale/install_remove.py
- +++ b/usr/lib/linuxmint/mintlocale/install_remove.py
- @@ -2,7 +2,6 @@
- import os
- import gettext
- -import apt_pkg
- import aptkit.simpleclient
- import subprocess
- import locale
- @@ -12,6 +11,13 @@ import gi
- gi.require_version('Gtk', '3.0')
- from gi.repository import Gtk, Gdk, GdkPixbuf
- +# Used to detect Debian derivatives (we don't want to show APT features in other distros)
- +IS_DEBIAN = os.path.exists("/etc/debian_version")
- +
- +if IS_DEBIAN:
- + import apt_pkg
- + import mintcommon.aptdaemon
- +
- # i18n
- APP = 'mintlocale'
- LOCALE_DIR = "/usr/share/linuxmint/locale"
- @@ -53,8 +59,9 @@ class MintLocale:
- else:
- self.language_packs.append(LanguagePack(category, language, dependency, package))
- - apt_pkg.init()
- - self.cache = apt_pkg.Cache(None)
- + if IS_DEBIAN:
- + apt_pkg.init()
- + self.cache = apt_pkg.Cache(None)
- self.cache_updated = False
- @@ -134,7 +141,8 @@ class MintLocale:
- return (language_code, country_code, language_label)
- def build_lang_list(self):
- - self.cache = apt_pkg.Cache(None)
- + if IS_DEBIAN:
- + self.cache = apt_pkg.Cache(None)
- self.builder.get_object('button_install').set_sensitive(False)
- self.builder.get_object('button_remove').set_sensitive(False)
Advertisement
Add Comment
Please, Sign In to add comment