From jtjang@gcn.net.tw Mon Oct 18 00:54:03 1999
Return-Path: <jtjang@gcn.net.tw>
Received: from out.gcn.net.tw (out.gcn.net.tw [203.77.2.144])
	by hub.freebsd.org (Postfix) with ESMTP id 029D614C18
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 18 Oct 1999 00:53:52 -0700 (PDT)
	(envelope-from jtjang@gcn.net.tw)
Received: from phantom.at.home (host246.21062207.gcn.net.tw [210.62.207.246])
	by out.gcn.net.tw (8.8.8/8.8.8) with ESMTP id HAB16002
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 18 Oct 1999 07:53:50 GMT
Received: (from keith@localhost)
	by phantom.at.home (8.9.3/8.9.3) id PAA01035;
	Mon, 18 Oct 1999 15:52:30 GMT
	(envelope-from keith)
Message-Id: <199910181552.PAA01035@phantom.at.home>
Date: Mon, 18 Oct 1999 15:52:30 GMT
From: jtjang@gcn.net.tw
Reply-To: jtjang@gcn.net.tw
To: FreeBSD-gnats-submit@freebsd.org
Subject: Update chinese/moettf
X-Send-Pr-Version: 3.2

>Number:         14392
>Category:       ports
>Synopsis:       chinese/moettf has a bug when writing fonts.dir
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    foxfair
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 18 01:00:00 PDT 1999
>Closed-Date:    Tue Oct 19 00:58:53 PDT 1999
>Last-Modified:  Tue Oct 19 00:59:16 PDT 1999
>Originator:     Keith Jang
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
End user
>Environment:

FreeBSD 4.0-CURRENT #0: Mon Oct 18 14:57:45 GMT 1999
root@phantom.at.home:/usr/src/sys/compile/phantom  i386

>Description:

When /usr/X11R6/lib/X11/fonts/TrueType/fonts.dir is empty, moettf's
INSTALL script will incorrectly calculate the number of fonts.

>How-To-Repeat:

Remove all ports that install truetype fonts in
/usr/X11R6/lib/X11/fonts/TrueType

rm /usr/X11R6/lib/X11/fonts/TrueType/fonts.*

Install chinese/moettf, then you'll see that the first line of fonts.dir
is 11, not the supposed 12.

>Fix:

Please commit the following patch, thanks.

--- pkg/INSTALL.orig	Mon Oct 18 14:38:03 1999
+++ pkg/INSTALL	Mon Oct 18 14:41:54 1999
@@ -9,11 +9,18 @@
 echo "Updating fonts.dir & fonts.alias. This may take a while..."
 # Update fonts.dir
 touch fonts.dir
-sed -e '/-moe-/d' -e '/-twmoe-/d' fonts.dir > fonts.dir.tmp
+sed -e '/ -moe-/d' -e '/ -twmoe-/d' fonts.dir > fonts.dir.tmp
 # Add 12 new fonts
 numfonts=$(echo $(cat fonts.dir.tmp |wc -l) - 1 + 12 |bc)
-echo ${numfonts} > fonts.dir
-sed -e 1d fonts.dir.tmp >> fonts.dir
+if [ ${numfonts} -le 12 ]; then # fonts.dir.tmp is empty
+  echo 12 > fonts.dir
+else
+  echo ${numfonts} > fonts.dir
+  sed -e 1d fonts.dir.tmp >> fonts.dir
+fi
+rm -f fonts.dir.tmp
+
+# Write font information to fonts.dir
 for FAMILY in kai lishu sung
 do
   echo moe_${FAMILY}.ttf -twmoe-${FAMILY}-medium-r-normal--0-0-0-0-c-0-big5-0 >> fonts.dir
@@ -21,7 +28,6 @@
   echo ai=0.3:moe_${FAMILY}.ttf -twmoe-${FAMILY}-medium-i-normal--0-0-0-0-c-0-big5-0 >> fonts.dir
   echo ab=y:ai=0.3:moe_${FAMILY}.ttf -twmoe-${FAMILY}-bold-i-normal--0-0-0-0-c-0-big5-0 >> fonts.dir
 done
-rm -f fonts.dir.tmp
 
 # Update fonts.alias, font size ranges from 8 to 128.
 SIZE=8



>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports->foxfair 
Responsible-Changed-By: foxfair 
Responsible-Changed-When: Mon Oct 18 03:46:42 PDT 1999 
Responsible-Changed-Why:  
I'll do it. 
State-Changed-From-To: open->closed 
State-Changed-By: foxfair 
State-Changed-When: Tue Oct 19 00:58:53 PDT 1999 
State-Changed-Why:  
Path committed, thank! 

>Unformatted:
