diff options
-rwxr-xr-x | util/list_yet_unsupported_chips.sh | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/util/list_yet_unsupported_chips.sh b/util/list_yet_unsupported_chips.sh new file mode 100755 index 0000000..3a4d1b8 --- /dev/null +++ b/util/list_yet_unsupported_chips.sh @@ -0,0 +1,23 @@ +#!/bin/sh + +scriptname=$(readlink -f "$0") 2>/dev/null +path=$(dirname "$scriptname")/.. 2>/dev/null +if [ ! -e "$path/flashchips.c" -o ! -e "$path/flashchips.h" ]; then + echo "Warning: could not calculate flashchips.[ch]'s directory. Trying current..." + path="." + if [ ! -e "$path/flashchips.c" -o ! -e "$path/flashchips.h" ]; then + echo "Nope, sorry!" + exit 1 + fi +fi + +chips=$(sed -re '/#define [A-Z]/ !d' -e '/_ID\s/d' -e 's/\s*#define\s+([[:alnum:]_]+)\s+.*/\1/' "$path/flashchips.h") +for c in $chips ; do + if ! grep "$c" "$path/flashchips.c" >/dev/null ; then + if [ -n "$1" ]; then + grep -o "$c.*" "$path/flashchips.h" + else + echo "$c" + fi + fi +done |