/*
* repo_helix.c
- *
+ *
* Parse 'helix' XML representation
* and create 'repo'
- *
+ *
* A bit of history: "Helix Code" was the name of the company that
* wrote Red Carpet. The company was later renamed to Ximian.
* The Red Carpet solver was merged into the ZYPP project, the
* library used both by ZENworks and YaST for package management.
- * Red Carpet came with solver testcases in it's own repository
+ * Red Carpet came with solver testcases in its own repository
* format, the 'helix' format.
*
*/
{ STATE_SUBCHANNEL, "atom", STATE_PACKAGE, 0 },
{ STATE_SUBCHANNEL, "patch", STATE_PACKAGE, 0 },
{ STATE_SUBCHANNEL, "product", STATE_PACKAGE, 0 },
+ { STATE_SUBCHANNEL, "application", STATE_PACKAGE, 0 },
{ STATE_PACKAGE, "name", STATE_NAME, 1 },
{ STATE_PACKAGE, "vendor", STATE_VENDOR, 1 },
{ STATE_PACKAGE, "buildtime", STATE_BUILDTIME, 1 },
int l;
/* treat explitcit 0 as NULL */
- if (e && !strcmp(e, "0"))
- e = NULL;
+ if (e && (!*e || !strcmp(e, "0")))
+ e = 0;
if (v && !e)
{
if (v2 > v && *v2 == ':')
e = "0";
}
-
+
/* compute length of Id string */
l = 1; /* for the \0 */
if (e)
/*
* XML callback
* <name>
- *
+ *
*/
static void XMLCALL
#endif
return;
}
-
+
/* set new state */
pd->state = sw->to;
pd->kind = "product";
else if (!strcmp(name, "patch"))
pd->kind = "patch";
+ else if (!strcmp(name, "application"))
+ pd->kind = "application";
else
pd->kind = NULL; /* default is package */
pd->levrspace = 1;
{
Pool *pool = pd->pool;
Id pid, *pidp;
-
+
if (s->provides)
{
pidp = pd->repo->idarraydata + s->provides;
{
Reldep *prd;
const char *depname;
-
+
if (!ISRELDEP(pid))
continue; /* wrong provides name */
prd = GETRELDEP(pool, pid);
if (!ISRELDEP(pid))
{
depname = pool_id2str(pool, pid);
- }
- else
+ }
+ else
{
Reldep *prd = GETRELDEP(pool, pid);
depname = pool_id2str(pool, prd->name);
/*
* XML callback
* </name>
- *
+ *
* create Solvable from collected data
*/
s->evr = evr2id(pool, pd,
pd->epoch ? pd->evrspace + pd->epoch : 0,
pd->version ? pd->evrspace + pd->version : 0,
- pd->release ? pd->evrspace + pd->release : 0);
+ pd->release ? pd->evrspace + pd->release : "");
/* ensure self-provides */
if (s->name && s->arch != ARCH_SRC && s->arch != ARCH_NOSRC)
s->provides = repo_addid_dep(pd->repo, s->provides, pool_rel2id(pool, s->name, s->evr, REL_EQ, 1), 0);
/* see bugzilla bnc#190163 */
flavor = findKernelFlavor(pd, s);
- if (flavor)
+ if (flavor)
{
char *cflavor = solv_strdup(flavor); /* make pointer safe */
/*
* XML callback
* character data
- *
+ *
*/
static void XMLCALL
/*
* read 'helix' type xml from fp
* add packages to pool/repo
- *
+ *
*/
int
now = solv_timems(0);
data = repo_add_repodata(repo, flags);
-
+
/* prepare parsedata */
memset(&pd, 0, sizeof(pd));
for (i = 0, sw = stateswitches; sw->from != NUMSTATES; i++, sw++)