STATE_LANG, // 14
STATE_REGISTER, // 15
STATE_TARGET, // 16
- STATE_FLAVOR, // 17
STATE_REGRELEASE, // 18
+ STATE_PRODUCTLINE, // 19
NUMSTATES // 0
};
{ STATE_PRODUCT, "version", STATE_VERSION, 1 },
{ STATE_PRODUCT, "release", STATE_RELEASE, 1 },
{ STATE_PRODUCT, "arch", STATE_ARCH, 1 },
+ { STATE_PRODUCT, "productline", STATE_PRODUCTLINE, 1 },
{ STATE_PRODUCT, "summary", STATE_SUMMARY, 1 },
{ STATE_PRODUCT, "description", STATE_DESCRIPTION, 1 },
{ STATE_PRODUCT, "register", STATE_REGISTER, 0 },
{ STATE_PRODUCT, "runtimeconfig", STATE_RUNTIMECONFIG, 0 },
{ STATE_PRODUCT, "linguas", STATE_LINGUAS, 0 },
{ STATE_PRODUCT, "updaterepokey", STATE_UPDATEREPOKEY, 1 },
- { STATE_PRODUCT, "cpename", STATE_CPEID, 1 },
+ { STATE_PRODUCT, "cpename", STATE_CPEID, 1 },
{ STATE_URLS, "url", STATE_URL, 1 },
{ STATE_LINGUAS, "lang", STATE_LANG, 0 },
- { STATE_REGISTER, "flavor", STATE_FLAVOR, 1 },
{ STATE_REGISTER, "target", STATE_TARGET, 1 },
{ STATE_REGISTER, "release", STATE_REGRELEASE, 1 },
{ NUMSTATES }
case STATE_ARCH:
s->arch = str2id(pd->pool, pd->content, 1);
break;
+ case STATE_PRODUCTLINE:
+ repodata_set_str(pd->data, pd->handle, PRODUCT_PRODUCTLINE, pd->content);
+ break;
case STATE_UPDATEREPOKEY:
repodata_set_str(pd->data, pd->handle, langtag(pd, PRODUCT_UPDATEREPOKEY, pd->tmplang), pd->content);
break;
printf("%s\n", pd->content);
}
break;
- case STATE_FLAVOR:
- repodata_set_str(pd->data, pd->handle, PRODUCT_FLAVOR, pd->content);
- if (pd->currentproduct == pd->baseproduct
- && pd->attribute
- && !strcmp(pd->attribute, "register.flavor"))
- {
- printf("%s\n", pd->content);
- }
- break;
case STATE_REGRELEASE:
repodata_set_str(pd->data, pd->handle, PRODUCT_REGISTER_RELEASE, pd->content);
if (pd->currentproduct == pd->baseproduct
XML_SetUserData(parser, pd);
XML_SetElementHandler(parser, startElement, endElement);
XML_SetCharacterDataHandler(parser, characterData);
-
+
for (;;)
{
l = fread(buf, 1, sizeof(buf), fp);
*(buf + l) = 0;
}
++lnum;
-
+
if (lnum == 1)
{
/* 1st line, <name> [(<arch>)] */
}
else
ptr1 = buf + l - 1;
-
+
/* track back until non-blank, non-digit */
while (ptr1 > buf
&& (*ptr1 == ' ' || isdigit(*ptr1) || *ptr1 == '.'))
}
}
}
- else if (strncmp(buf, "VERSION", 7) == 0)
+ else if (strncmp(buf, "VERSION", 7) == 0)
{
ptr = strchr(buf+7, '=');
if (ptr)
}
}
}
-
+
sat_free((void *)pd.tmplang);
free(pd.content);
join_freemem();
-
+
}
/* EOF */
STATE_DOWNLOADSIZE,
STATE_INSTALLTIME,
STATE_INSTALLONLY,
-
+
/* Novell/SUSE extended attributes */
STATE_EULA,
STATE_KEYWORD,
STATE_UPDATEURL,
STATE_OPTIONALURL,
STATE_FLAG,
- STATE_FLAVOR,
- STATE_REFERENCES,
/* rpm-md dependencies inside the
format tag */
{ STATE_START, "pattern", STATE_SOLVABLE, 0 },
{ STATE_START, "patch", STATE_SOLVABLE, 0 },
{ STATE_START, "package", STATE_SOLVABLE, 0 },
-
+
{ STATE_SOLVABLE, "name", STATE_NAME, 1 },
{ STATE_SOLVABLE, "arch", STATE_ARCH, 1 },
{ STATE_SOLVABLE, "version", STATE_VERSION, 0 },
// package attributes rpm-md
{ STATE_SOLVABLE, "location", STATE_LOCATION, 0 },
{ STATE_SOLVABLE, "checksum", STATE_CHECKSUM, 1 },
-
+
/* resobject attributes */
{ STATE_SOLVABLE, "summary", STATE_SUMMARY, 1 },
{ STATE_SOLVABLE, "update-url", STATE_UPDATEURL, 1 },
{ STATE_SOLVABLE, "optional-url", STATE_OPTIONALURL, 1 },
{ STATE_SOLVABLE, "flag", STATE_FLAG, 1 },
- { STATE_SOLVABLE, "flavor", STATE_FLAVOR, 1 },
- { STATE_SOLVABLE, "references", STATE_REFERENCES, 1 },
{ STATE_SOLVABLE, "rpm:vendor", STATE_VENDOR, 1 },
{ STATE_SOLVABLE, "rpm:group", STATE_RPM_GROUP, 1 },
{ STATE_SOLVABLE, "rpm:license", STATE_RPM_LICENSE, 1 },
- /* rpm-md dependencies */
+ /* rpm-md dependencies */
{ STATE_SOLVABLE, "rpm:provides", STATE_PROVIDES, 0 },
{ STATE_SOLVABLE, "rpm:requires", STATE_REQUIRES, 0 },
{ STATE_SOLVABLE, "rpm:obsoletes", STATE_OBSOLETES, 0 },
{ STATE_SOLVABLE, "rpm:sourcerpm", STATE_SOURCERPM, 1 },
{ STATE_SOLVABLE, "rpm:header-range", STATE_HEADERRANGE, 0 },
{ STATE_SOLVABLE, "file", STATE_FILE, 1 },
-
+
/* extended Novell/SUSE diskusage attributes (susedata.xml) */
{ STATE_DISKUSAGE, "dirs", STATE_DIRS, 0 },
{ STATE_DIRS, "dir", STATE_DIR, 0 },
{ STATE_SUGGESTS, "rpm:entry", STATE_SUGGESTSENTRY, 0 },
{ STATE_ENHANCES, "rpm:entry", STATE_ENHANCESENTRY, 0 },
{ STATE_FRESHENS, "rpm:entry", STATE_FRESHENSENTRY, 0 },
-
+
{ NUMSTATES}
};
/*
* makeevr_atts
* parse 'epoch', 'ver' and 'rel', return evr Id
- *
+ *
*/
static Id
* I: txt, name of attribute
* I: atts, list of key/value attributes
* O: pointer to value of matching key, or NULL
- *
+ *
*/
static inline const char *
/*
* adddep
* parse attributes to reldep Id
- *
+ *
*/
static unsigned int
pd->content = sat_realloc(pd->content, l + 256);
pd->acontent = l + 256;
}
- sprintf(pd->content, "%s:%s", k, n);
- name = str2id(pool, pd->content, 1);
+ sprintf(pd->content, "%s:%s", k, n);
+ name = str2id(pool, pd->content, 1);
}
else
name = str2id(pool, (char *)n, 1);
if (!str || !*str)
return;
for (aut = str; (aut = strchr(aut, '\n')) != 0; aut++)
- if (!strncmp(aut, "\nAuthors:\n--------\n", 19))
+ if (!strncmp(aut, "\nAuthors:\n--------\n", 19))
break;
if (aut)
{
/* oh my, found SUSE special author section */
- int l = aut - str;
- str[l] = 0;
+ int l = aut - str;
+ str[l] = 0;
while (l > 0 && str[l - 1] == '\n')
- str[--l] = 0;
+ str[--l] = 0;
if (l)
repodata_set_str(data, handle, SOLVABLE_DESCRIPTION, str);
p = aut + 19;
aut = str; /* copy over */
while (*p == ' ' || *p == '\n')
p++;
- while (*p)
+ while (*p)
{
if (*p == '\n')
{
*aut++ = *p++;
- while (*p == ' ')
+ while (*p == ' ')
p++;
continue;
}
}
while (aut != str && aut[-1] == '\n')
aut--;
- *aut = 0;
+ *aut = 0;
if (*str)
repodata_set_str(data, handle, SOLVABLE_AUTHORS, str);
}
/*
* set_sourcerpm
- *
+ *
*/
static void
/*
* startElement
* XML callback
- *
+ *
*/
static void XMLCALL
pd->kind = "product";
else if (name[2] == 't' && name[3] == 'c')
pd->kind = "patch";
-
+
/* to support extension metadata files like others.xml which
have the following structure:
/* Really, do nothing, wat for <dir> tag */
break;
}
- case STATE_DIR:
+ case STATE_DIR:
{
long filesz = 0, filenum = 0;
unsigned dirid;
dirid = repodata_str2dir(pd->data, str, 1);
}
else
- {
+ {
fprintf( stderr, "<dir .../> tag without 'name' attribute, atts = %p, *atts = %p\n", atts, *atts);
break;
}
/*
* endElement
* XML callback
- *
+ *
*/
static void XMLCALL
if (pd->content[0])
repodata_set_poolstr(pd->data, handle, PRODUCT_FLAGS, pd->content);
break;
- case STATE_FLAVOR:
- if (pd->content[0])
- repodata_set_str(pd->data, handle, PRODUCT_FLAVOR, pd->content);
- break;
- case STATE_REFERENCES:
- if (pd->content[0])
- repodata_set_str(pd->data, handle, PRODUCT_REFERENCES, pd->content);
- break;
case STATE_EULA:
if (pd->content[0])
repodata_set_str(pd->data, handle, langtag(pd, SOLVABLE_EULA, pd->language), pd->content);
case STATE_DISKUSAGE:
if (pd->ndirs)
commit_diskusage (pd, pd->handle);
- break;
+ break;
default:
break;
}
/*
* characterData
* XML callback
- *
+ *
*/
static void XMLCALL
/*
* repo_add_rpmmd
* parse rpm-md metadata (primary, others)
- *
+ *
*/
void