auc: update to version 0.1.7
authorDaniel Golle <daniel@makrotopia.org>
Tue, 15 Jun 2021 08:34:17 +0000 (09:34 +0100)
committerDaniel Golle <daniel@makrotopia.org>
Tue, 15 Jun 2021 09:47:50 +0000 (10:47 +0100)
No longer fail in case a package is part of multiple lists (which may
happen temporarily in case it becomes 'nonshared').
Bump version to prepare for sync accross branches.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
utils/auc/Makefile
utils/auc/src/auc.c

index 4faf38bf9c0c9c6f1e17e0a31b2ddd4dfa067d07..58e026a8d807490cfd94c2e0dce1a4ab334186bb 100644 (file)
@@ -5,7 +5,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=auc
-PKG_VERSION:=0.1.6
+PKG_VERSION:=0.1.7
 PKG_RELEASE:=$(AUTORELEASE)
 PKG_LICENSE:=GPL-3.0
 
index 221b0b6ee5a97746a179cc78bb79feb1e4a727c1..ebda3eed8cd17d7d70ed934f62f87dba1b037573 100644 (file)
@@ -1251,11 +1251,25 @@ static int add_upg_packages(struct blob_attr *reply, char *arch)
 
        blobmsg_for_each_attr(cur, packages, rem) {
                avpk = malloc(sizeof(struct avl_pkg));
+               if (!avpk)
+                       return -ENOMEM;
+
                avpk->name = strdup(blobmsg_name(cur));
+               if (!avpk->name)
+                       return -ENOMEM;
+
                avpk->version = strdup(blobmsg_get_string(cur));
+               if (!avpk->version)
+                       return -ENOMEM;
+
                avpk->avl.key = avpk->name;
-               if (!avpk->name || !avpk->version || avl_insert(&pkg_tree, &avpk->avl)) {
-                       fprintf(stderr, "failed to insert package %s (%s)!\n", blobmsg_name(cur), blobmsg_get_string(cur));
+               if (avl_insert(&pkg_tree, &avpk->avl)) {
+
+#ifdef AUC_DEBUG
+                       if (debug)
+                               fprintf(stderr, "failed to insert package %s (%s)!\n", blobmsg_name(cur), blobmsg_get_string(cur));
+#endif
+
                        if (avpk->name)
                                free(avpk->name);
 
@@ -1263,7 +1277,6 @@ static int add_upg_packages(struct blob_attr *reply, char *arch)
                                free(avpk->version);
 
                        free(avpk);
-                       return -ENOMEM;
                }
        }