Browse Source

Kicad PROJECT_ARCHIVER: better fix than commit 734e0ca0:

Do not store twice files with extension .gm?? in zip files
Previous commit did not store files like *.gm12, that can be existing when
Gerber files come from another ECAD tool, and allowed duplicate files like *.g1
newinvert
jean-pierre charras 2 years ago
parent
commit
7ca6344b57
  1. 14
      common/project/project_archiver.cpp

14
common/project/project_archiver.cpp

@ -137,8 +137,10 @@ bool PROJECT_ARCHIVER::Archive( const wxString& aSrcDir, const wxString& aDestFi
wxT( "*.stp" ), wxT( "*.step" ), // 3d files
wxT( "*.wrl" ),
wxT( "*.g?" ), wxT( "*.g??" ), // Gerber files
wxT( "*.gm??"), // Some gerbers like .gm12 (from protel export)
wxT( "*.gbrjob" ), // Gerber job files
wxT( "*.pos" ), wxT( "*.drl" ), wxT( "*.nc" ), wxT( "*.xnc" ), // Fab files
wxT( "*.pos" ), // our position files
wxT( "*.drl" ), wxT( "*.nc" ), wxT( "*.xnc" ), // Fab drill files
wxT( "*.d356" ),
wxT( "*.rpt" ),
wxT( "*.net" ),
@ -197,8 +199,18 @@ bool PROJECT_ARCHIVER::Archive( const wxString& aSrcDir, const wxString& aDestFi
unsigned long uncompressedBytes = 0;
// Our filename collector can store duplicate filenames. for instance *.gm2
// matches both *.g?? and *.gm??.
// So skip duplicate filenames (they are sorted, so it is easy.
wxString lastStoredFile;
for( unsigned ii = 0; ii < files.GetCount(); ii++ )
{
if( lastStoredFile == files[ii] ) // duplicate name: already stored
continue;
lastStoredFile = files[ii];
wxFileSystem fsfile;
wxFileName curr_fn( files[ii] );

Loading…
Cancel
Save