Module: check_mk
Branch: master
Commit: 6f981e1abb731f43cf9a6fecce8d05bf04e04dda
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6f981e1abb731f…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Nov 29 22:44:12 2011 +0100
headrify: handle css
---
doc/helpers/headrify | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/doc/helpers/headrify b/doc/helpers/headrify
index b4b9b86..62996a5 100755
--- a/doc/helpers/headrify
+++ b/doc/helpers/headrify
@@ -12,7 +12,7 @@ header ()
printf "|%-66s|\n" "${line//@/ }"
done
echo '| |'
- echo '| Copyright Mathias Kettner 2010 mk(a)mathias-kettner.de |'
+ echo '| Copyright Mathias Kettner 2012 mk(a)mathias-kettner.de |'
echo '+------------------------------------------------------------------+'
cat <<EOF
@@ -31,6 +31,10 @@ License along with GNU Make; see the file COPYING. If not, write
to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
Boston, MA 02110-1301 USA.
EOF
+ if [ -n "$lastline" ] ; then
+ echo
+ echo "$lastline"
+ fi
}
headrify ()
@@ -51,6 +55,7 @@ headrify ()
bangpath=""
case "${file##*/}" in
*.php) comment="# " ; bangpath="<?php"; ;;
+ *.css) comment="" ; bangpath="/*";
lastline="*/" ;;
*.h|*.c|*.cc|*.h.in|*.js) comment="// " ;;
*.conf|*.cfg) comment="# " ;;
*.spec|Makefile*) comment="# " ;;
@@ -67,10 +72,13 @@ headrify ()
secondline="$(sed -n 2p < $file)"
thirdline="$(sed -n 3p < $file)"
shouldbe="$comment+---------------------------------------------------"
+ endline='.*Boston, MA 02110-1301 USA.'
+
+ if [ -n "$lastline" ] ; then endline="${lastline//\//\/}" ; fi
if [ "${firstline:0:20}" = "${shouldbe:0:20}" \
-o "${secondline:0:20}" = "${shouldbe:0:20}" \
-o "${thirdline:0:20}" = "${shouldbe:0:20}" ] ; then
- sed '0,/^.*Boston, MA 02110-1301 USA.$/d' $file | sed 1d >> $TMP
+ sed '0,/^'"${endline//\*/\*}"'$/d' $file | sed 1d
>> $TMP
else
cat $file >> $TMP
fi