summaryrefslogtreecommitdiff
path: root/lib/rpmps.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-03-26 09:20:05 +0200
committerPanu Matilainen <pmatilai@redhat.com>2010-03-26 09:20:05 +0200
commitd9d59c89301de242a008a55d3ee93b0c710937eb (patch)
treedcb5290e066685c6ac6d775351f94eb547b9f74d /lib/rpmps.c
parent96e07f34e48b33f0d1f4c9be9ed33fdddf0bd0cd (diff)
downloadrpm-d9d59c89301de242a008a55d3ee93b0c710937eb.tar.gz
Add a simple and dumb rpmpsMerge() function to merge two problem sets
Diffstat (limited to 'lib/rpmps.c')
-rw-r--r--lib/rpmps.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/rpmps.c b/lib/rpmps.c
index 980add88f..6089e3898 100644
--- a/lib/rpmps.c
+++ b/lib/rpmps.c
@@ -189,6 +189,22 @@ int rpmpsTrim(rpmps ps, rpmps filter)
return gotProblems;
}
+/*
+ * TODO: filter out duplicates while merging. Also horribly inefficient... */
+int rpmpsMerge(rpmps dest, rpmps src)
+{
+ int rc = 0;
+ if (dest != NULL) {
+ rpmProblem p;
+ rpmpsi spi = rpmpsInitIterator(src);
+ while ((p = rpmpsiNext(spi)) != NULL) {
+ rpmpsAppendProblem(dest, p);
+ rc++;
+ }
+ }
+ return rc;
+}
+
void rpmpsPrint(FILE *fp, rpmps ps)
{
char * msg = NULL;