Ok, now I pre-append the PATH to the folder with this new __eeschema.kiface. I am not sure yet if this is going to work. Maybe I have to replace it directly in /usr/share/bin instead.
Then I am launching the .kicad_sch.
Now, what should I do?
Save it or Save it as?
Both did not work still.
I am going to place it in the original path, since eeschema may have hardcoded paths
I don’t know if it’s working with PATH (it’s a shared library or module). This is only to test if it’s worthwhile, so just temporarily replace it in /usr/bin. If it’s working with your script, you probably want to compile a more modified version.
Now, this has limitations, like coordinates are truncated or rounded, and it doesn’t change the symbol libraries. While the code is still there, it has not been tested and might even crash if a new feature of KiCad 6 is used…
I could copy eeschema to the same folder that was apprehended in the PATH, and it worked too. So eeschema has this __eeschema.kicade hardcoded inside to get it from the same folder.
This way I don’t need to replace system’s version of it. I can have patched file and eeschema in a different folder and load this whenever I need.
Now, this has limitations, like coordinates are truncated or rounded, and it doesn’t change the symbol libraries. While the code is still there, it has not been tested and might even crash if a new feature of KiCad 6 is used…
Sure, this is a good warning and also makes sense.
Alternativelly I am finishing Kicad’s build for the first time. I am going to try to update this directly in the code. If that works, then I can change it a bit to use it from the command line as a standalone tool.
Yeah, but I am waiting for this API thing for 2 years already. I have no idea when it is going to be released. I just wanted to have this export svg function so bad. Now since you have mentioned 6.99, it may be landing to the nightly builds sometime soon. I will keep an eye on it then. Thanks a lot for this whole tutorial dude!
git diff and git apply are very similar to the traditional diff and patch commands but can also handle binary data (and not just open files in binary mode), although only for the files that exactly match the hashes in the diff.
The diffs had been created using the following (actually, git had been modified to use pack v3 format to get shorter deltas but the result after applying is the same):
git diff --binary file.orig file | sed 1s/\\.orig// > patch.diff
hey, @mgyger by any chance do you know where in the code eeschama loads/opens schematics when I run from the command line with the following command, for instance?
eeschema board.kicad_sch
I just want to put a code to save the schematics end exit, right after.
In this way, I will pass the main schematic through the command line which already works by default. Eeschema will load it with other dependent schematics, and then it will save it immediately using the old file format and leave.
Sorry, don’t know, but I guess somewhere where SCH_IO_MGR::FindPlugin is called as well… Maybe ask a developer…
You could set a break point in a debug build and print a stack trace, or pretend to have loaded a 5.1 schematic so that it wants to migrate it to presumed 6.0, or mark it as modified and skip the confirmation dialog on exit…