im_apt_check.patch 958 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. --- a/usr/lib/linuxmint/mintlocale/im.py
  2. +++ b/usr/lib/linuxmint/mintlocale/im.py
  3. @@ -1,10 +1,8 @@
  4. #!/usr/bin/python3
  5. -import apt
  6. import codecs
  7. import gettext
  8. import locale
  9. -import mintcommon.aptdaemon
  10. import os
  11. try:
  12. @@ -19,6 +17,13 @@
  13. from gi.repository import Gtk, GObject, Gdk, XApp
  14. from ImConfig.ImConfig import ImConfig
  15. +
  16. +# Used to detect Debian derivatives (we don't want to show APT features in other distros)
  17. +IS_DEBIAN = os.path.exists("/etc/debian_version")
  18. +
  19. +if IS_DEBIAN:
  20. + import apt
  21. + import mintcommon.aptdaemon
  22. # i18n
  23. APP = 'mintlocale'
  24. @@ -38,7 +43,8 @@
  25. self.app = app
  26. self.packages = []
  27. self.missing_packages = []
  28. - self.apt = mintcommon.aptdaemon.APT(self.app.window)
  29. + if IS_DEBIAN:
  30. + self.apt = mintcommon.aptdaemon.APT(self.app.window)
  31. self.button = button
  32. self.button.connect('clicked', self.install)
  33. self.button.set_sensitive(False)