From 34b1a250bae02896c14d2e0cf7d32c5013e1a650 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Tue, 18 Jun 2019 12:06:13 +0200 Subject: [PATCH] [libcalamares] Improve warnings when module descriptor files are bad --- .../modulesystem/ModuleManager.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/libcalamaresui/modulesystem/ModuleManager.cpp b/src/libcalamaresui/modulesystem/ModuleManager.cpp index 185ec37e9..a030e55cd 100644 --- a/src/libcalamaresui/modulesystem/ModuleManager.cpp +++ b/src/libcalamaresui/modulesystem/ModuleManager.cpp @@ -90,10 +90,14 @@ ModuleManager::doInit() if ( success ) { QFileInfo descriptorFileInfo( currentDir.absoluteFilePath( QLatin1Literal( "module.desc") ) ); - if ( ! ( descriptorFileInfo.exists() && descriptorFileInfo.isReadable() ) ) + if ( !descriptorFileInfo.exists() ) { - cDebug() << Q_FUNC_INFO << "unreadable file: " - << descriptorFileInfo.absoluteFilePath(); + cDebug() << "ModuleManager expected descriptor is missing:" << descriptorFileInfo.absoluteFilePath(); + continue; + } + if ( !descriptorFileInfo.isReadable() ) + { + cDebug() << "ModuleManager descriptor file is unreadable:" << descriptorFileInfo.absoluteFilePath(); continue; } @@ -111,13 +115,14 @@ ModuleManager::doInit() } else { - cWarning() << "Cannot cd into module directory " - << path << "/" << subdir; + cWarning() << "ModuleManager module directory is not accessible:" << path << "/" << subdir; } } } else - cDebug() << "ModuleManager bad search path" << path; + { + cDebug() << "ModuleManager module search path does not exist:" << path; + } } // At this point m_availableModules is filled with whatever was found in the // search paths. @@ -359,7 +364,7 @@ ModuleManager::checkDependencies() m_availableDescriptorsByModuleName.erase( it ); failed << moduleName; cWarning() << "Module" << moduleName << "requires modules" << Logger::DebugList( unmet ); - cWarning() << Logger::SubEntry << "but these are not available (listed in settings, or installed)."; + cWarning() << Logger::SubEntry << "but these are not available (listed in settings, or installed)."; break; } }