1
0
mirror of git://projects.qi-hardware.com/kicad-libs.git synced 2024-11-22 19:53:44 +02:00

scripts/missing-in-tree: support also fped footprints (option -F)

This commit is contained in:
Werner Almesberger 2012-07-12 19:17:59 -03:00
parent 74fe2883e8
commit 837bc99b72

View File

@ -1,6 +1,6 @@
#!/bin/sh -e #!/bin/sh -e
# #
# missing-in-tree - List components present in libraries but not in the tree # missing-in-tree - List items present in libraries but not in the tree
# #
# Copyright 2012 by Werner Almesberger # Copyright 2012 by Werner Almesberger
# #
@ -13,12 +13,12 @@
usage() usage()
{ {
echo "usage: $0 [-L libdir ...] [-l lib ...] hierarchy" 1>&2 echo "usage: $0 [-F] [-L libdir ...] [-l lib ...] hierarchy" 1>&2
exit 1 exit 1
} }
scan_lib() scan_comp()
{ {
for n in "$@"; do for n in "$@"; do
sed '/^DEF ~\?/{s///;s/ .*//;p;};d' <$n >>_tmp2 sed '/^DEF ~\?/{s///;s/ .*//;p;};d' <$n >>_tmp2
@ -26,18 +26,33 @@ scan_lib()
} }
scan_fped()
{
for n in "$@"; do
fped -k $n - | sed '/^\$MODULE /s///p;d' >>_tmp2
done
}
trap "rm -f _tmp1 _tmp2" 0 trap "rm -f _tmp1 _tmp2" 0
gencat -D "$@" >_tmp1 || exit gencat -D "$@" >_tmp1 || exit
ext=.lib
>_tmp2 >_tmp2
while [ "$1" ]; do while [ "$1" ]; do
case "$1" in case "$1" in
-F) ext=.fpd;;
-L) shift -L) shift
[ "`echo \"$1\"/*.lib`" = "$1/*.lib" ] || [ "`echo \"$1\"/*.$ext`" = "$1/*.$ext" ] ||
scan_lib "$1"/*.lib;; scan_lib "$1"/*.$ext;;
-l) shift -l) shift
scan_lib "$1";; if [ $ext = .lib ]; then
scan_comp "$1"
else
scan_fped "$1"
fi;;
-*) usage;; -*) usage;;
*) break;; *) break;;
esac esac