diff -Nru apturl-0.5.2ubuntu11/AptUrl/gtk/backend/InstallBackendAptdaemon.py apturl-0.5.2ubuntu11.1/AptUrl/gtk/backend/InstallBackendAptdaemon.py --- apturl-0.5.2ubuntu11/AptUrl/gtk/backend/InstallBackendAptdaemon.py 2015-12-16 10:08:32.000000000 +0000 +++ apturl-0.5.2ubuntu11.1/AptUrl/gtk/backend/InstallBackendAptdaemon.py 2016-05-19 20:12:58.000000000 +0000 @@ -32,11 +32,11 @@ pass try: trans = yield self.client.update_cache(defer=True) - yield self._run_in_dialog(trans, self.UPDATE) + yield self._run_in_dialog(trans, self.ACTION_UPDATE) except errors.NotAuthorizedError as e: - self._action_done(self.UPDATE, False, False, str(e), None) + self._action_done(self.ACTION_UPDATE, False, False, str(e), None) except: - self.action_done(self.UPDATE, True, False, None, None) + self.action_done(self.ACTION_UPDATE, True, False, None, None) raise @inline_callbacks diff -Nru apturl-0.5.2ubuntu11/AptUrl/gtk/GtkUI.py apturl-0.5.2ubuntu11.1/AptUrl/gtk/GtkUI.py --- apturl-0.5.2ubuntu11/AptUrl/gtk/GtkUI.py 2016-01-13 11:47:53.000000000 +0000 +++ apturl-0.5.2ubuntu11.1/AptUrl/gtk/GtkUI.py 2016-05-19 20:19:47.000000000 +0000 @@ -31,12 +31,19 @@ self.dia_xml.set_translation_domain("apturl") self.dia_xml.add_from_file(APTURL_UI_FILE) self.dia = self.dia_xml.get_object('confirmation_dialog') - self.dia.start_available = lambda: Gtk.main_quit() - self.dia.start_error = lambda: Gtk.main_quit() + self.dia.start_available = self.start_available + self.dia.start_error = self.start_error self.dia.exit = lambda: Gtk.main_quit() self.dia.realize() self.backend = get_backend(self.dia) + def start_available(self, cancelled_update=False, error_occurred=False): + self.dia.set_sensitive(True) + Gtk.main_quit() + + def start_error(self, is_update_error, header, desc): + Gtk.main_quit() + def _action_done(self, backend, action, authorized, success, err_str, err_desc): self.dia.set_sensitive(True) Gtk.main_quit() @@ -107,9 +114,7 @@ return True def doEnableSection(self, sections): - cmd = ["gksu", "--desktop", - "/usr/share/applications/software-properties.desktop", - "--", + cmd = ["pkexec", "software-properties-gtk", "-e", "%s" % ' '.join(sections)] try: @@ -127,21 +132,15 @@ def doEnableChannel(self, channelpath, channelkey): - cmd = ["gksu", - "--desktop", - "/usr/share/applications/gnome-app-install.desktop", - "--", + cmd = ["pkexec", "install", "--mode=644","--owner=0",channelpath, - apt_pkg.Config.FindDir("Dir::Etc::sourceparts")] + apt_pkg.config.find_dir("Dir::Etc::sourceparts")] res = subprocess.call(cmd, universal_newlines=True) if res != 0: return False # install the key as well if os.path.exists(channelkey): - cmd = ["gksu", - "--desktop", - "/usr/share/applications/gnome-app-install.desktop", - "--", + cmd = ["pkexec", "apt-key", "add",channelkey] res = subprocess.call(cmd, universal_newlines=True) if res != 0: diff -Nru apturl-0.5.2ubuntu11/AptUrl/kde/KdeUI.py apturl-0.5.2ubuntu11.1/AptUrl/kde/KdeUI.py --- apturl-0.5.2ubuntu11/AptUrl/kde/KdeUI.py 2015-12-16 10:08:32.000000000 +0000 +++ apturl-0.5.2ubuntu11.1/AptUrl/kde/KdeUI.py 2016-05-19 20:13:35.000000000 +0000 @@ -115,7 +115,7 @@ cmd = ["kdesudo", "--", "install", "--mode=644","--owner=0",channelpath, - apt_pkg.Config.FindDir("Dir::Etc::sourceparts")] + apt_pkg.config.find_dir("Dir::Etc::sourceparts")] res = subprocess.call(cmd, universal_newlines=True) if res != 0: return False diff -Nru apturl-0.5.2ubuntu11/debian/changelog apturl-0.5.2ubuntu11.1/debian/changelog --- apturl-0.5.2ubuntu11/debian/changelog 2016-01-13 11:48:22.000000000 +0000 +++ apturl-0.5.2ubuntu11.1/debian/changelog 2016-05-24 16:00:24.000000000 +0000 @@ -1,3 +1,19 @@ +apturl (0.5.2ubuntu11.1) xenial; urgency=medium + + * Fix common crashes (AttributeError in doEnableChannel), due to changes + in apt_pkg API, etc. (LP: #1566201) + + [ Brian Murray ] + * Port to proper apt_pkg APIs. + + [ Mathieu Trudel-Lapierre ] + * Override the start_available and start_error functions from Aptdaemon + backend correctly to match the passed parameters. + * Use pkexec rather than gksu to do our external calls to apt-key, install, + and software-properties, etc; since they need admin privileges. + + -- Mathieu Trudel-Lapierre Tue, 24 May 2016 12:00:20 -0400 + apturl (0.5.2ubuntu11) xenial; urgency=medium * Drop webkit1 support, we're switching to pure webkit2 now