auc: small improvements

Detect if calling rpc-sys packagelist fails due to the method not
being provided by rpcd.
Mark package as experimental.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
Daniel Golle
2017-11-13 00:39:30 +01:00
parent 95d96a360f
commit 123ddf66ae
2 changed files with 11 additions and 24 deletions
+9 -22
View File
@@ -683,17 +683,15 @@ int main(int args, char *argv[]) {
blobmsg_buf_init(&imgbuf);
blobmsg_buf_init(&upgbuf);
if (!ubus_lookup_id(ctx, "system", &id)) {
ubus_invoke(ctx, id, "board", NULL, board_cb, &checkbuf, 3000);
} else {
if (ubus_lookup_id(ctx, "system", &id) ||
ubus_invoke(ctx, id, "board", NULL, board_cb, &checkbuf, 3000)) {
fprintf(stderr, "cannot request board info from procd\n");
rc=-1;
goto freebufs;
}
if (!ubus_lookup_id(ctx, "rpc-sys", &id)) {
ubus_invoke(ctx, id, "packagelist", NULL, pkglist_cb, &checkbuf, 3000);
} else {
if (ubus_lookup_id(ctx, "rpc-sys", &id) ||
ubus_invoke(ctx, id, "packagelist", NULL, pkglist_cb, &checkbuf, 3000)) {
fprintf(stderr, "cannot request packagelist from rpcd\n");
rc=-1;
goto freeboard;
@@ -741,10 +739,7 @@ int main(int args, char *argv[]) {
}
if (retry || queuepos) {
if (imgbuf.buf)
free(imgbuf.buf);
memset(&imgbuf, '\0', sizeof(imgbuf));
blob_buf_free(&imgbuf);
blobmsg_buf_init(&imgbuf);
sleep(3);
}
@@ -828,19 +823,11 @@ freeboard:
free(version);
free(revision);
freebufs:
if (checkbuf.buf)
free(checkbuf.buf);
if (reqbuf.buf)
free(reqbuf.buf);
if (imgbuf.buf)
free(imgbuf.buf);
if (upgbuf.buf)
free(upgbuf.buf);
blob_buf_free(&checkbuf);
blob_buf_free(&reqbuf);
blob_buf_free(&imgbuf);
blob_buf_free(&upgbuf);
freessl:
if (ssl_ctx)