Merge lp:~ted/ubuntu-app-launch/check-appid-tag into lp:ubuntu-app-launch/15.04

Proposed by Ted Gould
Status: Merged
Approved by: Alejandro J. Cura
Approved revision: 197
Merged at revision: 196
Proposed branch: lp:~ted/ubuntu-app-launch/check-appid-tag
Merge into: lp:ubuntu-app-launch/15.04
Diff against target: 103 lines (+56/-1)
4 files modified
desktop-hook.c (+2/-1)
tests/click-root-dir/com.test.good/1.2.4/.click/info/com.test.good.manifest (+8/-0)
tests/click-root-dir/com.test.good/1.2.5/.click/info/com.test.good.manifest (+8/-0)
tests/desktop-hook-test.sh.in (+38/-0)
To merge this branch: bzr merge lp:~ted/ubuntu-app-launch/check-appid-tag
Reviewer Review Type Date Requested Status
PS Jenkins bot (community) continuous-integration Approve
Alejandro J. Cura (community) Approve
Review via email: mp+261020@code.launchpad.net

Commit message

Fallback to looking for the AppID tag if the source is missing

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
197. By Ted Gould

A test for the upgrade path

Revision history for this message
Alejandro J. Cura (alecu) wrote :

Looks good to me.

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'desktop-hook.c'
2--- desktop-hook.c 2015-04-08 20:42:55 +0000
3+++ desktop-hook.c 2015-06-03 20:49:03 +0000
4@@ -151,9 +151,10 @@
5 NULL); /* No error */
6
7 if (!g_key_file_has_key(keyfile, DESKTOP_GROUP, SOURCE_FILE_KEY, NULL)) {
8+ gboolean hasappid = g_key_file_has_key(keyfile, DESKTOP_GROUP, APP_ID_KEY, NULL);
9 g_free(desktopfile);
10 g_key_file_free(keyfile);
11- return FALSE;
12+ return hasappid;
13 }
14
15 /* At this point we know the key exists, so if we can't find the source
16
17=== added directory 'tests/click-root-dir/.click/users/test-user-4'
18=== added symlink 'tests/click-root-dir/.click/users/test-user-4/com.test.good'
19=== target is u'../../../com.test.good/1.2.4/'
20=== added directory 'tests/click-root-dir/.click/users/test-user-5'
21=== added symlink 'tests/click-root-dir/.click/users/test-user-5/com.test.good'
22=== target is u'../../../com.test.good/1.2.5/'
23=== added directory 'tests/click-root-dir/com.test.good/1.2.4'
24=== added directory 'tests/click-root-dir/com.test.good/1.2.4/.click'
25=== added directory 'tests/click-root-dir/com.test.good/1.2.4/.click/info'
26=== added file 'tests/click-root-dir/com.test.good/1.2.4/.click/info/com.test.good.manifest'
27--- tests/click-root-dir/com.test.good/1.2.4/.click/info/com.test.good.manifest 1970-01-01 00:00:00 +0000
28+++ tests/click-root-dir/com.test.good/1.2.4/.click/info/com.test.good.manifest 2015-06-03 20:49:03 +0000
29@@ -0,0 +1,8 @@
30+{
31+ "version": "1.2.4",
32+ "hooks": {
33+ "application": {
34+ "desktop": "application.desktop"
35+ }
36+ }
37+}
38
39=== added symlink 'tests/click-root-dir/com.test.good/1.2.4/application.desktop'
40=== target is u'../../../click-app-dir/application.desktop'
41=== added directory 'tests/click-root-dir/com.test.good/1.2.5'
42=== added directory 'tests/click-root-dir/com.test.good/1.2.5/.click'
43=== added directory 'tests/click-root-dir/com.test.good/1.2.5/.click/info'
44=== added file 'tests/click-root-dir/com.test.good/1.2.5/.click/info/com.test.good.manifest'
45--- tests/click-root-dir/com.test.good/1.2.5/.click/info/com.test.good.manifest 1970-01-01 00:00:00 +0000
46+++ tests/click-root-dir/com.test.good/1.2.5/.click/info/com.test.good.manifest 2015-06-03 20:49:03 +0000
47@@ -0,0 +1,8 @@
48+{
49+ "version": "1.2.5",
50+ "hooks": {
51+ "application": {
52+ "desktop": "application.desktop"
53+ }
54+ }
55+}
56
57=== added symlink 'tests/click-root-dir/com.test.good/1.2.5/application.desktop'
58=== target is u'../../../click-app-dir/application.desktop'
59=== modified file 'tests/desktop-hook-test.sh.in'
60--- tests/desktop-hook-test.sh.in 2015-04-06 21:47:57 +0000
61+++ tests/desktop-hook-test.sh.in 2015-06-03 20:49:03 +0000
62@@ -89,3 +89,41 @@
63
64 grep "^X-Ubuntu-UAL-Source-Desktop=@CMAKE_CURRENT_SOURCE_DIR@/click-root-dir" ${APPS_DIR}/com.test.good_application_1.2.3.desktop > /dev/null
65
66+# Upgrade the good application
67+
68+mv ${CLICK_DIR}/com.test.good_application_1.2.3.desktop ${CLICK_DIR}/com.test.good_application_1.2.4.desktop
69+export TEST_CLICK_USER=test-user-4
70+
71+@CMAKE_BINARY_DIR@/desktop-hook
72+
73+if [ -e ${APPS_DIR}/com.test.good_application_1.2.3.desktop ] ; then
74+ echo "Desktop file not removed for: com.test.good_application_1.2.3"
75+ exit 1
76+fi
77+
78+if [ ! -e ${APPS_DIR}/com.test.good_application_1.2.4.desktop ] ; then
79+ echo "Desktop file not created for: com.test.good_application_1.2.4"
80+ exit 1
81+fi
82+
83+# Upgrade the good application, but don't have a Source line like in an upgrade scenario
84+
85+mv ${CLICK_DIR}/com.test.good_application_1.2.4.desktop ${CLICK_DIR}/com.test.good_application_1.2.5.desktop
86+cat ${APPS_DIR}/com.test.good_application_1.2.4.desktop | grep -v "^X-Ubuntu-UAL-Source-Desktop" > ${APPS_DIR}/com.test.good_application_1.2.4.desktop.tmp
87+rm ${APPS_DIR}/com.test.good_application_1.2.4.desktop
88+mv ${APPS_DIR}/com.test.good_application_1.2.4.desktop.tmp ${APPS_DIR}/com.test.good_application_1.2.4.desktop
89+
90+export TEST_CLICK_USER=test-user-5
91+
92+
93+@CMAKE_BINARY_DIR@/desktop-hook
94+
95+if [ -e ${APPS_DIR}/com.test.good_application_1.2.4.desktop ] ; then
96+ echo "Desktop file not removed for: com.test.good_application_1.2.4"
97+ exit 1
98+fi
99+
100+if [ ! -e ${APPS_DIR}/com.test.good_application_1.2.5.desktop ] ; then
101+ echo "Desktop file not created for: com.test.good_application_1.2.5"
102+ exit 1
103+fi

Subscribers

People subscribed via source and target branches