Merge lp:~cr3/checkbox/940627 into lp:checkbox

Proposed by Marc Tardif
Status: Merged
Merged at revision: 1303
Proposed branch: lp:~cr3/checkbox/940627
Merge into: lp:checkbox
Diff against target: 82 lines (+5/-16)
6 files modified
debian/changelog (+1/-0)
debian/checkbox-gtk.install (+0/-1)
gtk/checkbox-gtk.desktop.in (+0/-11)
plugins/backend_info.py (+2/-2)
po/POTFILES.in (+1/-1)
setup.cfg (+1/-1)
To merge this branch: bzr merge lp:~cr3/checkbox/940627
Reviewer Review Type Date Requested Status
Daniel Manrique (community) Approve
Marc Tardif (community) Needs Resubmitting
Review via email: mp+94622@code.launchpad.net

Description of the change

When reviewing, please make sure that the changes to plugins/backend_info.py are sane. Thanks!

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

Thanks for pointing out the dubious section!

Without the pointer to the desktop file, bug 776712 will resurface. So in any case they should point to the checkbox-qt file:

prefix = ["kdesudo", "--desktop", "/usr/share/applications/checkbox-qt.desktop", "--"]
prefix = ["gksu", "--description", "/usr/share/applications/checkbox-qt.desktop", "--"]

Check this merge request for a brief discussion on this topic:

https://code.launchpad.net/~carl-milette/checkbox/776712/+merge/62193

Revision history for this message
Marc Tardif (cr3) wrote :

But the checkbox-qt.desktop file will not exist in the case where only checkbox-gtk is installed. We could either check for the existence of the file and only pass it as argument when it is available. Or, we could always pass the checkbox-qt.desktop file as argument which seems to work with gksu and kdesudo if the file doesn't exist. Which would you prefer?

review: Needs Information
Revision history for this message
Daniel Manrique (roadmr) wrote :

