From 62df6c560eab1508e7baf5a767918154b745b97d Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Thu, 10 Sep 2009 19:42:35 +0000 Subject: 2009-09-10 Joel Sherrill * check_bsp: Clean up check_bsp. * Makefile: New file. --- merge-helpers/ChangeLog | 5 +++++ merge-helpers/Makefile | 20 ++++++++++++++++++++ merge-helpers/check_bsp | 36 +++++++++++++++++++++++++++++------- 3 files changed, 54 insertions(+), 7 deletions(-) create mode 100644 merge-helpers/Makefile (limited to 'merge-helpers') diff --git a/merge-helpers/ChangeLog b/merge-helpers/ChangeLog index 2c58dbb..48bcd66 100644 --- a/merge-helpers/ChangeLog +++ b/merge-helpers/ChangeLog @@ -1,3 +1,8 @@ +2009-09-10 Joel Sherrill + + * check_bsp: Clean up check_bsp. + * Makefile: New file. + 2009-09-10 Joel Sherrill * check_bsp: Fix comment. diff --git a/merge-helpers/Makefile b/merge-helpers/Makefile new file mode 100644 index 0000000..5f7a659 --- /dev/null +++ b/merge-helpers/Makefile @@ -0,0 +1,20 @@ +# +# $Id$ +# + +INSTALL_DIR=../bin +SCRIPTS=check_bsp + +all: prep ${SCRIPTS} install + +prep: + test -d ${INSTALL_DIR} || mkdir ${INSTALL_DIR} + +clean: + +install: + for i in ${SCRIPTS} ; do \ + cp $${i} ${INSTALL_DIR}/$${i} ; \ + chmod +x ${INSTALL_DIR}/$${i} ; \ + done + diff --git a/merge-helpers/check_bsp b/merge-helpers/check_bsp index f72008a..5ce6ce6 100755 --- a/merge-helpers/check_bsp +++ b/merge-helpers/check_bsp @@ -33,27 +33,33 @@ test_its_there() fi grep ${2} ${1} >/dev/null if [ $? -ne 0 ] ; then - echo ${2} is NOT in ${bspdir}/${1} + echo NOT in ${bspdir}/${1} fi } test_its_NOT_there() { - if [ $# -ne 2 ] ; then + if [ $# -lt 2 ] ; then echo Usage: $0 FILE pattern fi - grep ${2} ${1} >/dev/null + FILE=$1 + shift + grep "${*}" ${FILE} >/dev/null if [ $? -eq 0 ] ; then - echo ${2} SHOULD NOT BE IN ${bspdir}/${1} + echo SHOULD NOT BE IN ${bspdir}/${FILE} fi } -test_its_there configure.ac RTEMS_BSP_BOOTCARD_OPTIONS -test_its_there configure.ac RTEMS_BSP_CLEANUP_OPTIONS +if [ -r configure.ac ] ; then + echo "=== Checking for options in BSP configure.ac" + test_its_there configure.ac RTEMS_BSP_BOOTCARD_OPTIONS + test_its_there configure.ac RTEMS_BSP_CLEANUP_OPTIONS +fi # really need to make the copyright strings consistent in BSPs +echo "=== Checking for copyright notices" find . -name "*.[chS]" | while read f do grep -i COPYRIGHT ${f} >/dev/null @@ -63,15 +69,31 @@ do done # We want CVS Id strings everywhere possible +echo "=== Checking for CVS Id strings" find . -name "*.[chS]" -o -name "*.ac" -o -name "Makefile.am" | while read f do test_its_there ${f} "\$Id" done -# We do not want printf or puts in a BSP +# We do not want printf in a BSP +echo "=== Checking for printf" find . -name "*.[chS]" -o -name "*.ac" -o -name "Makefile.am" | while read f do test_its_NOT_there ${f} printf +done + +# We do not want puts in a BSP +echo "=== Checking for puts" +find . -name "*.[chS]" -o -name "*.ac" -o -name "Makefile.am" | while read f +do test_its_NOT_there ${f} puts done +# We do not want the reformatted license notice +echo "=== Checking for reformatted RTEMS license notices" +find . -name "*.[chS]" -o -name "*.ac" -o -name "Makefile.am" | while read f +do + test_its_NOT_there ${f} "this file may be found in the file" +done + +exit 0 -- cgit v1.2.3