mirror of
git://projects.qi-hardware.com/kicad-libs.git
synced 2024-11-22 02:25:20 +02:00
scripts/missing-in-tree: new option "-x lib" to exclude libraries
This commit is contained in:
parent
2497d96cd3
commit
d00f04ffa3
@ -13,15 +13,22 @@
|
||||
|
||||
usage()
|
||||
{
|
||||
echo "usage: $0 [-F] [-L libdir ...] [-l lib ...] hierarchy" 1>&2
|
||||
echo " $0 -Q [-L libdir ...] [-l lib ...] project.pro" 1>&2
|
||||
echo "usage: $0 [-F] [-x lib ...] [-L libdir ...] [-l lib ...] hierarchy" 1>&2
|
||||
echo " $0 -Q [-x lib ...] [-L libdir ...] [-l lib ...] project.pro" 1>&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
|
||||
excluded()
|
||||
{
|
||||
[ "`eval echo \\\$exclude_\`sanitize \"$1\"\``" ]
|
||||
}
|
||||
|
||||
|
||||
scan_comp()
|
||||
{
|
||||
for n in "$@"; do
|
||||
excluded "$n" && continue
|
||||
sed '/^DEF ~\?/{s///;s/ .*//;p;};d' <$n >>_tmp2
|
||||
done
|
||||
}
|
||||
@ -30,6 +37,7 @@ scan_comp()
|
||||
scan_fped()
|
||||
{
|
||||
for n in "$@"; do
|
||||
excluded "$n" && continue
|
||||
fped -k $n - | sed '/^\$MODULE /s///p;d' >>_tmp2
|
||||
done
|
||||
}
|
||||
@ -42,6 +50,13 @@ scan_pro()
|
||||
done
|
||||
}
|
||||
|
||||
|
||||
sanitize()
|
||||
{
|
||||
basename "$1" .$ext | tr -d '\n' | tr -c 'A-Za-z0-9_[-]' _
|
||||
}
|
||||
|
||||
|
||||
trap "rm -f _tmp1 _tmp2" 0
|
||||
|
||||
if [ "$1" = -Q ]; then
|
||||
@ -72,6 +87,8 @@ while [ "$1" ]; do
|
||||
else
|
||||
scan_fped "$1"
|
||||
fi;;
|
||||
-x) shift
|
||||
eval exclude_`sanitize "$1"`=y;;
|
||||
-*) usage;;
|
||||
*) break;;
|
||||
esac
|
||||
|
Loading…
Reference in New Issue
Block a user