summarylogtreecommitdiffstats
path: root/im_apt_check.patch
blob: 16b1a526f086bf2b1604905fa9638dfb1ab32995 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
--- a/usr/lib/linuxmint/mintlocale/im.py
+++ b/usr/lib/linuxmint/mintlocale/im.py
@@ -1,10 +1,8 @@
 #!/usr/bin/python3
 
-import apt
 import codecs
 import gettext
 import locale
-import mintcommon.aptdaemon
 import os
 
 try:
@@ -19,6 +17,13 @@
 from gi.repository import Gtk, GObject, Gdk, XApp
 
 from ImConfig.ImConfig import ImConfig
+
+# 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
+    import mintcommon.aptdaemon
 
 # i18n
 APP = 'mintlocale'
@@ -38,7 +43,8 @@
         self.app = app
         self.packages = []
         self.missing_packages = []
-        self.apt = mintcommon.aptdaemon.APT(self.app.window)
+        if IS_DEBIAN:
+            self.apt = mintcommon.aptdaemon.APT(self.app.window)
         self.button = button
         self.button.connect('clicked', self.install)
         self.button.set_sensitive(False)