From 826969f2c7307e7292f192fd10625d863d656723 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Mon, 8 Dec 2008 19:50:07 +0200 Subject: [PATCH] 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 :-/ --- lib/rpmlead.c | 5 +++++ lib/rpmlead.h | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/lib/rpmlead.c b/lib/rpmlead.c index e20dd32..7c21e26 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 11a21eb..768ea28 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 -- 2.7.4