summaryrefslogtreecommitdiff
path: root/lib/psm.c
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2008-11-17 16:12:04 +0200
committerPanu Matilainen <pmatilai@redhat.com>2008-11-17 16:12:04 +0200
commit4927190cf1d0a2ac902bdf5d7fe5742539c4bb37 (patch)
tree60890ebea91c3eafed6bf41a3bc535c6dc68ec92 /lib/psm.c
parent936fc19176c7baec9871bf8fd5aa6a1d56e02d00 (diff)
downloadrpm-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.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/lib/psm.c b/lib/psm.c
index c5a0c91f7..6b69d0e37 100644
--- a/lib/psm.c
+++ b/lib/psm.c
@@ -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;