diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2008-11-17 16:12:04 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2008-11-17 16:12:04 +0200 |
commit | 4927190cf1d0a2ac902bdf5d7fe5742539c4bb37 (patch) | |
tree | 60890ebea91c3eafed6bf41a3bc535c6dc68ec92 /lib/psm.c | |
parent | 936fc19176c7baec9871bf8fd5aa6a1d56e02d00 (diff) | |
download | rpm-4927190cf1d0a2ac902bdf5d7fe5742539c4bb37.tar.gz rpm-4927190cf1d0a2ac902bdf5d7fe5742539c4bb37.tar.bz2 rpm-4927190cf1d0a2ac902bdf5d7fe5742539c4bb37.zip |
Simplify rpmInstallLoadMacros()
- fi argument unused, remove
- no relevant return value, make it void
- handle any proper data type for per-header macros
Diffstat (limited to 'lib/psm.c')
-rw-r--r-- | lib/psm.c | 17 |
1 files changed, 4 insertions, 13 deletions
@@ -110,11 +110,10 @@ static struct tagMacro { /** * Define per-header macros. - * @param fi transaction element file info * @param h header * @return 0 always */ -static int rpmInstallLoadMacros(rpmfi fi, Header h) +static void rpmInstallLoadMacros(Header h) { const struct tagMacro * tagm; @@ -125,25 +124,16 @@ static int rpmInstallLoadMacros(rpmfi fi, Header h) continue; switch (rpmtdType(&td)) { - case RPM_INT32_TYPE: /* fallthrough */ - case RPM_STRING_TYPE: + default: body = rpmtdFormat(&td, RPMTD_FORMAT_STRING, NULL); addMacro(NULL, tagm->macroname, NULL, body, -1); free(body); break; case RPM_NULL_TYPE: - case RPM_CHAR_TYPE: - case RPM_INT8_TYPE: - case RPM_INT16_TYPE: - case RPM_BIN_TYPE: - case RPM_STRING_ARRAY_TYPE: - case RPM_I18NSTRING_TYPE: - default: break; } rpmtdFreeData(&td); } - return 0; } /** @@ -306,6 +296,8 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd, goto exit; } + rpmInstallLoadMacros(h); + fi = rpmfiNew(ts, h, RPMTAG_BASENAMES, RPMFI_KEEPHEADER); h = headerFree(h); @@ -321,7 +313,6 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd, rpmteSetHeader(fi->te, fi->h); fi->te->fd = fdLink(fd, RPMDBG_M("installSourcePackage")); - (void) rpmInstallLoadMacros(fi, fi->h); if (rpmMkdirs(rpmtsRootDir(ts), "%{_topdir}:%{_sourcedir}:%{_specdir}")) { goto exit; |