← Back to team overview

kicad-developers team mailing list archive

BUGFIX: mdc is incomplete after 'archive footprint'

 

The generated mdc doesn't contain the docs for the last module archived.

One line patch (but IMHO not correct, as I'll explain):
Index: librairi.cpp
===================================================================
--- librairi.cpp (revision 1521)
+++ librairi.cpp (working copy)
@@ -476,7 +476,7 @@
break;
}
 
- CreateDocLibrary( LibName );
+ CreateDocLibrary( FullFileName );
}

The problem is actually pretty related to another thing: in
Save_1_Module at line 684 CreateDocLibrary is called with the BACKUP
file name (OldLib), and not with the current one (LibName)...

During the archiving Save_1_Module is repeatedly called, each time
generating an mdc of the old library (i.e. missing the last module)...
in fact the call at line 479 gets an empty string (and silently fails!)

So a better solution would be to remove the call at line 479 and fix
the one at 684. But I have no idea if this would broke something else,
so I leave it to you...

An even better idea would be to create the mdc only AT THE END (now
the mdc is recreated with the whole library for each single module...
ouch :P). And even even better better would be a refactoring of the
library file code so that, archiving could be then done as a single
sequential write of the library file (anyway it seems there is some
code duplication in there with all that rewriting routines)