summaryrefslogtreecommitdiff
path: root/lib/rpmte.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2010-03-12 11:44:47 +0200
committerPanu Matilainen <pmatilai@redhat.com>2010-03-12 11:44:47 +0200
commit42d9a584f4710e1d62cc06996c1e296db307cacb (patch)
tree9b17111f40de482850223c52e5357f6d0a4b757a /lib/rpmte.c
parentffd5d96817b2ade7da3d26173f7dd447358965a3 (diff)
downloadlibrpm-tizen-42d9a584f4710e1d62cc06996c1e296db307cacb.tar.gz
librpm-tizen-42d9a584f4710e1d62cc06996c1e296db307cacb.tar.bz2
librpm-tizen-42d9a584f4710e1d62cc06996c1e296db307cacb.zip
Move rpmte-specific problem creation to a helper function
Diffstat (limited to 'lib/rpmte.c')
-rw-r--r--lib/rpmte.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/rpmte.c b/lib/rpmte.c
index 9764c7c1e..2fcb5b122 100644
--- a/lib/rpmte.c
+++ b/lib/rpmte.c
@@ -197,12 +197,8 @@ static void buildRelocs(rpmte p, Header h, rpmRelocation *relocs)
}
if (!valid) {
- if (p->probs == NULL) {
- p->probs = rpmpsCreate();
- }
- rpmpsAppend(p->probs, RPMPROB_BADRELOCATE,
- rpmteNEVRA(p), rpmteKey(p),
- p->relocs[i].oldPath, NULL, NULL, 0);
+ rpmteAddProblem(p, RPMPROB_BADRELOCATE,
+ p->relocs[i].oldPath, NULL, NULL, 0);
}
} else {
p->relocs[i].newPath = NULL;
@@ -722,6 +718,18 @@ rpmps rpmteProblems(rpmte te)
return te ? te->probs : NULL;
}
+void rpmteAddProblem(rpmte te, rpmProblemType type,
+ const char *dn, const char *bn,
+ const char *altNEVR, uint64_t number)
+{
+ if (te != NULL) {
+ if (te->probs == NULL)
+ te->probs = rpmpsCreate();
+ rpmpsAppend(te->probs, type, rpmteNEVRA(te), rpmteKey(te),
+ dn, bn, altNEVR, number);
+ }
+}
+
const char * rpmteTypeString(rpmte te)
{
switch(rpmteType(te)) {