Use rpmMkdirs() to create the entire build tree in buildForTarget()
- also move the build tree generation earlier to have it automatically created for tarbuilds too
This commit is contained in:
parent
c17dffb6fb
commit
aa509e3c5e
28
build.c
28
build.c
|
@ -186,6 +186,12 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba)
|
|||
if (ba->buildRootOverride)
|
||||
buildRootURL = rpmGenPath(NULL, ba->buildRootOverride, NULL);
|
||||
|
||||
/* Create build tree if necessary */
|
||||
const char * buildtree = "%{_topdir}:%{_specdir}:%{_sourcedir}:%{_builddir}:%{_rpmdir}:%{_srcrpmdir}:%{_buildrootdir}";
|
||||
if (rpmMkdirs(rpmtsRootDir(ts), buildtree)) {
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (ba->buildMode == 't') {
|
||||
char *srcdir = NULL, *dir;
|
||||
|
||||
|
@ -254,28 +260,6 @@ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba)
|
|||
goto exit;
|
||||
}
|
||||
|
||||
/* Be sure all required directories exist, attempt to create them if not */
|
||||
{
|
||||
char *_topdir = rpmGenPath(rpmtsRootDir(ts), "%{_topdir}", ""),
|
||||
*_builddir = rpmGenPath(rpmtsRootDir(ts), "%{_builddir}", ""),
|
||||
*_buildrootdir = rpmGenPath(rpmtsRootDir(ts), "%{_buildrootdir}", ""),
|
||||
*_sourcedir = rpmGenPath(rpmtsRootDir(ts), "%{_sourcedir}", ""),
|
||||
*_rpmdir = rpmGenPath(rpmtsRootDir(ts), "%{_rpmdir}", ""),
|
||||
*_specdir = rpmGenPath(rpmtsRootDir(ts), "%{_specdir}", ""),
|
||||
*_srcrpmdir = rpmGenPath(rpmtsRootDir(ts), "%{_srcrpmdir}", "");
|
||||
|
||||
if ( rpmMkdirPath(_topdir, "_topdir") ||
|
||||
rpmMkdirPath(_builddir, "_builddir") ||
|
||||
rpmMkdirPath(_buildrootdir, "_buildrootdir") ||
|
||||
rpmMkdirPath(_sourcedir, "_sourcedir") ||
|
||||
rpmMkdirPath(_rpmdir, "_rpmdir") ||
|
||||
rpmMkdirPath(_specdir, "_specdir") ||
|
||||
rpmMkdirPath(_srcrpmdir, "_srcrpmdir")
|
||||
) {
|
||||
goto exit;
|
||||
}
|
||||
}
|
||||
|
||||
if (buildSpec(ts, spec, buildAmount, ba->noBuild)) {
|
||||
goto exit;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue