summaryrefslogtreecommitdiff
path: root/japanese/monafonts
diff options
context:
space:
mode:
authorFUJISHIMA Satsuki <sf@FreeBSD.org>2004-11-09 22:20:56 +0000
committerFUJISHIMA Satsuki <sf@FreeBSD.org>2004-11-09 22:20:56 +0000
commitcb6ac0edad665d2b0fb742ae689535755c3c5ffa (patch)
tree2b2924cdeefff222e82e23f423efec42526f4380 /japanese/monafonts
parent- Update to 2.0.2 (diff)
replace time-consuming grep -v with awk.
in example, deinstalling time of ja-shinonome is 332x faster than before.
Notes
Notes: svn path=/head/; revision=121232
Diffstat (limited to 'japanese/monafonts')
-rw-r--r--japanese/monafonts/pkg-req8
1 files changed, 6 insertions, 2 deletions
diff --git a/japanese/monafonts/pkg-req b/japanese/monafonts/pkg-req
index 4e87bda1efde..ca85137d6b48 100644
--- a/japanese/monafonts/pkg-req
+++ b/japanese/monafonts/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
+}
+
# font alias entry here!
TMPFILE=/tmp/install-fonts-alias-$$
cat << EOF > ${TMPFILE}
@@ -85,10 +89,10 @@ cd ${FONTDIR}
touch fonts.alias
cp fonts.alias fonts.alias.orig
if [ "$2" = "INSTALL" ] ; then
- (grep -v -e "`cat ${TMPFILE}`" fonts.alias.orig ; \
+ (grepv ${TMPFILE} fonts.alias.orig ; \
cat ${TMPFILE}) > fonts.alias
elif [ "$2" = "DEINSTALL" ] ; then
- grep -v -- "`cat ${TMPFILE}`" fonts.alias.orig > fonts.alias
+ grepv ${TMPFILE} fonts.alias.orig > fonts.alias
fi
rm -f fonts.alias.orig ${TMPFILE}