Urgh :(

I see two solutions:

1- Add some logic to look for either checkbox-qt.desktop or checkbox-gtk.desktop and use the first one available.

2- Move to a single checkbox.desktop file. This would mean that checkbox-qt and checkbox-gtk would be mutually exclusive so this solution potentially sucks :(

3- make checkbox.desktop a symlink to the correct one, and have each package update the symlink to its .desktop file upon installation (does update-alternatives apply to .desktop files?)

OK, three solutions :)

Which one sounds easier to implement and more future-proof? (i'd say #1).

review: Needs Information
Revision history for this message
Marc Tardif (cr3) wrote :

Of the three solutions you propose, I would also lean towards the first one. However, the only problem is that the checkbox-gtk.desktop file will never exist. The point of this merge request is to prevent the confusion of potentially having two Desktop testing applications after upgrading from Oneiric to Precise. Since we agreed that checkbox-gtk should be upgraded rather than deprecated with a transitional package, we need to workaround the confusion caused by the two desktop files.

Since checkbox-gtk and checkbox-qt should be able to coexist, this also poses a problem for your second solution.

As for your third solution, my brain hurts just trying to think about it :(

Revision history for this message
Marc Tardif (cr3) wrote :

How about we revert this discussion to the suggestion you made ealier about always using the checkbox-qt.desktop file? In the most likely cases, this file will exist:

1. When installing Precise, only checkbox-qt will exist so the checkbox-qt.desktop file will be present.
2. When upgrading from Oneiric to Precise, or from Lucid to Precise for that matter, checkbox-qt will also exist so the checkbox-qt.desktop file will also be present. Even if running checkbox-gtk will effectively use the checkbox-qt.desktop file, that shouldn't make a difference.

The only corner case where bug 776712 would resurface is when someone explicitly installs checkbox-gtk and uninstalls checkbox-qt, implying also uninstalling ubuntu-desktop. I'd be comfortable with that.

Revision history for this message
Daniel Manrique (roadmr) wrote :

I think always using checkbox-qt is a reasonable behavior. In addition to what you mention in the last comment, I also checked the behavior for gksu, and if the --description points to a nonexistent file, it simply quotes that name.

So if checkbox-qt.desktop exists, it nicely says "The application named 'System Testing' wants privileges". If it doesn't exist, it says "The application named '/usr/share/applications/checkbox-qt.desktop' wants privileges".

This is potentially not entirely confusing to someone who, as you mention, removed checkbox-qt and ubuntu-desktop by hand.

So my suggestion, sneakily based mostly on *your* arguments, is to just default to checkbox-qt.desktop.

As per our new and fancy review process, since this implies some agreed-upon code changes, I'll set to "Needs Fixing".

review: Needs Fixing
Revision history for this message
Marc Tardif (cr3) wrote :

Ok, defaulting to checkbox-qt.desktop.

review: Needs Resubmitting
lp:~cr3/checkbox/940627 updated
1282. By Marc Tardif

Merged from trunk.

1283. By Marc Tardif

Reverted to just using /usr/share/applications/checkbox-qt.desktop when calling kdesudo or gksu.

Revision history for this message
Daniel Manrique (roadmr) wrote :

Awesome, thanks!

Merging.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2012-03-05 19:10:06 +0000
3+++ debian/changelog 2012-03-05 19:54:20 +0000
4@@ -30,6 +30,7 @@
5 * Tidied up logic for determining DISK device product and vendor
6 (LP: #942548)
7 * Fixed filename matching expression for local jobs (LP: #942273)
8+ * Fixed duplicate System Testing applications after upgrade (LP: #940627)
9
10 [Aurelien Gateau]
11 * lib/template.py, lib/template_i18n.py, plugins/jobs_info.py,
12
13=== modified file 'debian/checkbox-gtk.install'
14--- debian/checkbox-gtk.install 2011-12-05 15:25:22 +0000
15+++ debian/checkbox-gtk.install 2012-03-05 19:54:20 +0000
16@@ -1,5 +1,4 @@
17 usr/bin/checkbox-gtk
18-usr/share/applications/checkbox-gtk.desktop
19 usr/share/checkbox/gtk/*
20 usr/share/checkbox/examples/checkbox-gtk.ini
21 usr/lib/python*/*-packages/checkbox_gtk/*
22
23=== removed file 'gtk/checkbox-gtk.desktop.in'
24--- gtk/checkbox-gtk.desktop.in 2011-09-16 19:40:25 +0000
25+++ gtk/checkbox-gtk.desktop.in 1970-01-01 00:00:00 +0000
26@@ -1,11 +0,0 @@
27-[Desktop Entry]
28-_Name=System Testing
29-_Comment=Test your system and submit results to the Ubuntu Friendly project
30-Encoding=UTF-8
31-Exec=/usr/bin/checkbox-gtk
32-Terminal=false
33-Type=Application
34-Icon=checkbox
35-StartupNotify=true
36-Categories=GTK;GNOME;Application;System;Settings;
37-X-Ubuntu-Gettext-Domain=checkbox
38
39=== modified file 'plugins/backend_info.py'
40--- plugins/backend_info.py 2011-12-08 22:31:36 +0000
41+++ plugins/backend_info.py 2012-03-05 19:54:20 +0000
42@@ -62,13 +62,13 @@
43 stdout=PIPE, stderr=PIPE) == 0 and \
44 call(["pgrep", "-x", "-u", str(uid), "ksmserver"],
45 stdout=PIPE, stderr=PIPE) == 0:
46- prefix = ["kdesudo", "--desktop", "/usr/share/applications/checkbox-gtk.desktop", "--"]
47+ prefix = ["kdesudo", "--desktop", "/usr/share/applications/checkbox-qt.desktop", "--"]
48 elif os.getenv("DISPLAY") and \
49 call(["which", "gksu"],
50 stdout=PIPE, stderr=PIPE) == 0 and \
51 call(["pgrep", "-x", "-u", str(uid), "gnome-panel|gconfd-2"],
52 stdout=PIPE, stderr=PIPE) == 0:
53- prefix = ["gksu", "--description", "/usr/share/applications/checkbox-gtk.desktop", "--"]
54+ prefix = ["gksu", "--description", "/usr/share/applications/checkbox-qt.desktop", "--"]
55 else:
56 prefix = ["sudo"]
57
58
59=== modified file 'po/POTFILES.in'
60--- po/POTFILES.in 2011-12-15 15:54:31 +0000
61+++ po/POTFILES.in 2012-03-05 19:54:20 +0000
62@@ -1,6 +1,6 @@
63 [encoding: UTF-8]
64 [type: gettext/glade] gtk/checkbox-gtk.ui
65-gtk/checkbox-gtk.desktop.in
66+qt/checkbox-qt.desktop.in
67 [type: gettext/rfc822deb] jobs/audio.txt.in
68 [type: gettext/rfc822deb] jobs/autotest.txt.in
69 [type: gettext/rfc822deb] jobs/bluetooth.txt.in
70
71=== modified file 'setup.cfg'
72--- setup.cfg 2011-12-05 15:25:22 +0000
73+++ setup.cfg 2012-03-05 19:54:20 +0000
74@@ -4,7 +4,7 @@
75 [build_i18n]
76 domain=checkbox
77 desktop_files=[
78- ("share/applications", ("gtk/checkbox-gtk.desktop.in","qt/checkbox-qt.desktop.in"))]
79+ ("share/applications", ("qt/checkbox-qt.desktop.in"))]
80 rfc822deb_files=[
81 ("share/checkbox/jobs",
82 ("jobs/audio.txt.in",

Subscribers

People subscribed via source and target branches