#include <assert.h>
#include <dirent.h>
#include <expat.h>
+#include <errno.h>
#include "pool.h"
#include "repo.h"
/* parse 'type' */
const char *type = find_attr("type", atts);
s = pd->solvable = pool_id2solvable(pool, repo_add_solvable(pd->repo));
- repodata_extend(pd->data, s - pool->solvables);
pd->handle = s - pool->solvables;
if (type)
repodata_set_str(pd->data, pd->handle, PRODUCT_TYPE, type);
if (XML_Parse(parser, buf, l, l == 0) == XML_STATUS_ERROR)
{
pool_debug(pd->pool, SOLV_ERROR, "repo_zyppdb: %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(pd->repo, pd->solvable - pd->pool->solvables, 1);
+ pd->solvable = 0;
+ }
return;
}
if (l == 0)
DIR *dir;
FILE *fp;
Repodata *data;
-
+
data = repo_add_repodata(repo, flags);
memset(&pd, 0, sizeof(pd));
pd.repo = repo;
fullpath = join2(&pd.jd, dirpath, "/", entry->d_name);
if ((fp = fopen(fullpath, "r")) == 0)
{
- perror(fullpath);
+ pool_error(repo->pool, 0, "%s: %s", fullpath, strerror(errno));
continue;
}
add_zyppdb_product(&pd, fp);