From 60a477af99720d84ca09e25352473d9395cd0db8 Mon Sep 17 00:00:00 2001 From: Martchus Date: Thu, 9 Nov 2023 13:46:47 +0100 Subject: [PATCH] Keep setup lock while checking executables In the error case we use the fields from `m_setup.building` so the lock needs to be kept. --- librepomgr/buildactions/conductbuild.cpp | 2 +- librepomgr/buildactions/preparebuild.cpp | 2 +- librepomgr/buildactions/repomanagement.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/librepomgr/buildactions/conductbuild.cpp b/librepomgr/buildactions/conductbuild.cpp index 10dd36c..3081677 100644 --- a/librepomgr/buildactions/conductbuild.cpp +++ b/librepomgr/buildactions/conductbuild.cpp @@ -264,7 +264,6 @@ void ConductBuild::run() m_updatePkgSumsPath = findExecutable(m_setup.building.updatePkgSumsPath); m_repoAddPath = findExecutable(m_setup.building.repoAddPath); m_gpgPath = findExecutable(m_setup.building.gpgPath); - setupReadLock.unlock(); // check executables if (m_useContainer) { @@ -290,6 +289,7 @@ void ConductBuild::run() return; } } + setupReadLock.unlock(); // assign paths m_makepkgConfigPath = m_workingDirectory + "/makepkg.conf"; diff --git a/librepomgr/buildactions/preparebuild.cpp b/librepomgr/buildactions/preparebuild.cpp index 0ce2c89..101684b 100644 --- a/librepomgr/buildactions/preparebuild.cpp +++ b/librepomgr/buildactions/preparebuild.cpp @@ -101,13 +101,13 @@ void PrepareBuild::run() copySecondVectorIntoFirstVector(m_pkgbuildsDirs, m_setup.building.pkgbuildsDirs); m_ignoreLocalPkgbuildsRegex = m_setup.building.ignoreLocalPkgbuildsRegex; m_workingDirectory = determineWorkingDirectory(buildDataWorkingDirectory); - setupReadLock.unlock(); // check executables if (!checkExecutable(m_makePkgPath)) { reportError("Unable to find makepkg executable \"" % m_setup.building.makePkgPath + "\" in PATH."); return; } + setupReadLock.unlock(); // init build action auto configReadLock diff --git a/librepomgr/buildactions/repomanagement.cpp b/librepomgr/buildactions/repomanagement.cpp index a20a36b..fb94fdd 100644 --- a/librepomgr/buildactions/repomanagement.cpp +++ b/librepomgr/buildactions/repomanagement.cpp @@ -44,7 +44,6 @@ bool PackageMovementAction::prepareRepoAction(RequiredDatabases requiredDatabase if (requiredDatabases & RequiredDatabases::OneSource) { m_repoAddPath = findExecutable(m_setup.building.repoAddPath); } - setupLock.unlock(); // check executables if (!checkExecutable(m_repoRemovePath)) { @@ -55,6 +54,7 @@ bool PackageMovementAction::prepareRepoAction(RequiredDatabases requiredDatabase reportError("Unable to find repo-add executable \"" % m_setup.building.repoAddPath + "\" in PATH."); return false; } + setupLock.unlock(); // locate databases and packages const auto *const destinationDb = *m_destinationDbs.begin();