Add function to retrieve type from rpmlead
authorPanu Matilainen <pmatilai@redhat.com>
Mon, 8 Dec 2008 17:50:07 +0000 (19:50 +0200)
committerPanu Matilainen <pmatilai@redhat.com>
Mon, 8 Dec 2008 17:56:13 +0000 (19:56 +0200)
- 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)

lib/rpmlead.c
lib/rpmlead.h

index e20dd32..7c21e26 100644 (file)
@@ -133,3 +133,8 @@ rpmRC rpmLeadRead(FD_t fd, rpmlead lead)
 
     return RPMRC_OK;
 }
+
+int rpmLeadType(rpmlead lead)
+{
+    return lead ? lead->type : -1;
+}
index 11a21eb..768ea28 100644 (file)
@@ -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