From c4b0511f8d04c9f28fc729a043007e8d9fb0afab Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Mon, 21 Oct 2019 18:08:16 +0200 Subject: [PATCH] [libcalamaresui] Improve debug message for bad dirs - Calamares scans **all** subdirs of the module-directory for a module.desc and complains about those that don't have a module.desc. - For ./calamares -d runs from the build-directory, this leads to a few complaints when some plugins have been ignored (and so no module.desc is generated for them). --- src/libcalamaresui/modulesystem/ModuleManager.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/libcalamaresui/modulesystem/ModuleManager.cpp b/src/libcalamaresui/modulesystem/ModuleManager.cpp index 53cc1fabb..cd8685f44 100644 --- a/src/libcalamaresui/modulesystem/ModuleManager.cpp +++ b/src/libcalamaresui/modulesystem/ModuleManager.cpp @@ -91,17 +91,20 @@ ModuleManager::doInit() bool success = currentDir.cd( subdir ); if ( success ) { + static const char bad_descriptor[] = "ModuleManager potential module descriptor is bad"; QFileInfo descriptorFileInfo( currentDir.absoluteFilePath( QLatin1String( "module.desc" ) ) ); if ( !descriptorFileInfo.exists() ) { - cDebug() << "ModuleManager expected descriptor is missing:" - << descriptorFileInfo.absoluteFilePath(); + cDebug() << bad_descriptor + << descriptorFileInfo.absoluteFilePath() + << "(missing)"; continue; } if ( !descriptorFileInfo.isReadable() ) { - cDebug() << "ModuleManager descriptor file is unreadable:" - << descriptorFileInfo.absoluteFilePath(); + cDebug() << bad_descriptor + << descriptorFileInfo.absoluteFilePath() + << "(unreadable)"; continue; } @@ -109,7 +112,7 @@ ModuleManager::doInit() QVariantMap moduleDescriptorMap = CalamaresUtils::loadYaml( descriptorFileInfo, &ok ); QString moduleName = ok ? moduleDescriptorMap.value( "name" ).toString() : QString(); - if ( ok && ( moduleName == currentDir.dirName() ) + if ( ok && !moduleName.isEmpty() && ( moduleName == currentDir.dirName() ) && !m_availableDescriptorsByModuleName.contains( moduleName ) ) { m_availableDescriptorsByModuleName.insert( moduleName, moduleDescriptorMap );