From 84f71b71ed4a1b8dd15b8eb43fcddcd80c81ff57 Mon Sep 17 00:00:00 2001 From: bernd Date: Wed, 28 Dec 2011 21:42:28 +0100 Subject: [PATCH] Added notification about dangling bridge files. --- simulat0r/bin/update-bridge-files.sh | 30 +++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/simulat0r/bin/update-bridge-files.sh b/simulat0r/bin/update-bridge-files.sh index c26b920..f726940 100755 --- a/simulat0r/bin/update-bridge-files.sh +++ b/simulat0r/bin/update-bridge-files.sh @@ -1,4 +1,5 @@ -#!/bin/sh +#!/bin/bash +#set -x verbmsg() { true @@ -33,6 +34,33 @@ do fi done +echo "Looking for dangling bridge files (i.e. the original file no longer exists)" +for i in `find simulat0r/firmware \! -path simulat0r/firmware/libc-unc0llide.h -type f -iname \*.[ch] | sed "s#simulat0r/##"` +do + if test -f $i; + then + verbmsg "OK File still exists: $i" + else +# echo Introspecting dangling bridge file simulat0r/$i + if cmp -s simulat0r/$i <(printf "/* AUTOGENERATED SOURCE FILE */\n"; echo \#include \"`dirname $i | sed "s#[^/]*#..#g" `/../$i\") ; + then + echo Dangling unchanged bridge file simulat0r/$i + SUGGESTDEL="$SUGGESTDEL simulat0r/$i" + else + echo Dangling modified bridge file simulat0r/$i + fi + fi +done +if test "$SUGGESTDEL"; +then + echo You might want to delete unneeded unmodified bridge files: + echo + echo rm $SUGGESTDEL + echo git rm $SUGGESTDEL + echo +fi + + echo "Updating bridge files for Makefiles" for i in `find firmware -type f -iname Makefile` do