Merge lp:~ted/ubuntu-app-launch/liblibertine-dep into lp:ubuntu-app-launch/15.10

Proposed by Ted Gould
Status: Work in progress
Proposed branch: lp:~ted/ubuntu-app-launch/liblibertine-dep
Merge into: lp:ubuntu-app-launch/15.10
Diff against target: 158 lines (+69/-4)
6 files modified
CMakeLists.txt (+3/-0)
debian/control (+1/-0)
libubuntu-app-launch/CMakeLists.txt (+1/-0)
libubuntu-app-launch/app-info.c (+38/-2)
libubuntu-app-launch/ubuntu-app-launch.c (+3/-2)
tests/libertine-home/libertine/ContainersConfig.json (+23/-0)
To merge this branch: bzr merge lp:~ted/ubuntu-app-launch/liblibertine-dep
Reviewer Review Type Date Requested Status
Indicator Applet Developers Pending
Review via email: mp+269204@code.launchpad.net

Commit message

Remove libertine custom code with calls to liblibertine

Description of the change

NOTE: Requires liblibertine to get into the archive.

To post a comment you must log in.
213. By Ted Gould

Dep on liblibertine

Unmerged revisions

213. By Ted Gould

Dep on liblibertine

212. By Ted Gould

Use liblibertine in ual.c

211. By Ted Gould

Use a boolean to track and keep the iter in the 'if'

210. By Ted Gould

Migrate the app-info code to liblibertine

209. By Ted Gould

