Speed this up by doing all the keywords in one pass. Also do all the keywords.

This commit is contained in:
christos 2005-04-29 14:53:35 +00:00
parent e0d963d34b
commit 593f5627da
1 changed files with 19 additions and 21 deletions

View File

@ -1,6 +1,6 @@
#! /bin/sh
#
# $NetBSD: gettext2netbsd,v 1.2 2000/10/31 15:00:07 itojun Exp $
# $NetBSD: gettext2netbsd,v 1.3 2005/04/29 14:53:35 christos Exp $
#
# Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
# All rights reserved.
@ -37,26 +37,24 @@
# gettext tree into netbsd.
# works on current directory.
### Remove the $'s around the Header:
find . -type f -print | grep -v CVS | grep -v gettext2netbsd | while read f; do
sed -e ' s/\$\(Header[^\$]*\) \$/\1/' < $f > /tmp/bind1f$$ && mv /tmp/bind1f$$ $f && \
echo removed Header tag from $f
done
dosed() {
sed -e 's/\$\(Author[^\$]*\) \$/\1/' \
-e 's/\$\(Date[^\$]*\) \$/\1/' \
-e 's/\$\(Header[^\$]*\) \$/\1/' \
-e 's/\$\(Id[^\$]*\) \$/\1/' \
-e 's/\$\(Locker[^\$]*\) \$/\1/' \
-e 's/\$\(Log[^\$]*\) \$/\1/' \
-e 's/\$\(Name[^\$]*\) \$/\1/' \
-e 's/\$\(RCSfile[^\$]*\) \$/\1/' \
-e 's/\$\(Revision[^\$]*\) \$/\1/' \
-e 's/\$\(Source[^\$]*\) \$/\1/' \
-e 's/\$\(State[^\$]*\) \$/\1/'
}
### Remove the $'s around the Id:
find . -type f -print | grep -v CVS | grep -v gettext2netbsd | while read f; do
sed -e ' s/\$\(Id[^\$]*\) \$/\1/' < $f > /tmp/bind1f$$ && mv /tmp/bind1f$$ $f && \
echo removed Id tag from $f
done
PROG=$(basename $0)
### Remove the $'s around the Date:
find . -type f -print | grep -v CVS | grep -v gettext2netbsd | while read f; do
sed -e ' s/\$\(Date[^\$]*\) \$/\1/' < $f > /tmp/bind1f$$ && mv /tmp/bind1f$$ $f && \
echo removed Date tag from $f
done
### Remove the $'s around the Revision:
find . -type f -print | grep -v CVS | grep -v gettext2netbsd | while read f; do
sed -e ' s/\$\(Revision[^\$]*\) \$/\1/' < $f > /tmp/bind1f$$ && mv /tmp/bind1f$$ $f && \
echo removed Revision tag from $f
find . -type f -print | grep -v CVS | grep -v gettext2netbsd |
while read f
do
dosed < $f > /tmp/$PROG$$ && mv /tmp/$PROG$$ $f
done