2012-04-18 04:18:55 +03:00
|
|
|
#!/bin/sh -e
|
|
|
|
#
|
2012-07-13 01:17:59 +03:00
|
|
|
# missing-in-tree - List items present in libraries but not in the tree
|
2012-04-18 04:18:55 +03:00
|
|
|
#
|
|
|
|
# Copyright 2012 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
|
|
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
usage()
|
|
|
|
{
|
2012-07-13 01:17:59 +03:00
|
|
|
echo "usage: $0 [-F] [-L libdir ...] [-l lib ...] hierarchy" 1>&2
|
2012-04-18 04:18:55 +03:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-07-13 01:17:59 +03:00
|
|
|
scan_comp()
|
2012-04-18 04:18:55 +03:00
|
|
|
{
|
|
|
|
for n in "$@"; do
|
|
|
|
sed '/^DEF ~\?/{s///;s/ .*//;p;};d' <$n >>_tmp2
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-07-13 01:17:59 +03:00
|
|
|
scan_fped()
|
|
|
|
{
|
|
|
|
for n in "$@"; do
|
|
|
|
fped -k $n - | sed '/^\$MODULE /s///p;d' >>_tmp2
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-04-18 04:18:55 +03:00
|
|
|
trap "rm -f _tmp1 _tmp2" 0
|
|
|
|
|
2012-07-13 01:16:09 +03:00
|
|
|
gencat -D "$@" >_tmp1 || exit
|
2012-04-18 04:18:55 +03:00
|
|
|
|
2012-07-13 01:17:59 +03:00
|
|
|
ext=.lib
|
|
|
|
|
2012-04-18 04:18:55 +03:00
|
|
|
>_tmp2
|
|
|
|
while [ "$1" ]; do
|
|
|
|
case "$1" in
|
2012-07-13 01:17:59 +03:00
|
|
|
-F) ext=.fpd;;
|
2012-04-18 04:18:55 +03:00
|
|
|
-L) shift
|
2012-07-13 01:17:59 +03:00
|
|
|
[ "`echo \"$1\"/*.$ext`" = "$1/*.$ext" ] ||
|
|
|
|
scan_lib "$1"/*.$ext;;
|
2012-04-18 04:18:55 +03:00
|
|
|
-l) shift
|
2012-07-13 01:17:59 +03:00
|
|
|
if [ $ext = .lib ]; then
|
|
|
|
scan_comp "$1"
|
|
|
|
else
|
|
|
|
scan_fped "$1"
|
|
|
|
fi;;
|
2012-04-18 04:18:55 +03:00
|
|
|
-*) usage;;
|
|
|
|
*) break;;
|
|
|
|
esac
|
|
|
|
shift
|
|
|
|
done
|
|
|
|
|
|
|
|
[ "$1" ] || usage
|
|
|
|
[ -z "$2" ] || usage
|
|
|
|
|
|
|
|
cat _tmp1 _tmp1 _tmp2 | sort | uniq -u
|
|
|
|
|
|
|
|
exit 0
|