summaryrefslogtreecommitdiffstats
path: root/japanese
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
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')
-rw-r--r--japanese/elisa10x8/pkg-req8
-rw-r--r--japanese/elisa8x8/pkg-req8
-rw-r--r--japanese/font-mplus/pkg-req6
-rw-r--r--japanese/font-shinonome/pkg-req6
-rw-r--r--japanese/k10/pkg-req8
-rw-r--r--japanese/k12/pkg-req8
-rw-r--r--japanese/kanji18/pkg-req8
-rw-r--r--japanese/kanji26/pkg-req8
-rw-r--r--japanese/kappa20/pkg-req11
-rw-r--r--japanese/marumoji-fonts/pkg-req8
-rw-r--r--japanese/monafonts/pkg-req8
-rw-r--r--japanese/mplusfonts/pkg-req6
-rw-r--r--japanese/shinonome/pkg-req6
13 files changed, 75 insertions, 24 deletions
diff --git a/japanese/elisa10x8/pkg-req b/japanese/elisa10x8/pkg-req
index 7d965af..bc2c59f 100644
--- a/japanese/elisa10x8/pkg-req
+++ b/japanese/elisa10x8/pkg-req
@@ -18,6 +18,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}
@@ -30,10 +34,10 @@ cd ${FONTDIR}
touch fonts.alias ${TMPFILE}
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 -e "`cat ${TMPFILE}`" fonts.alias.orig > fonts.alias
+ grepv ${TMPFILE} fonts.alias.orig > fonts.alias
fi
rm -f fonts.alias.orig ${TMPFILE}
diff --git a/japanese/elisa8x8/pkg-req b/japanese/elisa8x8/pkg-req
index 9c2d05c..0b96fd0 100644
--- a/japanese/elisa8x8/pkg-req
+++ b/japanese/elisa8x8/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}
@@ -33,10 +37,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 -e "`cat ${TMPFILE}`" fonts.alias.orig > fonts.alias
+ grepv ${TMPFILE} fonts.alias.orig > fonts.alias
fi
rm -f fonts.alias.orig ${TMPFILE}
diff --git a/japanese/font-mplus/pkg-req b/japanese/font-mplus/pkg-req
index 9555848..db7c015 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
diff --git a/japanese/font-shinonome/pkg-req b/japanese/font-shinonome/pkg-req
index 530a1f5..59fb708 100644
--- a/japanese/font-shinonome/pkg-req
+++ b/japanese/font-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
diff --git a/japanese/k10/pkg-req b/japanese/k10/pkg-req
index d94579b..3fcd623 100644
--- a/japanese/k10/pkg-req
+++ b/japanese/k10/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}
@@ -41,10 +45,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 -e "`cat ${TMPFILE}`" fonts.alias.orig > fonts.alias
+ grepv ${TMPFILE} fonts.alias.orig > fonts.alias
fi
rm -f fonts.alias.orig ${TMPFILE}
diff --git a/japanese/k12/pkg-req b/japanese/k12/pkg-req
index 41e2482..737c711 100644
--- a/japanese/k12/pkg-req
+++ b/japanese/k12/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}
@@ -33,10 +37,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 -e "`cat ${TMPFILE}`" fonts.alias.orig > fonts.alias
+ grepv ${TMPFILE} fonts.alias.orig > fonts.alias
fi
rm -f fonts.alias.orig ${TMPFILE}
diff --git a/japanese/kanji18/pkg-req b/japanese/kanji18/pkg-req
index c9dab0d..e43ec52 100644
--- a/japanese/kanji18/pkg-req
+++ b/japanese/kanji18/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}
@@ -45,10 +49,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}
diff --git a/japanese/kanji26/pkg-req b/japanese/kanji26/pkg-req
index fd4faa7..e1fec99 100644
--- a/japanese/kanji26/pkg-req
+++ b/japanese/kanji26/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}
@@ -45,10 +49,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}
diff --git a/japanese/kappa20/pkg-req b/japanese/kappa20/pkg-req
index d856ce2..20532a9 100644
--- a/japanese/kappa20/pkg-req
+++ b/japanese/kappa20/pkg-req
@@ -19,15 +19,18 @@ 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
- TMPFILE=/tmp/install-fonts-alias-$$
- cat ${PKG_PREFIX}/share/doc/ja/k20fonts/fonts.alias > ${TMPFILE}
+ FAFILE=${PKG_PREFIX}/share/doc/ja/k20fonts/fonts.alias
echo "Updating ${FONTDIR}/fonts.alias"
cd ${FONTDIR}
touch fonts.alias
cp fonts.alias fonts.alias.orig
- grep -v -- "`cat ${TMPFILE}`" fonts.alias.orig > fonts.alias
- rm -f fonts.alias.orig ${TMPFILE}
+ grepv ${FAFILE} fonts.alias.orig > fonts.alias
+ rm -f fonts.alias.orig
fi
echo "**********************************************************"
diff --git a/japanese/marumoji-fonts/pkg-req b/japanese/marumoji-fonts/pkg-req
index dfaf8fb..ee2393c 100644
--- a/japanese/marumoji-fonts/pkg-req
+++ b/japanese/marumoji-fonts/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}
@@ -47,10 +51,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}
diff --git a/japanese/monafonts/pkg-req b/japanese/monafonts/pkg-req
index 4e87bda..ca85137 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}
diff --git a/japanese/mplusfonts/pkg-req b/japanese/mplusfonts/pkg-req
index 9555848..db7c015 100644
--- a/japanese/mplusfonts/pkg-req
+++ b/japanese/mplusfonts/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
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