From owner-p4-projects@FreeBSD.ORG Fri Aug 15 17:48:03 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 8B83B106567A; Fri, 15 Aug 2008 17:48:03 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4EA34106566C for ; Fri, 15 Aug 2008 17:48:03 +0000 (UTC) (envelope-from konrad@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 30B848FC18 for ; Fri, 15 Aug 2008 17:48:03 +0000 (UTC) (envelope-from konrad@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.2/8.14.2) with ESMTP id m7FHm3vI027648 for ; Fri, 15 Aug 2008 17:48:03 GMT (envelope-from konrad@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m7FHm3bB027646 for perforce@freebsd.org; Fri, 15 Aug 2008 17:48:03 GMT (envelope-from konrad@FreeBSD.org) Date: Fri, 15 Aug 2008 17:48:03 GMT Message-Id: <200808151748.m7FHm3bB027646@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to konrad@FreeBSD.org using -f From: Konrad Jankowski To: Perforce Change Reviews Cc: Subject: PERFORCE change 147477 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Aug 2008 17:48:03 -0000 http://perforce.freebsd.org/chv.cgi?CH=147477 Change 147477 by konrad@vspredator on 2008/08/15 17:47:05 Optimize getting the line numbers from source file, as suggested by Diomidis. Affected files ... .. //depot/projects/soc2008/konrad_collation/scripts/localedef.sh#3 edit .. //depot/projects/soc2008/konrad_collation/scripts/posix.sh#4 edit Differences ... ==== //depot/projects/soc2008/konrad_collation/scripts/localedef.sh#3 (text+ko) ==== @@ -14,11 +14,11 @@ OUTFILE=collate_in.src # Get the line numbers of starting and ending of the collation definition. -LINE1=`grep -n ^LC_COLLATE $SRC | awk -F : ' { print $1 } '` -LINE2=`grep -n "^END LC_COLLATE" $SRC | awk -F : ' { print $1 } '` +LINE1=`awk '/^LC_COLLATE/ { print FNR}' $SRC` +LINE2=`awk '/^END LC_COLLATE/ { print FNR}' $SRC` -# Process the input file with sed and save the output compressing spaces. -# Basically, just cut out the collation data. +# Cut out the collation data. Erase carriage return. +# Comment out lines starting with "*"; sed -n -e "$LINE1,${LINE2}p" $SRC | tr -d '\r$' | sed -e 's/^*/#/g' > $OUTFILE #printf "1a\ncharmap /usr/home/versus/colldef.apple/data2/UTF-8.cm.new\n.\nwq\n" | ed -s $OUTFILE ==== //depot/projects/soc2008/konrad_collation/scripts/posix.sh#4 (text+ko) ==== @@ -14,8 +14,8 @@ OUTFILE=colldef_in.src # Get the line numbers of starting and ending of the collation definition. -LINE1=`grep -n ^LC_COLLATE $SRC | awk -F : ' { print $1 } '` -LINE2=`grep -n "^END LC_COLLATE" $SRC | awk -F : ' { print $1 } '` +LINE1=`awk '/^LC_COLLATE/ { print FNR}' $SRC` +LINE2=`awk '/^END LC_COLLATE/ { print FNR}' $SRC` # Process the input file with ed and save the output compressing spaces. # Basically, just cut out the collation data.