Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Jul 2002 02:39:45 +0800 (CST)
From:      Kuang-che Wu <kcwu@kcwu.dyndns.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/40738: [Fix] chinese/dictd-database didn't handle cedict correctly
Message-ID:  <200207181839.g6IIdj223024@kcwu.dyndns.org>

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

>Number:         40738
>Category:       ports
>Synopsis:       [Fix] chinese/dictd-database didn't handle cedict correctly
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Jul 18 11:40:08 PDT 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 #2: Sat Apr 6 14:30:47 CST 2002 root@m722:/usr/obj/usr/src/sys/M722 i386


	
>Description:
	chinese/dictd-database didn't handle cedict correctly.
	For example, after install, you can see the cedict.* almost empty
        $ cd /usr/local/lib/dict; ls -l cedict.*
	-rw-r--r--  1 root  wheel  395 Mar  2 13:15 cedict.dict.dz
	-rw-r--r--  1 root  wheel   88 Mar  2 13:15 cedict.index
	
>How-To-Repeat:
	
>Fix:
diff -urN dictd-database.old/Makefile dictd-database/Makefile
--- dictd-database.old/Makefile	Fri Jul 19 02:17:43 2002
+++ dictd-database/Makefile	Fri Jul 19 02:19:06 2002
@@ -7,6 +7,7 @@
 
 PORTNAME=	dictd-database
 PORTVERSION=	1.2.1
+PORTREVISION=	1
 CATEGORIES=	chinese textproc
 MASTER_SITES=	ftp://freebsd.sinica.edu.tw/pub/statue/dictd-database/
 DISTNAME=	dict-zh-${PORTVERSION}
diff -urN dictd-database.old/files/patch-aa dictd-database/files/patch-aa
--- dictd-database.old/files/patch-aa	Fri Jul 19 02:17:43 2002
+++ dictd-database/files/patch-aa	Fri Jul 19 02:17:05 2002
@@ -1,5 +1,5 @@
---- Makefile.in.orig	Sun Apr  2 00:43:40 2000
-+++ Makefile.in	Sun Oct 14 10:52:13 2001
+--- Makefile.in.orig	Wed Nov 28 02:53:55 2001
++++ Makefile.in	Fri Jul 19 02:15:58 2002
 @@ -75,7 +75,7 @@
  		(cd $$subdir && $(MAKE)) || exit 1; \
  	done
@@ -8,3 +8,13 @@
 +all:: $(EXES) db
  
  db :: rawdata $(DATABASES)
+ 
+@@ -110,6 +110,8 @@
+ 	./dictfmt -p -u http://www.mandarintools.com/cedict.html \
+                 -s "Chinese to English dictionary" \
+                 cedict < data/cedict.txt ; \
++	env LANG=C sort cedict.index > cedict.index.tmp ; \
++	mv cedict.index.tmp cedict.index; \
+         if [ "$(DICTZIP)" != "cat" ]; then \
+                 dictzip cedict.dict; \
+         fi
diff -urN dictd-database.old/files/patch-make-rawdata.pl dictd-database/files/patch-make-rawdata.pl
--- dictd-database.old/files/patch-make-rawdata.pl	Thu Jan  1 08:00:00 1970
+++ dictd-database/files/patch-make-rawdata.pl	Fri Jul 19 02:05:22 2002
@@ -0,0 +1,26 @@
+--- make-rawdata.pl.orig	Fri Jul 19 02:04:15 2002
++++ make-rawdata.pl	Fri Jul 19 02:04:50 2002
+@@ -111,7 +111,7 @@
+ 
+ sub cedict {
+ 
+-	open ( FILE, "data/cedict.utf8") ;
++	open ( FILE, "data/cedict.b5") ;
+ 	@RawData = <FILE> ;
+ 	close (FILE) ;
+ 
+@@ -121,12 +121,12 @@
+ 	print TXT <<__END ;
+ %h 00-database-info
+ %d 
+-English to Chinese Dictionary º~­^¦r¨å
++Chinese to English Dictionary º~­^¦r¨å
+ CEDICT January 17, 2001; Copyright 2000-01
+ __END
+ 
+ 	foreach $data (@RawData) {
+-                $data =~ s/(.*) \[(.*)\] \/(.*)\//%h $1\n%d\n$3\n/g ;
++                $data =~ s/(.*) \[(.*)\] \/(.*)\//%h $1\n%d\n[$2]\n$3\n/g ;
+                 $data =~ s/\//\n/g ;
+                 print TXT $data ;
+         }

	


>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?200207181839.g6IIdj223024>