@ -145,8 +145,15 @@ moduleConfigurationCandidates( bool assumeBuildDir, const QString& moduleName, c
paths < < CalamaresUtils : : appDataDir ( ) . absoluteFilePath ( QString ( " modules/%1 " ) . arg ( configFileName ) ) ;
else
{
// If an absolute path is given, in debug mode, look for it
// first. The case contains('/'), below, will add the absolute
// path a second time, though.
if ( assumeBuildDir & & configFileName . startsWith ( ' / ' ) )
paths < < configFileName ;
if ( assumeBuildDir )
paths < < QDir ( ) . absoluteFilePath ( QString ( " src/modules/%1/%2 " ) . arg ( moduleName ) . arg ( configFileName ) ) ;
if ( assumeBuildDir & & configFileName . contains ( ' / ' ) )
paths < < QDir ( ) . absoluteFilePath ( configFileName ) ;
paths < < QString ( " /etc/calamares/modules/%1 " ) . arg ( configFileName ) ;
paths < < CalamaresUtils : : appDataDir ( ) . absoluteFilePath ( QString ( " modules/%1 " ) . arg ( configFileName ) ) ;
@ -168,6 +175,7 @@ Module::loadConfigurationFile( const QString& configFileName ) //throws YAML::Ex
YAML : : Node doc = YAML : : Load ( ba . constData ( ) ) ;
if ( doc . IsNull ( ) )
{
cDebug ( ) < < " Found empty module configuration " < < path ;
// Special case: empty config files are valid,
// but aren't a map.
return ;
@ -178,14 +186,13 @@ Module::loadConfigurationFile( const QString& configFileName ) //throws YAML::Ex
return ;
}
cDebug ( ) < < " Loaded module configuration " < < path ;
m_configurationMap = CalamaresUtils : : yamlMapToVariant ( doc ) . toMap ( ) ;
m_emergency = m_maybe_emergency
& & m_configurationMap . contains ( EMERGENCY )
& & m_configurationMap [ EMERGENCY ] . toBool ( ) ;
return ;
}
else
continue ;
}
}