return 0;
}
+static inline Id
+toevr(Pool *pool, struct parsedata *pd, const char *version, const char *release)
+{
+ return makeevr(pool, !release || (release[0] == '-' && !release[1]) ?
+ version : join2(&pd->jd, version, "-", release));
+}
+
+
/*
* parse susetags
*
data = repo_add_repodata(repo, flags);
memset(&pd, 0, sizeof(pd));
- line = malloc(1024);
+ line = solv_malloc(1024);
aline = 1024;
pd.pool = pool;
if (linep - line + 16 > aline) /* (re-)alloc buffer */
{
aline = linep - line;
- line = realloc(line, aline + 512);
+ line = solv_realloc(line, aline + 512);
linep = line + aline;
aline += 512;
}
if (split(line + 5, sp, 5) != 5)
continue;
repodata_set_id(data, handle, DELTA_SEQ_NAME, pool_str2id(pool, sp[0], 1));
- evr = makeevr(pool, join2(&pd.jd, sp[1], "-", sp[2]));
+ evr = toevr(pool, &pd, sp[1], sp[2]);
repodata_set_id(data, handle, DELTA_SEQ_EVR, evr);
/* repodata_set_id(data, handle, DELTA_SEQ_ARCH, pool_str2id(pool, sp[3], 1)); */
repodata_set_str(data, handle, DELTA_SEQ_NUM, sp[4]);
}
handle = repodata_new_handle(data);
repodata_set_id(data, handle, DELTA_PACKAGE_NAME, pool_str2id(pool, sp[0], 1));
- repodata_set_id(data, handle, DELTA_PACKAGE_EVR, makeevr(pool, join2(&pd.jd, sp[1], "-", sp[2])));
+ repodata_set_id(data, handle, DELTA_PACKAGE_EVR, toevr(pool, &pd, sp[1], sp[2]));
repodata_set_id(data, handle, DELTA_PACKAGE_ARCH, pool_str2id(pool, sp[3], 1));
repodata_add_flexarray(data, SOLVID_META, REPOSITORY_DELTAINFO, handle);
indelta = 1;
name = pool_str2id(pool, join2(&pd.jd, pd.kind, ":", sp[0]), 0);
else
name = pool_str2id(pool, sp[0], 0);
- evr = makeevr(pool, join2(&pd.jd, sp[1], "-", sp[2]));
+ evr = toevr(pool, &pd, sp[1], sp[2]);
arch = pool_str2id(pool, sp[3], 0);
if (name && arch)
{
s->name = pool_str2id(pool, join2(&pd.jd, pd.kind, ":", sp[0]), 1);
else
s->name = pool_str2id(pool, sp[0], 1);
- s->evr = makeevr(pool, join2(&pd.jd, sp[1], "-", sp[2]));
+ s->evr = toevr(pool, &pd, sp[1], sp[2]);
s->arch = pool_str2id(pool, sp[3], 1);
s->vendor = defvendor;
createdpkgs = 1;
exit(1);
}
name = pool_str2id(pool, sp[0], 1);
- evr = makeevr(pool, join2(&pd.jd, sp[1], "-", sp[2]));
+ evr = toevr(pool, &pd, sp[1], sp[2]);
arch = pool_str2id(pool, sp[3], 1);
if (last_found_pack >= pd.nshare)
{
repodata_internalize(data);
solv_free(pd.language);
- free(line);
+ solv_free(line);
join_freemem(&pd.jd);
return 0;
}