Правка определения путей для исполняемого файла в каталоге /opt
This commit is contained in:
parent
d687dd8e98
commit
a1d34d4c32
@ -23,18 +23,21 @@ Paths::HierarchyType Paths::getHierarchyType()
|
|||||||
return ( HierarchyType::kFlat );
|
return ( HierarchyType::kFlat );
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( binaryDir.startsWith( "/opt" ) )
|
QRegExp optRegexp( "^/opt(/|/.+/)" + m_projectName + "/" );
|
||||||
|
|
||||||
|
if ( optRegexp.indexIn( binaryDir ) >= 0 )
|
||||||
{
|
{
|
||||||
QFileInfo etcDirInfo { "/opt/" + m_projectName + "/etc" };
|
binaryDir.remove( binRegexp );
|
||||||
|
QFileInfo etcDirInfo { binaryDir + "/etc" };
|
||||||
if ( !etcDirInfo.isDir() || !etcDirInfo.isReadable() ) { return( HierarchyType::kFlat ); }
|
if ( !etcDirInfo.isDir() || !etcDirInfo.isReadable() ) { return( HierarchyType::kFlat ); }
|
||||||
|
|
||||||
QFileInfo constDataDirInfo { "/opt/" + m_projectName + "/files/data" };
|
QFileInfo constDataDirInfo { binaryDir + "/files/data" };
|
||||||
if ( !constDataDirInfo.isDir() || !constDataDirInfo.isReadable() ) { return( HierarchyType::kFlat ); }
|
if ( !constDataDirInfo.isDir() || !constDataDirInfo.isReadable() ) { return( HierarchyType::kFlat ); }
|
||||||
|
|
||||||
QFileInfo varDataDirInfo { "/opt/" + m_projectName + "/files/lib" };
|
QFileInfo varDataDirInfo { binaryDir + "/files/lib" };
|
||||||
if ( !varDataDirInfo.isDir() || !varDataDirInfo.isWritable() ) { return( HierarchyType::kFlat ); }
|
if ( !varDataDirInfo.isDir() || !varDataDirInfo.isWritable() ) { return( HierarchyType::kFlat ); }
|
||||||
|
|
||||||
QFileInfo logDirInfo { "/opt/" + m_projectName + "/files/log" };
|
QFileInfo logDirInfo { binaryDir + "/files/log" };
|
||||||
if ( !logDirInfo.isDir() || !logDirInfo.isWritable() ) { return( HierarchyType::kFlat ); }
|
if ( !logDirInfo.isDir() || !logDirInfo.isWritable() ) { return( HierarchyType::kFlat ); }
|
||||||
|
|
||||||
m_systemConfigDirectory = etcDirInfo.canonicalFilePath();
|
m_systemConfigDirectory = etcDirInfo.canonicalFilePath();
|
||||||
|
Loading…
Reference in New Issue
Block a user