Skip to content

Commit

Permalink
ignore_module file ignores module paths in init/deinit/update (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuna-f1sh committed Jan 25, 2023
1 parent 4d03223 commit 9cfe6e7
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ignore_modules.txt
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@ This downloads all the libraries in parallel but it can still take a while.

If you are stuck on KiCad version 4 or version 5 can use the `kicad-4` or the `kicad-5` branch. These branches are not being updated though.

#### Ignoring Modules

Create a file `ignore_modules.txt` and add a sub-string to match per line for module names to ignore. For example to ignore the official KiCad modules from this repo (since they are already included with KiCad) `ignore_modules.txt` would be:

kicad-official

If adding lines to `ignore_modules.txt` having already run `./init` then run `./deinit` to de-register the modules affected by the lines.

### Updating

If you want to update all libraries to their latest versions do:
Expand All @@ -48,7 +56,6 @@ _Warning: This will overwrite your existing fp-lib-table, discard any customizat
cp ~/.config/kicad/6.0/fp-lib-table ~/.config/kicad/6.0/fp-lib-table.backup
./generate_table ~/.config/kicad/6.0/fp-lib-table


#### Mac OS

cp ~/Library/Preferences/kicad/6.0/fp-lib-table ~/Library/Preferences/kicad/6.0/fp-lib-table.backup
Expand All @@ -75,7 +82,6 @@ If you don't like the new way of organizing footprint libs and want to restore y

cp ~/AppData/Roaming/kicad/6.0/fp-lib-table.backup ~/AppData/Roaming/kicad/6.0/fp-lib-table


### 3D models

You can try and hack the 3D models to be correctly associated to the footprints through absolute paths by running this script:
Expand Down
10 changes: 10 additions & 0 deletions deinit
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env sh
set -eu

max_parallel_tasks=10
ignore_file='ignore_modules.txt'
test -f $ignore_file || touch $ignore_file


git submodule | awk '{ print $2 }' | grep --fixed-strings --file=$ignore_file \
| xargs -I'{}' -P$max_parallel_tasks git submodule deinit -f '{}'
4 changes: 3 additions & 1 deletion init
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
set -eu

max_parallel_tasks=10
ignore_file='ignore_modules.txt'
test -f $ignore_file || touch $ignore_file

#prevents git from waiting for password input on invalid/removed git URLs
export GIT_ASKPASS=/bin/echo

git submodule init

git submodule | awk '{ print $2 }' \
git submodule | awk '{ print $2 }' | grep --invert-match --fixed-strings --file=$ignore_file \
| xargs -I'{}' -P$max_parallel_tasks sh clone.sh '{}'
4 changes: 3 additions & 1 deletion update
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
set -eu

max_parallel_tasks=10
ignore_file='ignore_modules.txt'
test -f $ignore_file || touch $ignore_file

#prevents git from waiting for password input on invalid/removed git URLs
export GIT_ASKPASS=/bin/echo

git submodule | awk '{ print $2 }' \
git submodule | awk '{ print $2 }' | grep --invert-match --fixed-strings --file=$ignore_file \
| xargs -I'{}' -P$max_parallel_tasks sh check.sh {}

0 comments on commit 9cfe6e7

Please sign in to comment.