[libcalamares] Improve warnings when module descriptor files are bad

This commit is contained in:
Adriaan de Groot 2019-06-18 12:06:13 +02:00
parent 5fdaeaa899
commit 34b1a250ba

View file

@ -90,10 +90,14 @@ ModuleManager::doInit()
if ( success ) if ( success )
{ {
QFileInfo descriptorFileInfo( currentDir.absoluteFilePath( QLatin1Literal( "module.desc") ) ); QFileInfo descriptorFileInfo( currentDir.absoluteFilePath( QLatin1Literal( "module.desc") ) );
if ( ! ( descriptorFileInfo.exists() && descriptorFileInfo.isReadable() ) ) if ( !descriptorFileInfo.exists() )
{ {
cDebug() << Q_FUNC_INFO << "unreadable file: " cDebug() << "ModuleManager expected descriptor is missing:" << descriptorFileInfo.absoluteFilePath();
<< descriptorFileInfo.absoluteFilePath(); continue;
}
if ( !descriptorFileInfo.isReadable() )
{
cDebug() << "ModuleManager descriptor file is unreadable:" << descriptorFileInfo.absoluteFilePath();
continue; continue;
} }
@ -111,13 +115,14 @@ ModuleManager::doInit()
} }
else else
{ {
cWarning() << "Cannot cd into module directory " cWarning() << "ModuleManager module directory is not accessible:" << path << "/" << subdir;
<< path << "/" << subdir;
} }
} }
} }
else 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 // At this point m_availableModules is filled with whatever was found in the
// search paths. // search paths.
@ -359,7 +364,7 @@ ModuleManager::checkDependencies()
m_availableDescriptorsByModuleName.erase( it ); m_availableDescriptorsByModuleName.erase( it );
failed << moduleName; failed << moduleName;
cWarning() << "Module" << moduleName << "requires modules" << Logger::DebugList( unmet ); 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; break;
} }
} }