diff options
| author | Daniel Golle <daniel@makrotopia.org> | 2019-03-08 00:32:03 +0100 |
|---|---|---|
| committer | Daniel Golle <daniel@makrotopia.org> | 2019-03-08 00:32:48 +0100 |
| commit | 8945a3f4d5d9e4f1acf46b155f04547621e2c1a7 (patch) | |
| tree | 9f4906376267a1c179c8f27094692584c9e53fb2 /utils/auc | |
| parent | a903808e2c5164c11e82eca6238ab9224b5e3d85 (diff) | |
auc: send revision in update check
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Diffstat (limited to 'utils/auc')
| -rw-r--r-- | utils/auc/Makefile | 2 | ||||
| -rw-r--r-- | utils/auc/src/auc.c | 16 |
2 files changed, 12 insertions, 6 deletions
diff --git a/utils/auc/Makefile b/utils/auc/Makefile index ea97127aa..0b44d0e5d 100644 --- a/utils/auc/Makefile +++ b/utils/auc/Makefile @@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=auc -PKG_VERSION:=0.1.3 +PKG_VERSION:=0.1.4 PKG_RELEASE:=1 PKG_LICENSE:=GPL-3.0 diff --git a/utils/auc/src/auc.c b/utils/auc/src/auc.c index 9a09c920a..9bdd5298f 100644 --- a/utils/auc/src/auc.c +++ b/utils/auc/src/auc.c @@ -13,7 +13,7 @@ */ #define _GNU_SOURCE -#define AUC_VERSION "0.1.3" +#define AUC_VERSION "0.1.4" #include <fcntl.h> #include <dlfcn.h> @@ -62,7 +62,7 @@ static int output_fd = -1; static int retry, imagebuilder, building, ibready; static char *board_name = NULL; static char *target = NULL; -static char *distribution = NULL, *version = NULL; +static char *distribution = NULL, *version = NULL, *revision = NULL; static int uptodate; static char *filename = NULL; static int rc; @@ -93,6 +93,7 @@ static const struct blobmsg_policy board_policy[__BOARD_MAX] = { enum { RELEASE_DISTRIBUTION, RELEASE_VERSION, + RELEASE_REVISION, RELEASE_TARGET, __RELEASE_MAX, }; @@ -100,6 +101,7 @@ enum { static const struct blobmsg_policy release_policy[__RELEASE_MAX] = { [RELEASE_DISTRIBUTION] = { .name = "distribution", .type = BLOBMSG_TYPE_STRING }, [RELEASE_VERSION] = { .name = "version", .type = BLOBMSG_TYPE_STRING }, + [RELEASE_REVISION] = { .name = "revision", .type = BLOBMSG_TYPE_STRING }, [RELEASE_TARGET] = { .name = "target", .type = BLOBMSG_TYPE_STRING }, }; @@ -308,20 +310,24 @@ static void board_cb(struct ubus_request *req, int type, struct blob_attr *msg) blobmsg_parse(release_policy, __RELEASE_MAX, rel, blobmsg_data(tb[BOARD_RELEASE]), blobmsg_data_len(tb[BOARD_RELEASE])); - if (!rel[RELEASE_TARGET]) { - fprintf(stderr, "No target received\n"); + if (!rel[RELEASE_TARGET] || + !rel[RELEASE_DISTRIBUTION] || + !rel[RELEASE_VERSION] || + !rel[RELEASE_REVISION]) { + fprintf(stderr, "No release information received\n"); rc=-1; return; } target = strdup(blobmsg_get_string(rel[RELEASE_TARGET])); - distribution = strdup(blobmsg_get_string(rel[RELEASE_DISTRIBUTION])); version = strdup(blobmsg_get_string(rel[RELEASE_VERSION])); + revision = strdup(blobmsg_get_string(rel[RELEASE_REVISION])); blobmsg_add_string(buf, "distro", distribution); blobmsg_add_string(buf, "target", target); blobmsg_add_string(buf, "version", version); + blobmsg_add_string(buf, "revision", revision); } /* |
