Skip to content

Commit fdf5d0d

Browse files
committed
Add collections to updateinfo xml parser
1 parent 2c33cda commit fdf5d0d

2 files changed

Lines changed: 16 additions & 0 deletions

File tree

ext/repo_updateinfoxml.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ struct parsedata {
113113
Id pkghandle;
114114
struct solv_xmlparser xmlp;
115115
struct joindata jd;
116+
Id collhandle;
116117
};
117118

118119
/*
@@ -287,6 +288,12 @@ startElement(struct solv_xmlparser *xmlp, int state, const char *name, const cha
287288
}
288289
break;
289290

291+
case STATE_COLLECTION:
292+
{
293+
pd->collhandle = repodata_new_handle(pd->data);
294+
}
295+
break;
296+
290297
/* <package arch="ppc64" name="imlib-debuginfo" release="6.fc8"
291298
* src="http://download.fedoraproject.org/pub/fedora/linux/updates/8/ppc64/imlib-debuginfo-1.9.15-6.fc8.ppc64.rpm"
292299
* version="1.9.15">
@@ -364,6 +371,7 @@ startElement(struct solv_xmlparser *xmlp, int state, const char *name, const cha
364371
if (arch)
365372
repodata_set_poolstr(pd->data, module_handle, UPDATE_MODULE_ARCH, arch);
366373
repodata_add_flexarray(pd->data, pd->handle, UPDATE_MODULE, module_handle);
374+
repodata_add_flexarray(pd->data, pd->collhandle, UPDATE_MODULE, module_handle);
367375
break;
368376
}
369377

@@ -427,8 +435,14 @@ endElement(struct solv_xmlparser *xmlp, int state, char *content)
427435
repodata_set_str(pd->data, pd->handle, UPDATE_MESSAGE, content);
428436
break;
429437

438+
case STATE_COLLECTION:
439+
repodata_add_flexarray(pd->data, pd->handle, UPDATE_COLLECTIONLIST, pd->collhandle);
440+
pd->collhandle = 0;
441+
break;
442+
430443
case STATE_PACKAGE:
431444
repodata_add_flexarray(pd->data, pd->handle, UPDATE_COLLECTION, pd->pkghandle);
445+
repodata_add_flexarray(pd->data, pd->collhandle, UPDATE_COLLECTION, pd->pkghandle);
432446
pd->pkghandle = 0;
433447
break;
434448

src/knownid.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ KNOWNID(LIBSOLV_SELF_DESTRUCT_PKG, "libsolv-self-destruct-pkg()"), /* this
268268
KNOWNID(SOLVABLE_CONSTRAINS, "solvable:constrains"), /* conda */
269269
KNOWNID(SOLVABLE_TRACK_FEATURES, "solvable:track_features"), /* conda */
270270

271+
KNOWNID(UPDATE_COLLECTIONLIST, "update:collectionlist"), /* list of UPDATE_COLLECTION (actually packages) and UPDATE_MODULE */
272+
271273
KNOWNID(ID_NUM_INTERNAL, 0)
272274

273275
#ifdef KNOWNID_INITIALIZE

0 commit comments

Comments
 (0)