diff options
author | sf <sf@FreeBSD.org> | 2004-11-10 06:20:56 +0800 |
---|---|---|
committer | sf <sf@FreeBSD.org> | 2004-11-10 06:20:56 +0800 |
commit | 14b547e3de2f6851d333fe2e31107de2d4cf9b3a (patch) | |
tree | 5483b146b3793ca739fc3828a67c43359edd2890 /japanese/font-mplus/pkg-req | |
parent | 06855431d1d61faee601240b8204b479fa5c35c3 (diff) | |
download | freebsd-ports-gnome-14b547e3de2f6851d333fe2e31107de2d4cf9b3a.tar.gz freebsd-ports-gnome-14b547e3de2f6851d333fe2e31107de2d4cf9b3a.tar.zst freebsd-ports-gnome-14b547e3de2f6851d333fe2e31107de2d4cf9b3a.zip |
replace time-consuming grep -v with awk.
in example, deinstalling time of ja-shinonome is 332x faster than before.
Diffstat (limited to 'japanese/font-mplus/pkg-req')
-rw-r--r-- | japanese/font-mplus/pkg-req | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/japanese/font-mplus/pkg-req b/japanese/font-mplus/pkg-req index 955584858ec3..db7c015cbf8b 100644 --- a/japanese/font-mplus/pkg-req +++ b/japanese/font-mplus/pkg-req @@ -19,6 +19,10 @@ if [ "$2x" = "INSTALLx" -a ! -d ${FONTDIR} ]; then mkdir ${FONTDIR} fi +grepv() { + awk -v SRC=$1 'BEGIN{while (getline < SRC) {ENTRY[$0]=1}} (ENTRY[$0] != 1) {print}' $2 +} + if [ "$2" = "DEINSTALL" ] ; then # font alias entry here! TMPFILE=/tmp/install-fonts-alias-$$ @@ -29,7 +33,7 @@ if [ "$2" = "DEINSTALL" ] ; then cd ${FONTDIR} touch fonts.alias cp fonts.alias fonts.alias.orig - grep -v -e "`cat ${TMPFILE}`" fonts.alias.orig > fonts.alias + grepv ${TMPFILE} fonts.alias.orig > fonts.alias rm -f fonts.alias.orig ${TMPFILE} fi |