- add repo_add_poolstr_array
- move updates="key,key.." to repomd.xml
+- make product url ids more extensible
- 0.10.11
-------------------------------------------------------------------
KNOWNID(PRODUCT_URL_TYPE_RELNOTES, "product:url:type:relnotes"),
KNOWNID(PRODUCT_URL_TYPE_EXTRA, "product:url:type:extra"),
KNOWNID(PRODUCT_URL_TYPE_OPTIONAL, "product:url:type:optional"),
+KNOWNID(PRODUCT_URL_TYPE_UPDATE, "product:url:type:update"),
KNOWNID(PRODUCT_FLAGS, "product:flags"),
KNOWNID(PRODUCT_FLAVOR, "product:flavor"),
KNOWNID(PRODUCT_REFERENCES, "product:references"),
}
}
+/*
+ * split value and add to pool
+ */
+
+static void
+add_multiple_urls(Repodata *data, Id handle, char *value, Id type)
+{
+ char *sp[2];
+ while (value)
+ {
+ int words = split(value, sp, 2);
+ if (!words)
+ break;
+ repodata_add_poolstr_array(data, handle, PRODUCT_URL, sp[0]);
+ repodata_add_idarray(data, handle, PRODUCT_URL_TYPE, type);
+ if (words == 1)
+ break;
+ value = sp[1];
+ }
+}
+
+
/*
* add 'content' to repo
else if (istag ("DATADIR"))
repo_set_str(repo, s - pool->solvables, SUSETAGS_DATADIR, value);
else if (istag ("UPDATEURLS"))
- add_multiple_strings(data, handle, PRODUCT_UPDATEURLS, value);
+ add_multiple_urls(data, handle, value, PRODUCT_URL_TYPE_UPDATE);
else if (istag ("EXTRAURLS"))
- add_multiple_strings(data, handle, PRODUCT_EXTRAURLS, value);
+ add_multiple_urls(data, handle, value, PRODUCT_URL_TYPE_EXTRA);
else if (istag ("OPTIONALURLS"))
- add_multiple_strings(data, handle, PRODUCT_OPTIONALURLS, value);
+ add_multiple_urls(data, handle, value, PRODUCT_URL_TYPE_OPTIONAL);
+ else if (istag ("RELNOTESURL"))
+ add_multiple_urls(data, handle, value, PRODUCT_URL_TYPE_RELNOTES);
else if (istag ("SHORTLABEL"))
repo_set_str(repo, s - pool->solvables, PRODUCT_SHORTLABEL, value);
else if (istag ("LABEL")) /* LABEL is the products SUMMARY. */
repo_set_str(repo, s - pool->solvables, pool_id2langid(pool, SOLVABLE_SUMMARY, key + 6, 1), value);
else if (istag ("FLAGS"))
add_multiple_strings(data, handle, PRODUCT_FLAGS, value);
- else if (istag ("RELNOTESURL"))
- repodata_add_poolstr_array(data, handle, PRODUCT_RELNOTESURL, value);
else if (istag ("VENDOR"))
s->vendor = str2id(pool, value, 1);
else if (istag ("BASEARCHS"))
#endif
{ STATE_PRODUCT, "linguas", STATE_LINGUAS, 0 },
{ STATE_PRODUCT, "updaterepokey", STATE_UPDATEREPOKEY, 1 },
- { STATE_URLS, "url", STATE_URL, 0 },
+ { STATE_URLS, "url", STATE_URL, 1 },
/* { STATE_BUILDCONFIG,"linguas", STATE_LINGUAS, 0 }, */
{ STATE_LINGUAS, "lang", STATE_LANG, 0 },
{ STATE_REGISTER, "flavor", STATE_FLAVOR, 1 },
case STATE_URL:
if (pd->tmpurltype)
{
+ Id type = 0;
repodata_add_poolstr_array(pd->data, pd->handle, PRODUCT_URL, pd->content);
- repodata_add_poolstr_array(pd->data, pd->handle, PRODUCT_URL_TYPE, pd->content);
+
+ if ( pd->tmpurltype[0] == 's' )
+ type = PRODUCT_URL_TYPE_SMOLT;
+ else if ( pd->tmpurltype[0] == 'u' )
+ type = PRODUCT_URL_TYPE_UPDATE;
+ else if ( pd->tmpurltype[0] == 'o' )
+ type = PRODUCT_URL_TYPE_OPTIONAL;
+ else if ( pd->tmpurltype[0] == 'r' )
+ type = PRODUCT_URL_TYPE_RELNOTES;
+ else
+ type = PRODUCT_URL_TYPE_EXTRA;
+
+ repodata_add_idarray(pd->data, pd->handle, PRODUCT_URL_TYPE, type);
}
break;
case STATE_TARGET:
break;
case STATE_RELNOTESURL:
if (pd->content[0])
- repodata_set_poolstr(pd->data, handle, PRODUCT_RELNOTESURL, pd->content);
+ {
+ repodata_add_poolstr_array(pd->data, pd->handle, PRODUCT_URL, pd->content);
+ repodata_add_idarray(pd->data, pd->handle, PRODUCT_URL_TYPE, PRODUCT_URL_TYPE_RELNOTES);
+ }
break;
case STATE_UPDATEURL:
if (pd->content[0])
- repodata_set_poolstr(pd->data, handle, PRODUCT_EXTRAURLS, pd->content);
+ {
+ repodata_add_poolstr_array(pd->data, pd->handle, PRODUCT_URL, pd->content);
+ repodata_add_idarray(pd->data, pd->handle, PRODUCT_URL_TYPE, PRODUCT_URL_TYPE_UPDATE);
+ }
break;
case STATE_OPTIONALURL:
if (pd->content[0])
- repodata_set_poolstr(pd->data, handle, PRODUCT_OPTIONALURLS, pd->content);
+ {
+ repodata_add_poolstr_array(pd->data, pd->handle, PRODUCT_URL, pd->content);
+ repodata_add_idarray(pd->data, pd->handle, PRODUCT_URL_TYPE, PRODUCT_URL_TYPE_OPTIONAL);
+ }
break;
case STATE_FLAG:
if (pd->content[0])