diff --git a/librepomgr/buildactions/buildactionprivate.h b/librepomgr/buildactions/buildactionprivate.h index b016353..aa79612 100644 --- a/librepomgr/buildactions/buildactionprivate.h +++ b/librepomgr/buildactions/buildactionprivate.h @@ -510,7 +510,7 @@ struct LIBREPOMGR_EXPORT BatchProcessingSession : public MultiSession &m_relevantPackages; std::mutex m_mutex; - std::vector>::iterator m_batchIterator, m_batchEnd; + std::vector>::iterator m_batchBegin, m_batchIterator, m_batchEnd; std::vector::iterator m_packageIterator, m_packageEnd; bool m_skipBatchesAfterFailure; bool m_hasFailuresInPreviousBatches; diff --git a/librepomgr/buildactions/conductbuild.cpp b/librepomgr/buildactions/conductbuild.cpp index a285a78..9e074e8 100644 --- a/librepomgr/buildactions/conductbuild.cpp +++ b/librepomgr/buildactions/conductbuild.cpp @@ -75,6 +75,7 @@ BatchProcessingSession::BatchProcessingSession(const std::unordered_set(ioContext, std::move(handler)) , m_relevantPackages(relevantPackages) + , m_batchBegin(batches.begin()) , m_batchIterator(batches.begin()) , m_batchEnd(batches.end()) , m_packageIterator(m_batchIterator != m_batchEnd ? m_batchIterator->begin() : decltype(m_packageIterator)()) @@ -168,7 +169,7 @@ const std::string *BatchProcessingSession::getCurrentPackageNameIfValidAndReleva /*! * \brief * Enables staging for the next batch. Enables staging for the current batch if the current package is the first package of - * current batch. + * current batch and the current batch is not the first batch. * \remarks * - The behavior regarding the current batch was chosen because we call selectNextPackage() *before* enableStagingInNextBatch(). * - This function might be called from multiple threads at the same time. @@ -178,7 +179,7 @@ void BatchProcessingSession::enableStagingInNextBatch() m_enableStagingInNextBatch = true; if (!m_stagingEnabled) { std::lock_guard lock(m_mutex); - m_stagingEnabled = m_batchIterator != m_batchEnd && m_packageIterator == m_batchIterator->begin(); + m_stagingEnabled = m_batchIterator != m_batchEnd && m_batchIterator != m_batchBegin && m_packageIterator == m_batchIterator->begin(); } }