From 0fe9ebef6692c8d29122cc814325e6bd3b8bb5cb Mon Sep 17 00:00:00 2001 From: Gerhard Hoffmann Date: Thu, 2 Oct 2025 15:36:09 +0200 Subject: [PATCH] Make sure that if everything fails, to check /etc/dc for thedc-binary. --- common/src/utils_internal.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/common/src/utils_internal.cpp b/common/src/utils_internal.cpp index a8f293b..2957674 100644 --- a/common/src/utils_internal.cpp +++ b/common/src/utils_internal.cpp @@ -124,18 +124,22 @@ std::unique_ptr dcCandidateToInstall(QString const &dcDirectory, dcDir = customerRepoDcDir(); } else { dcDir = dcDirectory; - } } else { - if (dcDirectory.isEmpty()) { - dcDir = QDir::cleanPath(rootDir + QDir::separator() + customerRepoDcDir()); + if (!rootDir.endsWith("/etc/dc") && !rootDir.endsWith("/etc/dc/")) { + if (dcDirectory.isEmpty()) { + dcDir = QDir::cleanPath(rootDir + QDir::separator() + "etc/dc/"); + } else { + dcDir = QDir::cleanPath(rootDir + QDir::separator() + dcDirectory); + } } else { - dcDir = QDir::cleanPath(rootDir + QDir::separator() + dcDirectory); + dcDir = QDir::cleanPath(rootDir + QDir::separator()); } } if (dcDir.exists()) { - qCritical() << __func__ << __LINE__ << dcDir; + + qInfo() << "use" << dcDir.absolutePath() << "as directory (containing dc-binary)"; QFileInfoList fileInfoList = dcDir.entryInfoList(QStringList("*.bin"), @@ -143,7 +147,6 @@ std::unique_ptr dcCandidateToInstall(QString const &dcDirectory, QFileInfo dc2cbin{dcDir.absoluteFilePath("dc2c.bin")}; - if (dc2cbin.exists()) { QCryptographicHash md5gen(QCryptographicHash::Md5); @@ -175,7 +178,11 @@ std::unique_ptr dcCandidateToInstall(QString const &dcDirectory, } } } else { - qCritical() << __func__ << __LINE__ << dcDir << "does not exist"; + qCritical() << dcDir.absolutePath() << "does not exist"; + if (dcDir.absolutePath() != QDir("/etc/dc/").absolutePath()) { + qInfo() << __func__ << __LINE__ << "Try /etc/dc/"; + return dcCandidateToInstall("/etc/dc/", ""); + } } return dcCandidate;