[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).
This commit is contained in:
parent
300ebaaa03
commit
c4b0511f8d
@ -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 );
|
||||
|
Loading…
Reference in New Issue
Block a user