#include "verbose.h"
#include "utils-systemd.h"
-#include "afm.h"
#include "afm-udb.h"
#include "afm-urun.h"
#include "wgt-info.h"
struct json_object *json;
json = afb_req_json(req);
- if (wrap_json_unpack(json, "s", runid)
- || wrap_json_unpack(json, "{ss}", "runid", runid)) {
+ if (wrap_json_unpack(json, "i", runid)
+ && wrap_json_unpack(json, "{si}", _runid_, runid)) {
INFO("bad request method %s: %s", method,
json_object_to_json_string(json));
bad_request(req);
/* scan the request */
json = afb_req_json(req);
if (wrap_json_unpack(json, "s", &appid)
- || wrap_json_unpack(json, "{ss}", _id_, &appid)) {
+ && wrap_json_unpack(json, "{ss}", _id_, &appid)) {
bad_request(req);
return;
}
/* scan the request */
json = afb_req_json(req);
if (wrap_json_unpack(json, "s", &appid)
- || wrap_json_unpack(json, "{ss}", _id_, &appid)) {
+ && wrap_json_unpack(json, "{ss}", _id_, &appid)) {
bad_request(req);
return;
}
/* returns */
resp = NULL;
+#if 0
wrap_json_pack(&resp, "{si}", _runid_, runid);
+#else
+ wrap_json_pack(&resp, "i", runid);
+#endif
afb_req_success(req, resp, NULL);
}
/* scan the request */
json = afb_req_json(req);
if (wrap_json_unpack(json, "s", &appid)
- || wrap_json_unpack(json, "{ss}", _id_, &appid)) {
+ && wrap_json_unpack(json, "{ss}", _id_, &appid)) {
bad_request(req);
return;
}
/* scan the request */
json = afb_req_json(req);
if (wrap_json_unpack(json, "s", &wgtfile)
- || wrap_json_unpack(json, "{ss s?s s?b s?b}",
+ && wrap_json_unpack(json, "{ss s?s s?b s?b}",
"wgt", &wgtfile,
"root", &root,
"force", &force,
if (ifo == NULL)
afb_req_fail_f(req, "failed", "installation failed: %m");
else {
+ afm_udb_update(afudb);
/* reload if needed */
if (reload)
do_reloads();
/* scan the request */
json = afb_req_json(req);
if (wrap_json_unpack(json, "s", &idaver)
- || wrap_json_unpack(json, "{ss s?s}",
+ && wrap_json_unpack(json, "{ss s?s}",
_id_, &idaver,
"root", &root)) {
return bad_request(req);
if (rc)
afb_req_fail_f(req, "failed", "uninstallation failed: %m");
else {
+ afm_udb_update(afudb);
afb_req_success(req, NULL, NULL);
application_list_changed(_uninstall_, idaver);
}
return -1;
}
- /* set the systemd's buses */
- systemd_set_bus(0, afb_daemon_get_system_bus());
- systemd_set_bus(1, afb_daemon_get_user_bus());
-
/* create TRUE */
json_true = json_object_new_boolean(1);