Skip to content
Snippets Groups Projects
Commit 3ebdf288 authored by Suvendhu Hansa's avatar Suvendhu Hansa :speech_balloon:
Browse files

optimization of du_list method

parent 82b3c2cb
Branches
No related tags found
1 merge request!25optimization of du_list method
Pipeline #37208 passed
......@@ -553,8 +553,6 @@ swmod_du_list(struct ubus_context *ctx, struct ubus_object *obj,
void *a;
unsigned int eid = get_eid_from_blob(msg);
synchronize_deployment_units_with_map_du_file();
memset(&bb, 0, sizeof(struct blob_buf));
blob_buf_init(&bb, 0);
......
......@@ -675,6 +675,12 @@ int swmod_lxc_install_update_remove_package(const char *package_path, int cid, i
sscanf(g_lxc_buff, "pkg_name=%63s pkg_version=%63s",
package_name, package_version);
}
char root[512];
snprintf(root, 512, "%s/%s/rootfs", lxcpath, ct->name);
PRINT_DEBUG("Reading from container[%s] path[%s]", ct->name, root);
populate_opkg_deployment_unit(cid + 2, root, ct->name);
FREE(g_lxc_buff);
err = 0;
}
......
......@@ -60,6 +60,11 @@ static int swmod_host_system_install_package(const char *package_path)
pclose(log);
}
if (err == 0) {
/* du unit installed, now update the du list */
PRINT_DEBUG("Populate du for eid 1\n");
populate_opkg_deployment_unit(1, NULL, NULL);
}
return err;
}
......@@ -88,6 +93,11 @@ static int swmod_host_system_update_package(const char *package_path)
package_version[len - 3] = '\0';
}
if (err == 0) {
/* du unit updated, now update the du list */
PRINT_DEBUG("Populate du for eid 1\n");
populate_opkg_deployment_unit(1, NULL, NULL);
}
return err;
}
......@@ -110,6 +120,11 @@ int swmod_host_system_remove_package(const char *pname)
pclose(log);
}
if (err == 0) {
/* du unit removed, now update the du list */
PRINT_DEBUG("Populate du for eid 1\n");
populate_opkg_deployment_unit(1, NULL, NULL);
}
return err;
}
......@@ -220,7 +235,7 @@ int swmod_remove_package(const char *pname, int eid)
bool is_opkg_service(const char *opkg_info, char *pkg_name)
{
/* Get Config from package_name.list */
bool service = true;
bool service = false;
char pkg_path[128] = {0};
snprintf(pkg_path, sizeof(pkg_path), "%s/%s.list", opkg_info, pkg_name);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment