diff options
author | FUJISHIMA Satsuki <sf@FreeBSD.org> | 2004-11-10 06:20:56 +0800 |
---|---|---|
committer | FUJISHIMA Satsuki <sf@FreeBSD.org> | 2004-11-10 06:20:56 +0800 |
commit | cb6ac0edad665d2b0fb742ae689535755c3c5ffa (patch) | |
tree | 2b2924cdeefff222e82e23f423efec42526f4380 /japanese/shinonome | |
parent | b000f92b14566ced1f44d527e39115e350171cdd (diff) | |
download | freebsd-ports-gnome-cb6ac0edad665d2b0fb742ae689535755c3c5ffa.tar.gz freebsd-ports-gnome-cb6ac0edad665d2b0fb742ae689535755c3c5ffa.tar.zst freebsd-ports-gnome-cb6ac0edad665d2b0fb742ae689535755c3c5ffa.zip |
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-req | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/japanese/shinonome/pkg-req b/japanese/shinonome/pkg-req index 530a1f527213..59fb70886e11 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 |