Connecting in liblibertine

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2015-08-11 02:45:49 +0000
3+++ CMakeLists.txt 2015-08-26 13:15:07 +0000
4@@ -77,6 +77,9 @@
5 pkg_check_modules(MIR mirclient)
6 include_directories(${MIR_INCLUDE_DIRS})
7
8+pkg_check_modules(LIBERTINE libertine)
9+include_directories(${LIBERTINE_INCLUDE_DIRS})
10+
11 include_directories(${CMAKE_CURRENT_SOURCE_DIR})
12
13 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
14
15=== modified file 'debian/control'
16--- debian/control 2015-07-31 00:15:57 +0000
17+++ debian/control 2015-08-26 13:15:07 +0000
18@@ -15,6 +15,7 @@
19 libglib2.0-dev,
20 libgtest-dev,
21 libjson-glib-dev,
22+ liblibertine-dev,
23 liblttng-ust-dev,
24 libmirclient-dev (>= 0.5),
25 libnih-dbus-dev,
26
27=== modified file 'libubuntu-app-launch/CMakeLists.txt'
28--- libubuntu-app-launch/CMakeLists.txt 2015-08-11 19:11:15 +0000
29+++ libubuntu-app-launch/CMakeLists.txt 2015-08-26 13:15:07 +0000
30@@ -59,6 +59,7 @@
31 ${CLICK_LIBRARIES}
32 ${ZEITGEIST_LIBRARIES}
33 ${MIR_LIBRARIES}
34+ ${LIBERTINE_LIBRARIES}
35 helpers
36 -Wl,--no-undefined
37 )
38
39=== modified file 'libubuntu-app-launch/app-info.c'
40--- libubuntu-app-launch/app-info.c 2015-08-12 02:52:05 +0000
41+++ libubuntu-app-launch/app-info.c 2015-08-26 13:15:07 +0000
42@@ -19,6 +19,7 @@
43
44 #include <json-glib/json-glib.h>
45 #include <click.h>
46+#include <libertine.h>
47
48 #include "ubuntu-app-launch.h"
49 #include "app-info.h"
50@@ -258,19 +259,54 @@
51 return FALSE;
52 }
53
54+ gchar ** containerlist = libertine_list_containers();
55+
56+ if (true) {
57+ gchar * containerstr = g_strjoinv(", ", containerlist);
58+ g_debug("Libertine Containers: %s", containerstr);
59+ g_free(containerstr);
60+ }
61+
62+ gboolean validcontainer = FALSE;
63+ if (containerlist != NULL && containerlist[0] != NULL) {
64+ gchar ** containeriter = NULL;
65+ for (containeriter = containerlist; *containeriter != NULL; containeriter++) {
66+ if (g_strcmp0(*containeriter, container) == 0) {
67+ validcontainer = TRUE;
68+ break;
69+ }
70+ }
71+ }
72+
73+ g_strfreev(containerlist);
74+
75+ if (!validcontainer) {
76+ g_warning("Container '%s' is not in the libertine container list", container);
77+ return FALSE;
78+ }
79+
80 gchar * desktopname = g_strdup_printf("%s.desktop", app);
81
82- gchar * desktopdir = g_build_filename(g_get_user_cache_dir(), "libertine-container", container, "rootfs", "usr", "share", NULL);
83+ gchar * libertinedir = libertine_container_path(container);
84+ gchar * desktopdir = g_build_filename(libertinedir, "usr", "share", NULL);
85+ g_free(libertinedir);
86+
87 gchar * desktopfile = g_build_filename(desktopdir, "applications", desktopname, NULL);
88
89 if (!g_file_test(desktopfile, G_FILE_TEST_EXISTS)) {
90+ g_debug("Unable to find desktop file '%s' in container '%s' (checking userdir)", desktopfile, container);
91+
92 g_free(desktopdir);
93 g_free(desktopfile);
94
95- desktopdir = g_build_filename(g_get_user_data_dir(), "libertine-container", "user-data", container, ".local", "share", NULL);
96+ libertinedir = libertine_container_home_path(container);
97+ desktopdir = g_build_filename(libertinedir, ".local", "share", NULL);
98+ g_free(libertinedir);
99 desktopfile = g_build_filename(desktopdir, "applications", desktopname, NULL);
100
101 if (!g_file_test(desktopfile, G_FILE_TEST_EXISTS)) {
102+ g_debug("Unable to find desktop file '%s' in container '%s' (now failing)", desktopfile, container);
103+
104 g_free(desktopdir);
105 g_free(desktopfile);
106
107
108=== modified file 'libubuntu-app-launch/ubuntu-app-launch.c'
109--- libubuntu-app-launch/ubuntu-app-launch.c 2015-08-17 21:38:29 +0000
110+++ libubuntu-app-launch/ubuntu-app-launch.c 2015-08-26 13:15:07 +0000
111@@ -25,6 +25,7 @@
112 #include <fcntl.h>
113 #include <errno.h>
114 #include <zeitgeist.h>
115+#include <libertine.h>
116
117 #include "ubuntu-app-launch-trace.h"
118 #include "second-exec-core.h"
119@@ -1630,8 +1631,8 @@
120 g_return_val_if_fail(pkg != NULL, NULL);
121
122 /* Check if is a libertine container */
123- gchar * libertinepath = g_build_filename(g_get_user_cache_dir(), "libertine-container", pkg, NULL);
124- gboolean libcontainer = g_file_test(libertinepath, G_FILE_TEST_EXISTS);
125+ gchar * libertinepath = libertine_container_path(pkg);
126+ gboolean libcontainer = libertinepath != NULL;
127 g_free(libertinepath);
128
129 if (libcontainer) {
130
131=== added directory 'tests/libertine-home/libertine'
132=== added file 'tests/libertine-home/libertine/ContainersConfig.json'
133--- tests/libertine-home/libertine/ContainersConfig.json 1970-01-01 00:00:00 +0000
134+++ tests/libertine-home/libertine/ContainersConfig.json 2015-08-26 13:15:07 +0000
135@@ -0,0 +1,23 @@
136+{
137+ "containerList": [
138+ {
139+ "id": "another-container",
140+ "image": "wily",
141+ "installStatus": "new",
142+ "installedApps": [
143+ ],
144+ "name": "Ubuntu 'Wily Werewolf'",
145+ "type": "lxc"
146+ },
147+ {
148+ "id": "container-name",
149+ "image": "wily",
150+ "installStatus": "new",
151+ "installedApps": [
152+ ],
153+ "name": "Ubuntu 'Wily Werewolf'",
154+ "type": "lxc"
155+ }
156+ ],
157+ "defaultContainer": "container-name"
158+}

Subscribers

People subscribed via source and target branches