From f9586e3b44e97308650f3176b4a5e36c103656e3 Mon Sep 17 00:00:00 2001 From: skarg Date: Sun, 28 Oct 2007 13:26:10 +0000 Subject: [PATCH] Fixing scripts. --- bacnet-stack/comment.sh | 16 ++++++++-------- bacnet-stack/fixup.sh | 25 +++++++++++++++++++++++++ bacnet-stack/indent.sh | 2 +- 3 files changed, 34 insertions(+), 9 deletions(-) create mode 100755 bacnet-stack/fixup.sh diff --git a/bacnet-stack/comment.sh b/bacnet-stack/comment.sh index edce137b..539c8a0e 100755 --- a/bacnet-stack/comment.sh +++ b/bacnet-stack/comment.sh @@ -6,17 +6,17 @@ [ -x /usr/bin/ccmtcnvt ] || exit 0 directory=${1-`pwd`} -for filename in $( find $directory -name '*.c' ) +for filename in $( find ${directory} -name '*.c' ) do - echo Converting $filename - /usr/bin/ccmtcnvt $filename > /tmp/ccmtcnvt.karg - mv /tmp/ccmtcnvt.karg $filename + echo Converting ${filename} + /usr/bin/ccmtcnvt ${filename} > /tmp/ccmtcnvt.karg + mv /tmp/ccmtcnvt.karg ${filename} done -for filename in $( find $directory -name '*.h' ) +for filename in $( find ${directory} -name '*.h' ) do - echo Converting $filename - /usr/bin/ccmtcnvt $filename > /tmp/ccmtcnvt.karg - mv /tmp/ccmtcnvt.karg $filename + echo Converting ${filename} + /usr/bin/ccmtcnvt ${filename} > /tmp/ccmtcnvt.karg + mv /tmp/ccmtcnvt.karg ${filename} done diff --git a/bacnet-stack/fixup.sh b/bacnet-stack/fixup.sh new file mode 100755 index 00000000..43dbdd99 --- /dev/null +++ b/bacnet-stack/fixup.sh @@ -0,0 +1,25 @@ +#!/bin/sh +# fix DOS/Unix names, and remove backup files + +# exit silently if utility is not installed +[ -x /usr/bin/dos2unix ] || exit 0 + +directory=${1-`pwd`} +for filename in $( find ${directory} -name '*.c' ) +do + echo Fixing DOS/Unix ${filename} + /usr/bin/dos2unix ${filename} +done + +for filename in $( find ${directory} -name '*.h' ) +do + echo Fixing DOS/Unix ${filename} + /usr/bin/dos2unix ${filename} +done + +for filename in $( find ${directory} -name '*~' ) +do + echo Removing backup ${filename} + rm ${filename} +done + diff --git a/bacnet-stack/indent.sh b/bacnet-stack/indent.sh index d1ec15ec..9ee22d9c 100755 --- a/bacnet-stack/indent.sh +++ b/bacnet-stack/indent.sh @@ -1,6 +1,6 @@ #!/bin/sh # indent uses a local indent.pro file if it exists - +# File must be in consistent unix format before indenting # exit silently if utility is not installed [ -x /usr/bin/indent ] || exit 0 [ -x /usr/bin/dos2unix ] || exit 0