diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-12-08 19:50:07 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-12-08 19:56:13 +0200 |
commit | 494dda015e01ef136cd3ce1fa21f369e3288a4af (patch) | |
tree | 37648386fe3ef4c8f29c1ae3b4123182760a0485 | |
parent | 2f9d0e8c5d86b1dc78651d405af66d08b03855b2 (diff) | |
download | rpm-494dda015e01ef136cd3ce1fa21f369e3288a4af.tar.gz rpm-494dda015e01ef136cd3ce1fa21f369e3288a4af.tar.bz2 rpm-494dda015e01ef136cd3ce1fa21f369e3288a4af.zip |
Add function to retrieve type from rpmlead
- for some messed up packages there's no other reliable way to determine
source vs binary than looking at the lead :-/
(cherry picked from commit 826969f2c7307e7292f192fd10625d863d656723)
-rw-r--r-- | lib/rpmlead.c | 5 | ||||
-rw-r--r-- | lib/rpmlead.h | 7 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/rpmlead.c b/lib/rpmlead.c index e20dd32f0..7c21e26b5 100644 --- a/lib/rpmlead.c +++ b/lib/rpmlead.c @@ -133,3 +133,8 @@ rpmRC rpmLeadRead(FD_t fd, rpmlead lead) return RPMRC_OK; } + +int rpmLeadType(rpmlead lead) +{ + return lead ? lead->type : -1; +} diff --git a/lib/rpmlead.h b/lib/rpmlead.h index 11a21eb6e..768ea28f4 100644 --- a/lib/rpmlead.h +++ b/lib/rpmlead.h @@ -68,6 +68,13 @@ rpmRC rpmLeadRead(FD_t fd, rpmlead lead); */ rpmRC rpmLeadCheck(rpmlead lead, const char **msg); +/** \ingroup lead + * Returen type (source vs binary) of lead + * @param lead Pointer to lead handle + * @return RPMLEAD_BINARY or RPMLEAD_SOURCE, -1 on invalid + */ +int rpmLeadType(rpmlead lead); + #ifdef __cplusplus } #endif |