Fully resolve path list for Kicad2Step.
Fixes https://gitlab.com/kicad/code/kicad/issues/7670
This commit is contained in:
parent
507b386c79
commit
ed38028eaf
|
@ -601,7 +601,7 @@ bool FILENAME_RESOLVER::readPathList()
|
||||||
|
|
||||||
|
|
||||||
bool FILENAME_RESOLVER::WritePathList( const wxString& aDir, const wxString& aFilename,
|
bool FILENAME_RESOLVER::WritePathList( const wxString& aDir, const wxString& aFilename,
|
||||||
bool aWriteFullList )
|
bool aResolvePaths )
|
||||||
{
|
{
|
||||||
if( aDir.empty() )
|
if( aDir.empty() )
|
||||||
{
|
{
|
||||||
|
@ -617,9 +617,10 @@ bool FILENAME_RESOLVER::WritePathList( const wxString& aDir, const wxString& aFi
|
||||||
|
|
||||||
std::list<SEARCH_PATH>::const_iterator sPL = m_paths.begin();
|
std::list<SEARCH_PATH>::const_iterator sPL = m_paths.begin();
|
||||||
|
|
||||||
// skip all ${ENV_VAR} alias names
|
if( !aResolvePaths )
|
||||||
if( !aWriteFullList )
|
|
||||||
{
|
{
|
||||||
|
// skip all ${ENV_VAR} alias names
|
||||||
|
|
||||||
while( sPL != m_paths.end()
|
while( sPL != m_paths.end()
|
||||||
&& ( sPL->m_Alias.StartsWith( "${" ) || sPL->m_Alias.StartsWith( "$(" ) ) )
|
&& ( sPL->m_Alias.StartsWith( "${" ) || sPL->m_Alias.StartsWith( "$(" ) ) )
|
||||||
{
|
{
|
||||||
|
@ -652,10 +653,17 @@ bool FILENAME_RESOLVER::WritePathList( const wxString& aDir, const wxString& aFi
|
||||||
{
|
{
|
||||||
tstr = sPL->m_Alias.ToUTF8();
|
tstr = sPL->m_Alias.ToUTF8();
|
||||||
cfgFile << "\"" << tstr.size() << ":" << tstr << "\",";
|
cfgFile << "\"" << tstr.size() << ":" << tstr << "\",";
|
||||||
tstr = sPL->m_Pathvar.ToUTF8();
|
|
||||||
|
if( aResolvePaths )
|
||||||
|
tstr = ResolvePath( sPL->m_Pathvar ).ToUTF8();
|
||||||
|
else
|
||||||
|
tstr = sPL->m_Pathvar.ToUTF8();
|
||||||
|
|
||||||
cfgFile << "\"" << tstr.size() << ":" << tstr << "\",";
|
cfgFile << "\"" << tstr.size() << ":" << tstr << "\",";
|
||||||
|
|
||||||
tstr = sPL->m_Description.ToUTF8();
|
tstr = sPL->m_Description.ToUTF8();
|
||||||
cfgFile << "\"" << tstr.size() << ":" << tstr << "\"\n";
|
cfgFile << "\"" << tstr.size() << ":" << tstr << "\"\n";
|
||||||
|
|
||||||
++sPL;
|
++sPL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,9 +91,9 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Write the current path list to a config file.
|
* Write the current path list to a config file.
|
||||||
* @param aWriteFullList indicates whether env vars should also be written out or not
|
* @param aResolvePaths indicates whether env vars should also be written out or not
|
||||||
*/
|
*/
|
||||||
bool WritePathList( const wxString& aDir, const wxString& aFilename, bool aWriteFullList );
|
bool WritePathList( const wxString& aDir, const wxString& aFilename, bool aResolvePaths );
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determines the full path of the given file name.
|
* Determines the full path of the given file name.
|
||||||
|
|
Loading…
Reference in New Issue