~ci-train-bot/url-dispatcher/url-dispatcher-ubuntu-zesty-2664

« back to all changes in this revision

Viewing changes to service/url-overlay/exec-tool.c

  • Committer: Bileto Bot
  • Author(s): Rodney Dawes
  • Date: 2017-03-14 14:33:40 UTC
  • mfrom: (103.2.4 drop-click)
  • Revision ID: ci-train-bot@canonical.com-20170314143340-k2boxg7qkut3tiaz
Remove click usage and support.

Approved by: Ted Gould

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
 */
19
19
 
20
20
#include <glib.h>
21
 
#include <click.h>
22
21
#include <ubuntu-app-launch.h>
23
22
 
24
23
#include "recoverable-problem.h"
64
63
gchar *
65
64
build_dir (const gchar * appid)
66
65
{
67
 
        GError * error = NULL;
68
66
        gchar * package = NULL;
69
67
 
70
68
        /* 'Parse' the App ID */
73
71
                return NULL;
74
72
        }
75
73
 
76
 
        /* Check click to find out where the files are */
77
 
        ClickDB * db = click_db_new();
78
 
 
79
 
        /* If TEST_CLICK_DB is unset, this reads the system database. */
80
 
        click_db_read(db, g_getenv("TEST_CLICK_DB"), &error);
81
 
        if (error != NULL) {
82
 
                g_warning("Unable to read Click database: %s", error->message);
83
 
                g_error_free(error);
84
 
                g_free(package);
85
 
                return NULL;
86
 
        }
87
 
 
88
 
        /* If TEST_CLICK_USER is unset, this uses the current user name. */
89
 
        ClickUser * user = click_user_new_for_user(db, g_getenv("TEST_CLICK_USER"), &error);
90
 
        if (error != NULL) {
91
 
                g_warning("Unable to read Click database: %s", error->message);
92
 
                g_error_free(error);
93
 
                g_free(package);
94
 
                g_object_unref(db);
95
 
                return NULL;
96
 
        }
97
 
 
98
 
        gchar * pkgdir = click_user_get_path(user, package, &error);
99
 
 
100
 
        g_object_unref(user);
101
 
        g_object_unref(db);
102
 
        g_free(package);
103
 
 
104
 
        if (error != NULL) {
105
 
                g_warning("Unable to get the Click package directory for %s: %s", package, error->message);
106
 
                g_error_free(error);
107
 
                return NULL;
108
 
        }
109
 
 
110
 
        return pkgdir;
 
74
        return NULL;
111
75
}
112
76
 
113
77
int
133
97
                exec = build_exec(appid, OVERLAY_SYSTEM_DIRECTORY);
134
98
        }
135
99
 
136
 
        /* If not there look to the user directory (click) */
137
 
        if (exec == NULL) {
138
 
                gchar * userdir = g_build_filename(g_get_user_cache_dir(), "url-dispatcher", "url-overlays", NULL);
139
 
                exec = build_exec(appid, userdir);
140
 
                g_free(userdir);
141
 
        }
142
 
 
143
100
        if (exec == NULL) {
144
101
                const gchar * props[3] = {
145
102
                        "AppID",