summaryrefslogtreecommitdiffstats
path: root/japanese/shinonome
diff options
context:
space:
mode:
authorsf <sf@FreeBSD.org>2004-11-09 22:20:56 +0000
committersf <sf@FreeBSD.org>2004-11-09 22:20:56 +0000
commit14b547e3de2f6851d333fe2e31107de2d4cf9b3a (patch)
tree5483b146b3793ca739fc3828a67c43359edd2890 /japanese/shinonome
parent06855431d1d61faee601240b8204b479fa5c35c3 (diff)
downloadFreeBSD-ports-14b547e3de2f6851d333fe2e31107de2d4cf9b3a.zip
FreeBSD-ports-14b547e3de2f6851d333fe2e31107de2d4cf9b3a.tar.gz
replace time-consuming grep -v with awk.
in example, deinstalling time of ja-shinonome is 332x faster than before.
Diffstat (limited to 'japanese/shinonome')
-rw-r--r--japanese/shinonome/pkg-req6
1 files changed, 5 insertions, 1 deletions
diff --git a/japanese/shinonome/pkg-req b/japanese/shinonome/pkg-req
index 530a1f5..59fb708 100644
--- a/japanese/shinonome/pkg-req
+++ b/japanese/shinonome/pkg-req
@@ -22,12 +22,16 @@ fi
# font alias entry here!
FONTS_ALIAS=${PKG_PREFIX}/share/doc/shinonome/fonts.alias
+grepv() {
+ awk -v SRC=$1 'BEGIN{while (getline < SRC) {ENTRY[$0]=1}} (ENTRY[$0] != 1) {print}' $2
+}
+
if [ "$2" = "DEINSTALL" ] ; then
echo "Updating ${FONTDIR}/fonts.alias"
cd ${FONTDIR}
touch fonts.alias
cp fonts.alias fonts.alias.orig
- grep -v -- "`cat ${FONTS_ALIAS}`" fonts.alias.orig > fonts.alias
+ grepv ${FONTS_ALIAS} fonts.alias.orig > fonts.alias
rm -f fonts.alias.orig
fi
OpenPOWER on IntegriCloud