1
0
mirror of git://projects.qi-hardware.com/kicad-libs.git synced 2024-11-08 00:08:25 +02:00

scripts/missing-in-tree: new option -Q to check project.pro

This commit is contained in:
Werner Almesberger 2014-01-05 13:33:14 -03:00
parent 85ae339ae6
commit 2497d96cd3

View File

@ -2,7 +2,7 @@
#
# missing-in-tree - List items present in libraries but not in the tree
#
# Copyright 2012 by Werner Almesberger
# Copyright 2012, 2014 by Werner Almesberger
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@ -14,6 +14,7 @@
usage()
{
echo "usage: $0 [-F] [-L libdir ...] [-l lib ...] hierarchy" 1>&2
echo " $0 -Q [-L libdir ...] [-l lib ...] project.pro" 1>&2
exit 1
}
@ -34,9 +35,22 @@ scan_fped()
}
scan_pro()
{
for n in `sed '/^LibName[0-9]*=\.\/\(.*\)/s//\1/p;d' $1`; do
sed '/^DEF ~\?/{s///;s/ .*//;p;};d' <$n.lib
done
}
trap "rm -f _tmp1 _tmp2" 0
genkicat -D "$@" >_tmp1 || exit
if [ "$1" = -Q ]; then
pro=true
shift
else
genkicat -D "$@" >_tmp1 || exit
pro=false
fi
ext=lib
@ -67,6 +81,10 @@ done
[ "$1" ] || usage
[ -z "$2" ] || usage
if $pro; then
scan_pro "$1" >_tmp1
fi
cat _tmp1 _tmp1 _tmp2 | sort | uniq -u
exit 0