Fallback to using `updpkgsums`/`repo-add` from container for containerized builds
If those tools are not installed on the host but we use `makecontainerpkg` anyways for the build we might as well use it to run these additional tools as well.
This commit is contained in:
parent
10e86c759c
commit
72d1999e72
|
@ -281,14 +281,14 @@ void ConductBuild::run()
|
||||||
reportError("Unable to find makechrootpkg executable \"" % m_setup.building.makeChrootPkgPath + "\" in PATH.");
|
reportError("Unable to find makechrootpkg executable \"" % m_setup.building.makeChrootPkgPath + "\" in PATH.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
if (!checkExecutable(m_updatePkgSumsPath)) {
|
||||||
if (!checkExecutable(m_updatePkgSumsPath)) {
|
reportError("Unable to find updpkgsums executable \"" % m_setup.building.updatePkgSumsPath + "\" in PATH.");
|
||||||
reportError("Unable to find updpkgsums executable \"" % m_setup.building.updatePkgSumsPath + "\" in PATH.");
|
return;
|
||||||
return;
|
}
|
||||||
}
|
if (!checkExecutable(m_repoAddPath)) {
|
||||||
if (!checkExecutable(m_repoAddPath)) {
|
reportError("Unable to find repo-add executable \"" % m_setup.building.repoAddPath + "\" in PATH.");
|
||||||
reportError("Unable to find repo-add executable \"" % m_setup.building.repoAddPath + "\" in PATH.");
|
return;
|
||||||
return;
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// assign paths
|
// assign paths
|
||||||
|
@ -898,9 +898,16 @@ InvocationResult ConductBuild::invokeUpdatePkgSums(const BatchProcessingSession:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
m_buildAction->log()(Phrases::InfoMessage, "Updating checksums of ", packageName, " via ", m_updatePkgSumsPath.string(), '\n',
|
if (m_useContainer && !checkExecutable(m_updatePkgSumsPath)) {
|
||||||
ps(Phrases::SubMessage), "build dir: ", buildDirectory, '\n');
|
m_buildAction->log()(Phrases::InfoMessage, "Updating checksums of ", packageName, " via ", m_makeContainerPkgPath.string(), '\n',
|
||||||
processSession->launch(boost::process::start_dir(buildDirectory), m_updatePkgSumsPath);
|
ps(Phrases::SubMessage), "build dir: ", buildDirectory, '\n');
|
||||||
|
processSession->launch(boost::process::start_dir(buildDirectory), boost::process::env["PKGNAME"] = packageName,
|
||||||
|
boost::process::env["TOOL"] = "updpkgsums", m_makeContainerPkgPath);
|
||||||
|
} else {
|
||||||
|
m_buildAction->log()(Phrases::InfoMessage, "Updating checksums of ", packageName, " via ", m_updatePkgSumsPath.string(), '\n',
|
||||||
|
ps(Phrases::SubMessage), "build dir: ", buildDirectory, '\n');
|
||||||
|
processSession->launch(boost::process::start_dir(buildDirectory), m_updatePkgSumsPath);
|
||||||
|
}
|
||||||
return InvocationResult::Ok;
|
return InvocationResult::Ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1446,8 +1453,15 @@ void ConductBuild::invokeRepoAdd(const BatchProcessingSession::SharedPointerType
|
||||||
buildResult.needsStaging ? m_buildPreparation.stagingDb : m_buildPreparation.targetDb, m_buildPreparation.targetArch),
|
buildResult.needsStaging ? m_buildPreparation.stagingDb : m_buildPreparation.targetDb, m_buildPreparation.targetArch),
|
||||||
[this, &packageName, processSession, buildAction = m_buildAction, &buildResult](UniqueLoggingLock &&lock) {
|
[this, &packageName, processSession, buildAction = m_buildAction, &buildResult](UniqueLoggingLock &&lock) {
|
||||||
processSession->locks().emplace_back(std::move(lock));
|
processSession->locks().emplace_back(std::move(lock));
|
||||||
processSession->launch(
|
if (m_useContainer && !checkExecutable(m_repoAddPath)) {
|
||||||
boost::process::start_dir(*buildResult.repoPath), m_repoAddPath, *buildResult.dbFilePath, buildResult.binaryPackageNames);
|
m_buildAction->log()(
|
||||||
|
Phrases::InfoMessage, "Going to invoke repo-add for ", packageName, " via ", m_makeContainerPkgPath.string(), '\n');
|
||||||
|
processSession->launch(boost::process::start_dir(*buildResult.repoPath), boost::process::env["PKGNAME"] = packageName,
|
||||||
|
boost::process::env["TOOL"] = "repo-add", m_makeContainerPkgPath, "--", *buildResult.dbFilePath, buildResult.binaryPackageNames);
|
||||||
|
} else {
|
||||||
|
processSession->launch(
|
||||||
|
boost::process::start_dir(*buildResult.repoPath), m_repoAddPath, *buildResult.dbFilePath, buildResult.binaryPackageNames);
|
||||||
|
}
|
||||||
buildAction->log()(Phrases::InfoMessage, "Adding ", packageName, " to repo\n", ps(Phrases::SubMessage),
|
buildAction->log()(Phrases::InfoMessage, "Adding ", packageName, " to repo\n", ps(Phrases::SubMessage),
|
||||||
"repo path: ", buildResult.repoPath, '\n', ps(Phrases::SubMessage), "db path: ", buildResult.dbFilePath, '\n',
|
"repo path: ", buildResult.repoPath, '\n', ps(Phrases::SubMessage), "db path: ", buildResult.dbFilePath, '\n',
|
||||||
ps(Phrases::SubMessage), "package(s): ", joinStrings(buildResult.binaryPackageNames), '\n');
|
ps(Phrases::SubMessage), "package(s): ", joinStrings(buildResult.binaryPackageNames), '\n');
|
||||||
|
|
Loading…
Reference in New Issue