diff options
-rw-r--r-- | lib/rpmte.c | 6 | ||||
-rw-r--r-- | lib/rpmte_internal.h | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/rpmte.c b/lib/rpmte.c index b09556cd1..ed07ec5cf 100644 --- a/lib/rpmte.c +++ b/lib/rpmte.c @@ -51,6 +51,7 @@ struct rpmte_s { rpm_color_t color; /*!< Color bit(s) from package dependencies. */ rpm_loff_t pkgFileSize; /*!< No. of bytes in package file (approx). */ + rpm_loff_t headerSize; /*!< No. of bytes in package header */ fnpyKey key; /*!< (TR_ADDED) Retrieval key. */ rpmRelocation * relocs; /*!< (TR_ADDED) Payload file relocations. */ @@ -252,6 +253,7 @@ static void addTE(rpmte p, Header h, fnpyKey key, rpmRelocation * relocs) p->fd = NULL; p->pkgFileSize = 0; + p->headerSize = headerSizeof(h, HEADER_MAGIC_NO); p->this = rpmdsThis(h, RPMTAG_PROVIDENAME, RPMSENSE_EQUAL); p->provides = rpmdsNew(h, RPMTAG_PROVIDENAME, 0); @@ -401,6 +403,10 @@ rpm_loff_t rpmtePkgFileSize(rpmte te) return (te != NULL ? te->pkgFileSize : 0); } +rpm_loff_t rpmteHeaderSize(rpmte te) { + return (te != NULL ? te->headerSize : 0); +} + rpmte rpmteParent(rpmte te) { return (te != NULL ? te->parent : NULL); diff --git a/lib/rpmte_internal.h b/lib/rpmte_internal.h index 357eead50..4e43d5a73 100644 --- a/lib/rpmte_internal.h +++ b/lib/rpmte_internal.h @@ -119,5 +119,13 @@ void rpmfsSetAction(rpmfs fs, unsigned int ix, rpmFileAction action); RPM_GNUC_INTERNAL void rpmRelocateFileList(rpmRelocation *relocs, int numRelocations, rpmfs fs, Header h); +/** \ingroup rpmte + * Retrieve size in bytes of package header. + * @param te transaction element + * @return size in bytes of package file. + */ +RPM_GNUC_INTERNAL +rpm_loff_t rpmteHeaderSize(rpmte te); + #endif /* _RPMTE_INTERNAL_H */ |