summaryrefslogtreecommitdiff
path: root/inputmethod
diff options
context:
space:
mode:
authorhiramatsu <hiramatsu@pkgsrc.org>2013-03-10 18:53:31 +0000
committerhiramatsu <hiramatsu@pkgsrc.org>2013-03-10 18:53:31 +0000
commit6701634c5b64163906c9155b3552f4b810b40659 (patch)
tree7fe191d1e6efe7230afd9835f35758af996c1148 /inputmethod
parent529963e3c10660cd84865a3e86413b234b9ca4b4 (diff)
downloadpkgsrc-6701634c5b64163906c9155b3552f4b810b40659.tar.gz
- Ignore dictionary entries which cause skkserv not to start.
Diff is taken from FreeBSD ports. - Combine patch-af and patch-bsearch into single file, because those are diff files for the same file. - Add LICENSE.
Diffstat (limited to 'inputmethod')
-rw-r--r--inputmethod/skkserv/Makefile5
-rw-r--r--inputmethod/skkserv/distinfo5
-rw-r--r--inputmethod/skkserv/patches/patch-bsearch110
-rw-r--r--inputmethod/skkserv/patches/patch-skkserv_skkserv.c (renamed from inputmethod/skkserv/patches/patch-af)141
4 files changed, 129 insertions, 132 deletions
diff --git a/inputmethod/skkserv/Makefile b/inputmethod/skkserv/Makefile
index 82ee1139564..b58646131fe 100644
--- a/inputmethod/skkserv/Makefile
+++ b/inputmethod/skkserv/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.23 2012/10/06 14:25:19 asau Exp $
+# $NetBSD: Makefile,v 1.24 2013/03/10 18:53:31 hiramatsu Exp $
DISTNAME= skk9.6
PKGNAME= skkserv-3.9.4
@@ -9,10 +9,11 @@ MASTER_SITES= ftp://skk.kuis.kyoto-u.ac.jp/skk/9.6/
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://skk.kuis.kyoto-u.ac.jp/
COMMENT= Dictionary server for Simple Kana-Kanji conversion programs
+LICENSE= gnu-gpl-v2
DEPENDS= skk-jisyo>=200708:../../inputmethod/skk-jisyo
-WRKSRC= ${WRKDIR}/skk-9.6
+WRKSRC= ${WRKDIR}/skk-9.6
BUILD_DEFS+= IPV6_READY
diff --git a/inputmethod/skkserv/distinfo b/inputmethod/skkserv/distinfo
index 83ea75db5ca..89b5ab8b505 100644
--- a/inputmethod/skkserv/distinfo
+++ b/inputmethod/skkserv/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.5 2010/07/17 08:57:18 obache Exp $
+$NetBSD: distinfo,v 1.6 2013/03/10 18:53:31 hiramatsu Exp $
SHA1 (skk/skk9.6.tar.gz) = f462b4586dff6e36bfe331a526e054c3f6c3aad9
RMD160 (skk/skk9.6.tar.gz) = af182063e92f993cd2d9a69d7f89109ef0631526
@@ -7,6 +7,5 @@ SHA1 (patch-ab) = 5103484679c5d82a8d79460cc24e8857fc89460a
SHA1 (patch-ac) = 3a1818c3bb453b69eb23154ed0daa6909275774b
SHA1 (patch-ad) = 27abe12b627e8e5c5de0a78fab3a5f4551f3c0f7
SHA1 (patch-ae) = 356b3bab93365bb769a340b99979161f07f60de4
-SHA1 (patch-af) = 010ee51ad8b8e078fc14e7297fbcdf7259245014
SHA1 (patch-ai) = 38f6169507d12c500298cba555a57b77cafa19c4
-SHA1 (patch-bsearch) = 32a0ab43b6695e19748abed250dd0e1ad632260b
+SHA1 (patch-skkserv_skkserv.c) = eacd2ad95f1288301ef09d4b2dd9e73a7d3ef576
diff --git a/inputmethod/skkserv/patches/patch-bsearch b/inputmethod/skkserv/patches/patch-bsearch
deleted file mode 100644
index a01d719f1ed..00000000000
--- a/inputmethod/skkserv/patches/patch-bsearch
+++ /dev/null
@@ -1,110 +0,0 @@
-$NetBSD: patch-bsearch,v 1.2 2010/07/17 08:57:18 obache Exp $
-
---- skkserv/skkserv.c.orig 2010-07-16 09:36:31.000000000 +0000
-+++ skkserv/skkserv.c
-@@ -622,7 +622,7 @@ fd_set *rfds;
- }
-
- /*
-- * reply to client: linear search
-+ * reply to client: binary search
- */
-
- search(commsock)
-@@ -635,6 +635,7 @@ int commsock;
- int n; /* number of characters from client */
- int sttpnt; /* start point of searching */
- int endpnt; /* end point of searching */
-+ int curpnt; /* current point of searching */
- int errcod = 0; /* error flag */
- int sstyle; /* search style */
-
-@@ -743,18 +744,36 @@ int commsock;
- endpnt = jtab1[KANA_END - code + 1];
- }
- }
-- fseek(jisho, sttpnt, 0);
- if (debug)
-- fprintf(stderr, "from %d to %d\n", sttpnt, endpnt);
-+ fprintf(errout, "from %d to %d\n", sttpnt, endpnt);
-
-- while ((c = fgetc(jisho)) != EOF) {
-+ for (;;) {
-+ if ((sstyle & 0x4) == 0) { /* binary search? */
-+ curpnt = (sttpnt + endpnt) / 2;
-+ fseek(jisho, curpnt, 0);
-+ while ((c = fgetc(jisho)) != EOF) {
-+ curpnt++;
-+ if (c == EOL) break;
-+ }
-+ if (c == EOF) break;
-+ if (curpnt >= endpnt) {
-+ fseek(jisho, sttpnt, 0);
-+ sstyle |= 0x4; /* linear search */
-+ }
-+ }
-+
-+ if (debug) {fprintf(errout, "%d:%d\t%d\t%d\t", sstyle, sttpnt, curpnt, endpnt);}
-+ c = fgetc(jisho);
- pbuf = &combuf[1]; /* ' ' is end-symbol */
- while (c == *pbuf && c != ' ' && c != EOL) {
-- if (debug) {fprintf(errout, "1:%d:%d:%d:%d:\n", c, *pbuf, ' ', EOL);}
-+/* if (debug) {fprintf(errout, "1:%d:%d:%d:%d:", c, *pbuf, ' ', EOL);}*/
-+ if (debug) {fprintf(errout, "%c", c);}
- c = fgetc(jisho); pbuf++;
-- }
-- if (debug) {fprintf(errout, "1:%d:%d:%d:%d:\n", c, *pbuf, ' ', EOL);}
-+ }
-+/* if (debug) {fprintf(errout, "1:%d:%d:%d:%d:", c, *pbuf, ' ', EOL);}*/
-+ if (debug) {fprintf(errout, "%c", c);}
- if (c == ' ' && (*pbuf == ' ' || *pbuf == '\n')) { /* found */
-+ if (debug) {fprintf(errout, "found\n");}
- if ((errcod = write(commsock, SERVER_FOUND, 1)) >= 0)
- while ((c = fgetc(jisho)) != EOF) {
- *pbuf = c;
-@@ -770,18 +789,35 @@ int commsock;
- }
- return(0);
- }
-- if (comp(*pbuf, c, sstyle)) {
-- if (debug) {
-- fprintf(stderr, "comp break %d \n", ftell(jisho));
-- }
-- break;
-+ if (debug) {
-+ int ch;
-+
-+ if (c != ' ')
-+ do {
-+ ch = fgetc(jisho);
-+ fprintf(errout, "%c", ch);
-+ } while (ch != ' ' && ch != EOL);
-+ fprintf(errout, "unmatched\n");
- }
-- /* fix 1992/3/6 under suggestion */
-- /* of guchi@pfu.fujitsu.co.jp */
-- while ((c = fgetc(jisho)) != EOF) {
-- if (c == EOL) break;
-+ if (sstyle & 0x4) {
-+ if (comp(*pbuf, c, sstyle&~0x4)) {
-+ if (debug) {
-+ fprintf(stderr, "comp break %d \n", ftell(jisho));
-+ }
-+ break;
-+ }
-+ /* fix 1992/3/6 under suggestion */
-+ /* of guchi@pfu.fujitsu.co.jp */
-+ while ((c = fgetc(jisho)) != EOF) {
-+ if (c == EOL) break;
-+ }
-+ if (ftell(jisho) >= endpnt) break;
-+ } else {
-+ if (comp(*pbuf, c, sstyle&~0x4))
-+ endpnt = curpnt;
-+ else
-+ sttpnt = curpnt;
- }
-- if (ftell(jisho) >= endpnt) break;
- }
-
- if ((errcod = write(commsock, SERVER_NOT_FOUND, 1)) >= 0) {
diff --git a/inputmethod/skkserv/patches/patch-af b/inputmethod/skkserv/patches/patch-skkserv_skkserv.c
index 3be1d57e631..c0fe2713481 100644
--- a/inputmethod/skkserv/patches/patch-af
+++ b/inputmethod/skkserv/patches/patch-skkserv_skkserv.c
@@ -1,8 +1,10 @@
-$NetBSD: patch-af,v 1.2 2010/07/17 08:57:18 obache Exp $
+$NetBSD: patch-skkserv_skkserv.c,v 1.1 2013/03/10 18:53:32 hiramatsu Exp $
---- skkserv/skkserv.c.orig 1997-01-20 19:16:36.000000000 +0000
-+++ skkserv/skkserv.c
-@@ -100,8 +100,10 @@
+Add IPv6 support and binary search capability.
+
+--- skkserv/skkserv.c.orig 2013-03-11 01:53:23.000000000 +0900
++++ skkserv/skkserv.c 2013-03-11 01:53:24.000000000 +0900
+@@ -100,14 +100,16 @@
#define SERVER_NOT_FOUND "4"
#define SERVER_FULL "9"
@@ -14,7 +16,14 @@ $NetBSD: patch-af,v 1.2 2010/07/17 08:57:18 obache Exp $
/*
* Global Variables
-@@ -121,6 +123,9 @@ int format; /* 0 (old-style) / non-0 (n
+ */
+
+-char pgmver[] = "3.9.4 "; /* version number */
++char pgmver[] = "3.9.4nb7 (binary search) "; /* version number */
+
+ char *pgmnm; /* program name */
+ char *jname; /* name of shared dictionary */
+@@ -121,6 +123,9 @@
int jtab1[KANAMOJI]; /* index-table by 1st letter (1st part)*/
int jtab2[KANAMOJI]; /* index-table by 1st letter (2nd part)*/
int initsock; /* socket for waiting requests */
@@ -24,7 +33,7 @@ $NetBSD: patch-af,v 1.2 2010/07/17 08:57:18 obache Exp $
int clientsock[MAXCLNT]; /* socket for each client */
int nclients; /* max index for active clients */
-@@ -130,8 +135,18 @@ char *argv[];
+@@ -130,8 +135,18 @@
int parg;
int setjisho = 0;
int ctlterm; /* fildes for control terminal */
@@ -44,7 +53,7 @@ $NetBSD: patch-af,v 1.2 2010/07/17 08:57:18 obache Exp $
pgmnm = argv[0];
debug = 0;
errout = stderr;
-@@ -200,7 +215,10 @@ char *argv[];
+@@ -200,7 +215,10 @@
fclose(stderr);
/* detach child process from control terminal */
@@ -56,7 +65,7 @@ $NetBSD: patch-af,v 1.2 2010/07/17 08:57:18 obache Exp $
if ((ctlterm = open("/dev/tty", 2)) >= 0) {
ioctl(ctlterm, TIOCNOTTY, 0);
close(ctlterm);
-@@ -215,6 +233,7 @@ char *argv[];
+@@ -215,6 +233,7 @@
signal(SIGHUP, SIG_IGN);
if (fork() != 0) exit(0);
#endif
@@ -64,7 +73,7 @@ $NetBSD: patch-af,v 1.2 2010/07/17 08:57:18 obache Exp $
} else { /* debug mode */
fprintf(errout, "SKK-JISYO is %s\n", jname);
fflush(errout);
-@@ -222,7 +241,7 @@ char *argv[];
+@@ -222,7 +241,7 @@
if (errout != stderr) fclose(stderr);
}
@@ -73,7 +82,7 @@ $NetBSD: patch-af,v 1.2 2010/07/17 08:57:18 obache Exp $
/* 1993/6/5 by kam, re-read dictionary by "INT" signal */
nclients = 0;
-@@ -244,8 +263,11 @@ showusage()
+@@ -244,8 +263,11 @@
mksock()
{
struct sockaddr_in sin;
@@ -86,7 +95,7 @@ $NetBSD: patch-af,v 1.2 2010/07/17 08:57:18 obache Exp $
bzero((char*)&sin, sizeof(sin));
sin.sin_family = AF_INET;
-@@ -262,16 +284,54 @@ mksock()
+@@ -262,16 +284,54 @@
sin.sin_port = htons(portnum);
if ((initsock = socket(PF_INET, SOCK_STREAM, 0)) < 0)
@@ -147,7 +156,7 @@ $NetBSD: patch-af,v 1.2 2010/07/17 08:57:18 obache Exp $
fflush(errout);
}
}
-@@ -303,8 +363,19 @@ mkjtab()
+@@ -303,8 +363,19 @@
mkoldjtab(buf);
}
@@ -168,7 +177,18 @@ $NetBSD: patch-af,v 1.2 2010/07/17 08:57:18 obache Exp $
{
if (fclose(jisho) < 0) {
fprintf(stderr,
-@@ -455,15 +526,22 @@ mknewjtab()
+@@ -382,6 +453,10 @@
+ code = KANA_END;
+
+ while ((c = fgetc(jisho)) != EOF) {
++ if (c == '>') {
++ fgets(buf, BUFSIZE, jisho);
++ continue;
++ }
+ target = ((c & 0xff)<< 8) | (fgetc(jisho) & 0xff);
+ if (target == STRMARK) {
+ fgets(buf, BUFSIZE, jisho);
+@@ -455,15 +530,22 @@
main_loop()
{
fd_set readfds, writefds, exceptfds;
@@ -193,7 +213,7 @@ $NetBSD: patch-af,v 1.2 2010/07/17 08:57:18 obache Exp $
if (select(MAXDTAB, &readfds, &writefds, &exceptfds, NULL) < 0) {
if (errno == EINTR) /* if signal happens */
continue;
-@@ -474,16 +552,32 @@ main_loop()
+@@ -474,16 +556,32 @@
fflush(errout);
}
@@ -228,7 +248,7 @@ $NetBSD: patch-af,v 1.2 2010/07/17 08:57:18 obache Exp $
/* naiive scheduling */
for (i = 0; i < nclients; i ++)
-@@ -511,16 +605,20 @@ main_loop()
+@@ -511,20 +609,24 @@
* get bit pattern of read file descriptor
*/
@@ -255,7 +275,94 @@ $NetBSD: patch-af,v 1.2 2010/07/17 08:57:18 obache Exp $
}
/*
-@@ -724,6 +822,9 @@ set_hname()
+- * reply to client: linear search
++ * reply to client: binary search
+ */
+
+ search(commsock)
+@@ -537,6 +639,7 @@
+ int n; /* number of characters from client */
+ int sttpnt; /* start point of searching */
+ int endpnt; /* end point of searching */
++ int curpnt; /* current point of searching */
+ int errcod = 0; /* error flag */
+ int sstyle; /* search style */
+
+@@ -645,18 +748,36 @@
+ endpnt = jtab1[KANA_END - code + 1];
+ }
+ }
+- fseek(jisho, sttpnt, 0);
+ if (debug)
+- fprintf(stderr, "from %d to %d\n", sttpnt, endpnt);
++ fprintf(errout, "from %d to %d\n", sttpnt, endpnt);
+
++ for (;;) {
++ if ((sstyle & 0x4) == 0) { /* binary search? */
++ curpnt = (sttpnt + endpnt) / 2;
++ fseek(jisho, curpnt, 0);
+ while ((c = fgetc(jisho)) != EOF) {
++ curpnt++;
++ if (c == EOL) break;
++ }
++ if (c == EOF) break;
++ if (curpnt >= endpnt) {
++ fseek(jisho, sttpnt, 0);
++ sstyle |= 0x4; /* linear search */
++ }
++ }
++
++ if (debug) {fprintf(errout, "%d:%d\t%d\t%d\t", sstyle, sttpnt, curpnt, endpnt);}
++ c = fgetc(jisho);
+ pbuf = &combuf[1]; /* ' ' is end-symbol */
+ while (c == *pbuf && c != ' ' && c != EOL) {
+- if (debug) {fprintf(errout, "1:%d:%d:%d:%d:\n", c, *pbuf, ' ', EOL);}
++/* if (debug) {fprintf(errout, "1:%d:%d:%d:%d:", c, *pbuf, ' ', EOL);}*/
++ if (debug) {fprintf(errout, "%c", c);}
+ c = fgetc(jisho); pbuf++;
+ }
+- if (debug) {fprintf(errout, "1:%d:%d:%d:%d:\n", c, *pbuf, ' ', EOL);}
++/* if (debug) {fprintf(errout, "1:%d:%d:%d:%d:", c, *pbuf, ' ', EOL);}*/
++ if (debug) {fprintf(errout, "%c", c);}
+ if (c == ' ' && (*pbuf == ' ' || *pbuf == '\n')) { /* found */
++ if (debug) {fprintf(errout, "found\n");}
+ if ((errcod = write(commsock, SERVER_FOUND, 1)) >= 0)
+ while ((c = fgetc(jisho)) != EOF) {
+ *pbuf = c;
+@@ -672,7 +793,18 @@
+ }
+ return(0);
+ }
+- if (comp(*pbuf, c, sstyle)) {
++ if (debug) {
++ int ch;
++
++ if (c != ' ')
++ do {
++ ch = fgetc(jisho);
++ fprintf(errout, "%c", ch);
++ } while (ch != ' ' && ch != EOL);
++ fprintf(errout, "unmatched\n");
++ }
++ if (sstyle & 0x4) {
++ if (comp(*pbuf, c, sstyle&~0x4)) {
+ if (debug) {
+ fprintf(stderr, "comp break %d \n", ftell(jisho));
+ }
+@@ -684,6 +816,12 @@
+ if (c == EOL) break;
+ }
+ if (ftell(jisho) >= endpnt) break;
++ } else {
++ if (comp(*pbuf, c, sstyle&~0x4))
++ endpnt = curpnt;
++ else
++ sttpnt = curpnt;
++ }
+ }
+
+ if ((errcod = write(commsock, SERVER_NOT_FOUND, 1)) >= 0) {
+@@ -724,6 +862,9 @@
exit(1);
}
hentry = gethostbyname(hname);
@@ -265,7 +372,7 @@ $NetBSD: patch-af,v 1.2 2010/07/17 08:57:18 obache Exp $
#ifdef NO_ADDR_LIST
strcat(hname, ":");
strcat(hname, hentry->h_addr);
-@@ -736,6 +837,7 @@ set_hname()
+@@ -736,6 +877,7 @@
strcat(hname, inet_ntoa(*(struct in_addr *)*p++));
}
#endif