From c9b297de5e0410e794bf4807213a2fc289e674b9 Mon Sep 17 00:00:00 2001 From: John Whittington Date: Wed, 25 Jan 2023 11:20:58 +0100 Subject: [PATCH] ignore_module file ignores module paths in init/deinit/update --- .gitignore | 1 + README.md | 6 ++++-- deinit | 12 ++++++++++++ init | 4 +++- update | 4 +++- 5 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 .gitignore create mode 100755 deinit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b1cf8b9 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +ignore_modules diff --git a/README.md b/README.md index 073053b..a94330b 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,10 @@ 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'. Add regexp patterns per line for module names to ignore. If doing this having already run './init', create the ignore file, then run './deinit' + ### Updating If you want to update all libraries to their latest versions do: @@ -48,7 +52,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 @@ -75,7 +78,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: diff --git a/deinit b/deinit new file mode 100755 index 0000000..61bcab1 --- /dev/null +++ b/deinit @@ -0,0 +1,12 @@ +#!/usr/bin/env sh +set -eu + +max_parallel_tasks=10 +ignore_file='ignore_modules' +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 }' | grep --file=$ignore_file \ + | xargs -I'{}' -P$max_parallel_tasks git submodule deinit -f '{}' diff --git a/init b/init index b885755..71a4802 100755 --- a/init +++ b/init @@ -2,11 +2,13 @@ set -eu max_parallel_tasks=10 +ignore_file='ignore_modules' +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 --file=$ignore_file \ | xargs -I'{}' -P$max_parallel_tasks sh clone.sh '{}' diff --git a/update b/update index 46d2c4d..dba5935 100755 --- a/update +++ b/update @@ -2,9 +2,11 @@ set -eu max_parallel_tasks=10 +ignore_file='ignore_modules' +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 --file=$ignore_file \ | xargs -I'{}' -P$max_parallel_tasks sh check.sh {}