Simplify rpmInstallLoadMacros()
- fi argument unused, remove - no relevant return value, make it void - handle any proper data type for per-header macros
This commit is contained in:
parent
936fc19176
commit
4927190cf1
17
lib/psm.c
17
lib/psm.c
|
@ -110,11 +110,10 @@ static struct tagMacro {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Define per-header macros.
|
* Define per-header macros.
|
||||||
* @param fi transaction element file info
|
|
||||||
* @param h header
|
* @param h header
|
||||||
* @return 0 always
|
* @return 0 always
|
||||||
*/
|
*/
|
||||||
static int rpmInstallLoadMacros(rpmfi fi, Header h)
|
static void rpmInstallLoadMacros(Header h)
|
||||||
{
|
{
|
||||||
const struct tagMacro * tagm;
|
const struct tagMacro * tagm;
|
||||||
|
|
||||||
|
@ -125,25 +124,16 @@ static int rpmInstallLoadMacros(rpmfi fi, Header h)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
switch (rpmtdType(&td)) {
|
switch (rpmtdType(&td)) {
|
||||||
case RPM_INT32_TYPE: /* fallthrough */
|
default:
|
||||||
case RPM_STRING_TYPE:
|
|
||||||
body = rpmtdFormat(&td, RPMTD_FORMAT_STRING, NULL);
|
body = rpmtdFormat(&td, RPMTD_FORMAT_STRING, NULL);
|
||||||
addMacro(NULL, tagm->macroname, NULL, body, -1);
|
addMacro(NULL, tagm->macroname, NULL, body, -1);
|
||||||
free(body);
|
free(body);
|
||||||
break;
|
break;
|
||||||
case RPM_NULL_TYPE:
|
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;
|
break;
|
||||||
}
|
}
|
||||||
rpmtdFreeData(&td);
|
rpmtdFreeData(&td);
|
||||||
}
|
}
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -306,6 +296,8 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd,
|
||||||
goto exit;
|
goto exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rpmInstallLoadMacros(h);
|
||||||
|
|
||||||
fi = rpmfiNew(ts, h, RPMTAG_BASENAMES, RPMFI_KEEPHEADER);
|
fi = rpmfiNew(ts, h, RPMTAG_BASENAMES, RPMFI_KEEPHEADER);
|
||||||
h = headerFree(h);
|
h = headerFree(h);
|
||||||
|
|
||||||
|
@ -321,7 +313,6 @@ rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd,
|
||||||
|
|
||||||
rpmteSetHeader(fi->te, fi->h);
|
rpmteSetHeader(fi->te, fi->h);
|
||||||
fi->te->fd = fdLink(fd, RPMDBG_M("installSourcePackage"));
|
fi->te->fd = fdLink(fd, RPMDBG_M("installSourcePackage"));
|
||||||
(void) rpmInstallLoadMacros(fi, fi->h);
|
|
||||||
|
|
||||||
if (rpmMkdirs(rpmtsRootDir(ts), "%{_topdir}:%{_sourcedir}:%{_specdir}")) {
|
if (rpmMkdirs(rpmtsRootDir(ts), "%{_topdir}:%{_sourcedir}:%{_specdir}")) {
|
||||||
goto exit;
|
goto exit;
|
||||||
|
|
Loading…
Reference in New Issue