summaryrefslogtreecommitdiff
path: root/lib/formats.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-11-17 12:37:42 +0200
committerPanu Matilainen <pmatilai@redhat.com>2008-11-17 12:37:42 +0200
commit5580fe23d50b82971c3f0fb12bc613ac64fcdfb0 (patch)
tree4d077357cacef72266e6e740c82e5619f92c0f6a /lib/formats.c
parentf31b790c31d017b9fbe75d1af822c8b438c0cd84 (diff)
downloadrpm-5580fe23d50b82971c3f0fb12bc613ac64fcdfb0.tar.gz
rpm-5580fe23d50b82971c3f0fb12bc613ac64fcdfb0.tar.bz2
rpm-5580fe23d50b82971c3f0fb12bc613ac64fcdfb0.zip
Make triggertypeFormat() work for any numeric type
Diffstat (limited to 'lib/formats.c')
-rw-r--r--lib/formats.c26
1 files changed, 14 insertions, 12 deletions
diff --git a/lib/formats.c b/lib/formats.c
index bceb019c0..7befaa112 100644
--- a/lib/formats.c
+++ b/lib/formats.c
@@ -200,21 +200,23 @@ static char * shescapeFormat(rpmtd td, char * formatPrefix)
*/
static char * triggertypeFormat(rpmtd td, char * formatPrefix)
{
- const uint32_t * item = rpmtdGetUint32(td);
char * val;
- if (rpmtdType(td) != RPM_INT32_TYPE)
+ if (rpmtdClass(td) != RPM_NUMERIC_CLASS) {
val = xstrdup(_("(not a number)"));
- else if (*item & RPMSENSE_TRIGGERPREIN)
- val = xstrdup("prein");
- else if (*item & RPMSENSE_TRIGGERIN)
- val = xstrdup("in");
- else if (*item & RPMSENSE_TRIGGERUN)
- val = xstrdup("un");
- else if (*item & RPMSENSE_TRIGGERPOSTUN)
- val = xstrdup("postun");
- else
- val = xstrdup("");
+ } else {
+ uint64_t item = rpmtdGetNumber(td);
+ if (item & RPMSENSE_TRIGGERPREIN)
+ val = xstrdup("prein");
+ else if (item & RPMSENSE_TRIGGERIN)
+ val = xstrdup("in");
+ else if (item & RPMSENSE_TRIGGERUN)
+ val = xstrdup("un");
+ else if (item & RPMSENSE_TRIGGERPOSTUN)
+ val = xstrdup("postun");
+ else
+ val = xstrdup("");
+ }
return val;
}