Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 24 Nov 2002 02:17:24 +0800 (CST)
From:      Kuang-che Wu <kcwu@kcwu.dyndns.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/45651: fix build: chinese/dictd
Message-ID:  <200211231817.gANIHOGH022370@kcwu.dyndns.org>

next in thread | raw e-mail | index | archive | help

>Number:         45651
>Category:       ports
>Synopsis:       fix build: chinese/dictd
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Nov 23 10:20:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Kuang-che Wu
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD m722 5.0-CURRENT FreeBSD 5.0-CURRENT #0: Wed Oct 16 07:55:58 CST 2002 root@m722:/usr/obj/usr/src/sys/M722 i386


	
>Description:
	fix build problem and install `dictfmt'
	
	Note, two new files: files/patch-dictfmt.c and files/patch-Makefile.in
	
>How-To-Repeat:
	
>Fix:
diff -urN dictd.old/Makefile dictd/Makefile
--- dictd.old/Makefile	Sat Nov 23 23:11:43 2002
+++ dictd/Makefile	Sun Nov 24 02:09:10 2002
@@ -11,8 +11,17 @@
 
 MASTERDIR=	${.CURDIR}/../../net/dictd
 EXTRA_PATCHES=	${.CURDIR}/files/patch-index.c \
-		${.CURDIR}/files/patch-libmaa::arg.c
+		${.CURDIR}/files/patch-libmaa::arg.c \
+		${.CURDIR}/files/patch-dictfmt.c \
+		${.CURDIR}/files/patch-Makefile.in
+
+pre-install:
+	${ECHO} "bin/dictfmt" > ${PLIST}
+	${CAT} ${MASTERDIR}/pkg-plist >> ${PLIST}
 
 .include "${MASTERDIR}/Makefile"
 
 PKGNAMEPREFIX:=	${PKGNAMEPREFIX}tw-
+ALL_TARGET+=	dictfmt
+INSTALL_TARGET+=install.dictfmt
+PLIST=		${WRKDIR}/PLIST
diff -urN dictd.old/files/patch-Makefile.in dictd/files/patch-Makefile.in
--- dictd.old/files/patch-Makefile.in	Thu Jan  1 08:00:00 1970
+++ dictd/files/patch-Makefile.in	Sun Nov 24 02:02:03 2002
@@ -0,0 +1,10 @@
+--- Makefile.in.orig	Sun Nov 24 02:01:29 2002
++++ Makefile.in	Sun Nov 24 02:01:44 2002
+@@ -154,7 +154,6 @@
+ 	if test ! -d $(bindir); then $(INSTALL) -d 755 $(bindir); fi
+ 	if test ! -d $(man1_prefix); then $(INSTALL) -d 755 $(man1_prefix); fi
+ 	$(INSTALL_PROGRAM) dictfmt $(bindir)
+-	$(INSTALL_PROGRAM) dictfmt_index2suffix $(bindir)
+ 	$(INSTALL_DATA) dictfmt.1 $(man1_prefix)/dictfmt.1
+ 
+ install.dictd: dictd
diff -urN dictd.old/files/patch-dictfmt.c dictd/files/patch-dictfmt.c
--- dictd.old/files/patch-dictfmt.c	Thu Jan  1 08:00:00 1970
+++ dictd/files/patch-dictfmt.c	Sun Nov 24 01:42:08 2002
@@ -0,0 +1,15 @@
+--- dictfmt.c.orig	Sun Nov 24 01:25:09 2002
++++ dictfmt.c	Sun Nov 24 01:25:23 2002
+@@ -208,6 +208,12 @@
+ 
+    while (src && src [0]){
+       ch = *(const unsigned char *)src;
++      if((ch & 0x80) && *(src+1)) {
++	 *dest++ = ch;
++	 *dest++ = *(src+1);
++	 src+=2;
++	 continue;
++      }
+ 
+       if (isspace (ch)){
+ 	 *dest++ = ' ';
diff -urN dictd.old/files/patch-index.c dictd/files/patch-index.c
--- dictd.old/files/patch-index.c	Sat Nov 23 23:10:36 2002
+++ dictd/files/patch-index.c	Sun Nov 24 02:06:29 2002
@@ -1,8 +1,30 @@
---- index.c.orig	Mon Apr 29 22:43:42 2002
-+++ index.c	Fri Jul 19 05:23:01 2002
-@@ -120,6 +120,15 @@
-    
- 				/* FIXME.  Optimize this inner loop. */
+--- index.c.orig	Sun Nov 24 01:24:10 2002
++++ index.c	Sun Nov 24 01:24:21 2002
+@@ -91,6 +91,12 @@
+ 
+    for (; *src; ++src) {
+       c = * (const unsigned char *) src;
++      if((c & 0x80) && *(src+1)) {
++	 *dest++ = c;
++	 *dest++ = *(src+1);
++	 src++;
++	 continue;
++      }
+ 
+       if (isspace( c )) {
+          *dest++ = ' ';
+@@ -150,7 +156,7 @@
+     isspacealnumtab_allchars['\t'] = isspacealnumtab_allchars['\n'] = 0; /* special */
+ 
+     for (i = 0; i <= UCHAR_MAX; i++){
+-	if (islower (i) || (utf8_mode && i >= 0xC0))
++	if (islower (i) || (utf8_mode && i >= 0xC0) || (i>=0x80))
+ 	    chartab[charcount++] = i;
+     }
+ 
+@@ -317,6 +326,15 @@
+ 
+    /* FIXME.  Optimize this inner loop. */
     while (*word && start < end && *start != '\t') {
 +      if ((*start & 0x80) && start+1<end && start[1]!='\t') {
 +        if(start[0]!=word[0]) 
@@ -13,59 +35,15 @@
 +        start+=2;
 +        continue;
 +      }
-       if (!isspacealnum(*start)) {
+       if (!dbindex -> isspacealnum[* (const unsigned char *) start]) {
  	 ++start;
  	 continue;
-@@ -139,7 +148,11 @@
+@@ -359,6 +377,8 @@
+        *start != '\t' &&
+        !dbindex -> isspacealnum[* (const unsigned char *) start])
+    {
++      if((*start & 0x80) && start[1]!='\t')
++        break;
        ++start;
     }
-    
--   while (*start != '\t' && !isspacealnum(*start)) ++start;
-+   while (*start != '\t' && !isspacealnum(*start))
-+     if((*start & 0x80) && start[1]!='\t')
-+       break;
-+     else
-+       ++start;
- 
-    PRINTF(DBG_SEARCH,("   result = %d\n",
- 		      *word ? 1 : ((*start != '\t') ? -1 : 0)));
-@@ -315,7 +328,6 @@
-    int        count = 0;
-    dictWord   *datum;
-    const char *previous = NULL;
--   
-    while (pt && pt < database->index->end) {
-       if (!compare( word, pt, database->index->end )) {
- 	 if (!previous || altcompare(previous, pt, database->index->end)) {
-@@ -643,6 +655,7 @@
-    char       tmp;
-    dictWord   *datum;
- 
-+   if(*word & 0x80) return count;
- #define CHECK                                         \
-    if ((pt = dict_index_search(buf, database->index)) \
-        && !compare(buf, pt, database->index->end)) {  \
-@@ -724,6 +737,11 @@
-       if (isspace( *(const unsigned char *)w )) {
-          *pt++ = ' ';
-       } else {
-+         if((*w & 0x80) && *(w+1)) {
-+            *pt++=*w++;
-+            *pt++=*w;
-+            continue;
-+         }
-          if (!isalnum( *(const unsigned char *)w )) continue;
-          *pt++ = tolower(*w);
-       }
-@@ -790,6 +808,11 @@
- 	 = binary_search( buf, i->start, i->end );
-    }
-    for (j = '0'; j <= '9'; j++) {
-+      buf[0] = j;
-+      buf[1] = '\0';
-+      i->optStart[j] = binary_search( buf, i->start, i->end );
-+   }
-+   for (j = 0x80; j <= 255; j++) {
-       buf[0] = j;
-       buf[1] = '\0';
-       i->optStart[j] = binary_search( buf, i->start, i->end );
+ 

	


>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200211231817.gANIHOGH022370>