Refreshing package lists in KDE should prefer Adept over Synaptic

Bug #288653 reported by Kieran Hogg
2
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Fix Released
Undecided
Roderick B. Greening

Bug Description

Binary package hint: update-notifier-kde

TEST CASE in comment 11:
https://bugs.launchpad.net/ubuntu/+source/apt/+bug/288653/comments/11

I have both gksu and synaptic installed and when asked to refresh the package lists, it chooses to use synapyic and gksu over the kde counterparts. I imagine this is just the backend preferring it but it looks a bit jarring to use.

Revision history for this message
swoody (swoody) wrote :

Thank you very much for reporting this. I changed the title to include a little bit more information, so hopefully someone with knowledge in this particular area can find this report easier. Thank you again for taking the time to report this, and for helping to improve Ubuntu!

Revision history for this message
Roderick B. Greening (roderick-greening) wrote :

Given that update-notifier-kde uses kdesudo, I suspect that this is not the package in question. Can you provide the distro version (Hardy, Intrepid, etc) and exactly the steps/apps used and any other details to help us direct this to the correct location?

Marking incomplete for now.

Changed in update-notifier-kde:
status: New → Incomplete
Revision history for this message
Kieran Hogg (xerosis) wrote :

Apologies for the vagueness, I've not seen it before:
I got a lightbulb in the tray like the 'firefox has been updated' notice. When I clicked it it said that it had been unable to refresh the package lists due to a connection error and I would need to do it manually. The button said 'perform this action now'. After I clicked that I saw gksu and synaptic updating it.

Distro is Intrepid.

Revision history for this message
Roderick B. Greening (roderick-greening) wrote :

I've seen this now too. update-notifier-common may be at fault here (or at least needs some looking into).

Revision history for this message
Roderick B. Greening (roderick-greening) wrote :

apt hardcodes "gksu synaptic" in it hook file which breaks any DE not using synaptic. Since synaptic is no guaranteed to be installed, this is not a good approach for ensuring the hook can be dealt with by update-notifier or update-notifier-kde.

Changed in update-notifier-kde:
status: Incomplete → Confirmed
Revision history for this message
Roderick B. Greening (roderick-greening) wrote :

I am working on a fix for the hook problem with package apt. It will require a simple script to detect the DE session running and prefer Adept/Kdesudo if running KDE, otherwise default back to Synaptic and Gksu. The hook file will then call this script rather than 'gksu -- synaptic' directly.

Changed in apt:
assignee: nobody → roderick-greening
status: Confirmed → In Progress
Revision history for this message
Roderick B. Greening (roderick-greening) wrote :

Attached debdiff to deal with the inconsistency/issue.

Changed in apt:
status: In Progress → Fix Committed
Revision history for this message
Roderick B. Greening (roderick-greening) wrote :
Revision history for this message
Roderick B. Greening (roderick-greening) wrote :

The following is true for Intrepid release (and earlier), Kubuntu (KDE), default install

TEST CASE:
A)
 1. install Kubuntu Intrepid (full release) - default install
 2. if apt updates and generates an authentication failure, a hook is generated and placed in /var/lib/update-notifier/user.d/
 3. update-notifier-kde detects the hook but it does nothing with it as the command line in 'apt-auth-failure.note' is as follows:
     'gksu -- synaptic --non-interactive --update-at-startup --hide-main-window'
     The default install of Kubuntu has neither gksu nor synaptic (they have kdesudo and install-package as equivalents).
B)
 1. install Kubuntu Intrepid (full release) and install gksu along with synaptic
 2. if apt updates and generates an authentication failure, a hook is generated and placed in /var/lib/update-notifier/user.d/
 3. update-notifier-kde detects the hook and it runs successfully, however the user experience is now inconsistent (we should
     be using the Kubuntu native applications).

ANALYSIS

Under the existing apt, the package hook for apt failures will only run if a) gksu is installed and b) synaptic is installed. In the test cases above, we find two issues: 1) a default install does not work as expected due to the fact the user is never notified that apt had an auth failure and 2) in order to make it work, we have to install two non-native packages.

We could simply add gksu and synaptic to the Kubuntu seed, however, this presents a problem for Kubuntu, which aims to provide Qt/KDE application equivalents to their Ubuntu Gtk+/Gnome counterparts. A more elegant solution would be to have a simple wrapper script detect the desktop session running and whether the associated su and package manager is installed and execute the apt updater based on the results. This wraper would then be called from the 'apt-auth-failure.note' hook.

WORKAROUND:

I have written a wrapper script which accomplishes the 'elegant' solution meantioned above. Installing this wrapper script and modifying the 'apt-auth-failure.note' Command entry to point to the wrapper allows a number of possible combinations to work, thus providing the user with the expected results.

1) It detects which desktop session is running (kde, gnome, etc) and sets the preferred applications based on this
2) It detects which of the preferred applications are installed
3) It runs the apt update via the results of 1) and 2) above or prints an error indicating no suitable combination exists to exec the hook

The patch for this solution is included in this bug report.

The patch allows for any combination of gksu, kdesudo and any combination of synaptic, install-package to provide a successful result. The script is also written in such a way as to allow other applications (gksudo, kdesu, adept, etc) to be inserted fairly easily (comments indicate where to do this).

Michael Vogt (mvo)
description: updated
Revision history for this message
Roderick B. Greening (roderick-greening) wrote :

Should have been marked released long ago.

Changed in apt (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.