Add a couple of architectures.
[platform/upstream/libsolv.git] / ext / repo_appdata.c
index 986492b..2d3fc37 100644 (file)
@@ -62,7 +62,9 @@ struct stateswitch {
 /* !! must be sorted by first column !! */
 static struct stateswitch stateswitches[] = {
   { STATE_START,       "applications",  STATE_START,         0 },
+  { STATE_START,       "components",    STATE_START,         0 },
   { STATE_START,       "application",   STATE_APPLICATION,   0 },
+  { STATE_START,       "component",     STATE_APPLICATION,   0 },
   { STATE_APPLICATION, "id",            STATE_ID,            1 },
   { STATE_APPLICATION, "pkgname",       STATE_PKGNAME,       1 },
   { STATE_APPLICATION, "product_license", STATE_LICENCE,     1 },
@@ -511,7 +513,12 @@ repo_add_appdata(Repo *repo, FILE *fp, int flags)
       l = fread(buf, 1, sizeof(buf), fp);
       if (XML_Parse(parser, buf, l, l == 0) == XML_STATUS_ERROR)
        {
-          pool_error(pool, -1, "repo_appdata: %s at line %u:%u\n", XML_ErrorString(XML_GetErrorCode(parser)), (unsigned int)XML_GetCurrentLineNumber(parser), (unsigned int)XML_GetCurrentColumnNumber(parser));
+         pool_error(pool, -1, "repo_appdata: %s at line %u:%u\n", XML_ErrorString(XML_GetErrorCode(parser)), (unsigned int)XML_GetCurrentLineNumber(parser), (unsigned int)XML_GetCurrentColumnNumber(parser));
+         if (pd.solvable)
+           {
+             repo_free_solvable(repo, pd.solvable - pd.pool->solvables, 1);
+             pd.solvable = 0;
+           }
          ret = -1;
          break;
        }