Commit cd698c6f authored by Steven Arnow's avatar Steven Arnow

fix dependency check

parent 3b6108db
......@@ -37,7 +37,7 @@
<arg type='i' name='dummy' direction='out' />
</method>
<method name='PackageList'>
<arg type='a(sss)' name='entry' direction='out' />
<arg type='a(ssss)' name='entry' direction='out' />
</method>
<signal name='NewMeta'>
<arg type='s' name='pkg_id' />
......
......@@ -20,8 +20,8 @@ LIB = "$(TOPDIR)/dbp-common/dbp-common.a"
LIBINC = "-I$(TOPDIR)/libdbpbase" "-I$(TOPDIR)/build/include"
LDPATH += "-L$(TOPDIR)/build/lib"
#DBGFLAGS = -O0 -g -D__DEBUG__
DBGFLAGS = -O3 -g
DBGFLAGS = -O0 -g -D__DEBUG__
#DBGFLAGS = -O3 -g
CFLAGS += -Wall -Wextra -D_XOPEN_SOURCE=700 -std=c99 $(INCS) $(DBGFLAGS)
LDFLAGS += -larchive -lpthread
RM = rm -fR
......
......@@ -83,7 +83,7 @@ static void vtab_method_call(GDBusConnection *conn, const gchar *sender, const g
int i;
GVariantBuilder *builder;
builder = g_variant_builder_new(G_VARIANT_TYPE("a(sss)"));
builder = g_variant_builder_new(G_VARIANT_TYPE("a(ssss)"));
pthread_mutex_lock(&p->mutex);
for (i = 0; i < p->entries; i++) {
......@@ -96,7 +96,7 @@ static void vtab_method_call(GDBusConnection *conn, const gchar *sender, const g
pthread_mutex_unlock(&p->mutex);
g_dbus_method_invocation_return_value(inv, g_variant_new("(a(sss))", builder));
g_dbus_method_invocation_return_value(inv, g_variant_new("(a(ssss))", builder));
g_variant_builder_unref(builder);
} else if (!g_strcmp0(method_name, "Introspect")) {
g_dbus_method_invocation_return_value(inv, g_variant_new("s", introspection_xml));
......
......@@ -131,18 +131,18 @@ int dbpmgr_server_path_from_id(const char *pkg_id, char **path) {
struct DBPList *dbpmgr_server_package_list() {
GVariantIter *iter;
char *path, *id, *desktop, version;
char *path, *id, *desktop, *version;
struct DBPList *prev = NULL, *this = NULL;
SEND_MESSAGE("PackageList", NULL, NULL);
(void) reti;
g_variant_get(ret, "(a(sss))", &iter);
while (g_variant_iter_loop(iter, "(ssss)", &path, &id, &desktop, &version)) {
g_variant_get(ret, "(a(ssss))", &iter);
for (path = id = desktop = version = NULL; g_variant_iter_loop(iter, "(ssss)", &path, &id, &desktop, &version); path = id = desktop = version = NULL) {
if (!strcmp(id, "!"))
continue;
this = malloc(sizeof(*this));
this->path = strdup(path);
this->id = strdup(id);
this->version = strdup(id);
this->version = strdup(version);
this->on_desktop = !strcmp(desktop, "desk");
this->next = prev;
prev = this;
......
......@@ -397,7 +397,10 @@ struct DBPDependDPackage *dbpmgr_depend_debian_next(const char *pkg_name, struct
void dbpmgr_depend_free(struct DBPDepend *dep) {
free(dep->version);
int i;
for (i = 0; i < DBPMGR_DEPEND_VERSION_CHECKS; i++)
free(dep->version[i]);
free(dep->pkg_name);
free(dep->arch);
free(dep);
......@@ -446,8 +449,8 @@ static void build_dbp_database() {
return;
for (next = list; next; next = next->next) {
this = calloc(sizeof(*this), 1);
this->version = strdup(this->version);
this->name = strdup(this->name);
this->version = strdup(next->version);
this->name = strdup(next->id);
dbp_root = package_tree_populate(dbp_root, this, 0);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment