diff --git a/librepomgr/buildactions/buildactionmeta.cpp b/librepomgr/buildactions/buildactionmeta.cpp index df27c3f..55796ba 100644 --- a/librepomgr/buildactions/buildactionmeta.cpp +++ b/librepomgr/buildactions/buildactionmeta.cpp @@ -166,6 +166,12 @@ BuildActionMetaInfo::BuildActionMetaInfo() .desc = "Resets chroot dir, chroot user and related flags", .param = "reset-chroot-cfg", }, + BuildActionFlagMetaInfo{ + .id = static_cast(PrepareBuildFlags::PullingInFurtherDependenciesUnexpected), + .name = "Pulling-in further dependencies unexpected", + .desc = "Whether pulling-in further dependencies leads to an error causing subsequent build actions not to be executed automatically; useful to be able to review packages added to the build before conducting the build", + .param = "pulling-in-new-deps-unexpected", + }, }, .settings = { BuildActionSettingMetaInfo{ diff --git a/librepomgr/buildactions/buildactionmeta.h b/librepomgr/buildactions/buildactionmeta.h index e19a6be..3eeb66d 100644 --- a/librepomgr/buildactions/buildactionmeta.h +++ b/librepomgr/buildactions/buildactionmeta.h @@ -77,6 +77,7 @@ enum class PrepareBuildFlags : BuildActionFlagType { KeepOrder = (1 << 2), KeepPkgRelAndEpoch = (1 << 3), ResetChrootSettings = (1 << 4), + PullingInFurtherDependenciesUnexpected = (1 << 5), }; enum class ConductBuildFlags : BuildActionFlagType { None, diff --git a/librepomgr/buildactions/buildactionprivate.h b/librepomgr/buildactions/buildactionprivate.h index 42c03b8..ebf10b8 100644 --- a/librepomgr/buildactions/buildactionprivate.h +++ b/librepomgr/buildactions/buildactionprivate.h @@ -512,6 +512,8 @@ private: bool m_keepOrder = false; bool m_keepPkgRelAndEpoch = false; bool m_resetChrootSettings = false; + bool m_pullingInFurtherDependenciesUnexpected = false; + bool m_pulledInFurtherDependencies = false; }; struct LIBREPOMGR_EXPORT BatchProcessingSession : public MultiSession { diff --git a/librepomgr/buildactions/preparebuild.cpp b/librepomgr/buildactions/preparebuild.cpp index 6378070..91b6cbb 100644 --- a/librepomgr/buildactions/preparebuild.cpp +++ b/librepomgr/buildactions/preparebuild.cpp @@ -75,6 +75,7 @@ void PrepareBuild::run() m_keepOrder = flags & PrepareBuildFlags::KeepOrder; m_keepPkgRelAndEpoch = flags & PrepareBuildFlags::KeepPkgRelAndEpoch; m_resetChrootSettings = flags & PrepareBuildFlags::ResetChrootSettings; + m_pullingInFurtherDependenciesUnexpected = flags & PrepareBuildFlags::PullingInFurtherDependenciesUnexpected; if (m_forceBumpPackageVersion && m_keepPkgRelAndEpoch) { reportError("Can not force-bump pkgrel and keeping it at the same time."); return; @@ -859,6 +860,9 @@ void PrepareBuild::computeDependencies(WebClient::AurSnapshotQuerySession::Conta } // pull missing dependencies if all sources could be retrieved so far + if (furtherDependenciesNeeded) { + m_pulledInFurtherDependencies = true; + } if (!sourcesMissing && furtherDependenciesNeeded) { fetchMissingBuildData(); return; @@ -893,7 +897,13 @@ void PrepareBuild::computeDependencies(WebClient::AurSnapshotQuerySession::Conta computeBatches(); } - auto resultData = makeResultData(); + // provoke an error if previously pulled-in further dependencies and that's not wanted + auto error = std::string(); + if (m_pulledInFurtherDependencies && m_pullingInFurtherDependenciesUnexpected) { + error = "Had to pull-in further dependencies which is considered unexpected"; + } + + auto resultData = makeResultData(std::move(error)); auto buildActionWriteLock = m_setup.building.lockToWrite(); m_buildAction->resultData = std::move(resultData); if (resultData.error.empty() && resultData.cyclicLeftovers.empty()) {