OBS User unknown 2007-07-21 16:03:50 +00:00 committed by Git OBS Bridge
parent 33607dc5bf
commit 45162b17e0
4 changed files with 102 additions and 13 deletions

90
man-db-2.4.3-chinese.dif Normal file
View File

@ -0,0 +1,90 @@
--- src/encodings.c
+++ src/encodings.c 2007-07-19 14:21:02.681951968 +0200
@@ -106,6 +106,8 @@ static struct directory_entry directory_
{ "cs", "ISO-8859-2", "ISO-8859-2" }, /* Czech */
{ "hr", "ISO-8859-2", "ISO-8859-2" }, /* Croatian */
{ "hu", "ISO-8859-2", "ISO-8859-2" }, /* Hungarian */
+ { "zh", "GB18030", "GB18030" }, /* Simiplfy Chinese */
+ { "tw", "BIG5", "BIG5" }, /* Tradition Chinese */
{ "ja", "EUC-JP", "EUC-JP" }, /* Japanese */
{ "ko", "EUC-KR", "EUC-KR" }, /* Korean */
{ "pl", "ISO-8859-2", "ISO-8859-2" }, /* Polish */
@@ -136,6 +138,8 @@ static struct charset_entry charset_tabl
#ifdef MULTIBYTE_GROFF
{ "EUC-JP", "nippon" },
+ { "GB18030", "nippon" },
+ { "BIG5", "nippon" },
#endif /* MULTIBYTE_GROFF */
{ NULL, NULL }
@@ -170,7 +174,7 @@ static struct device_entry device_table[
#ifdef MULTIBYTE_GROFF
{ "ascii8", NULL, NULL },
- { "nippon", "EUC-JP", "EUC-JP" },
+ { "nippon", NULL, NULL },
#endif /* MULTIBYTE_GROFF */
{ NULL, NULL, NULL }
@@ -193,6 +197,7 @@ static struct less_charset_entry less_ch
{ "UTF-8", "utf-8" },
#ifdef MULTIBYTE_GROFF
+ { "GB18030", "zh" },
{ "EUC-JP", "ja" },
{ "KOI8-R", "koi8-r" },
#endif /* MULTIBYTE_GROFF */
@@ -283,6 +288,13 @@ char *get_page_encoding (const char *lan
* roff encoding = UTF-8
* output encoding = UTF-8
* EUC-JP -> iconv -> UTF-8 -> groff -Tutf8 -> UTF-8
+ *
+ * /usr/share/man/zh_CN.GB18030, locale zh_CN.UTF-8
+ * page encoding = GB18030
+ * source encoding = GB18030
+ * roff encoding = UTF-8
+ * output encoding = UTF-8
+ * EUC-JP -> iconv -> UTF-8 -> groff -Tutf8 -> UTF-8
*/
const char *get_source_encoding (const char *lang)
{
@@ -386,10 +398,13 @@ static int compatible_encodings (const c
return 1;
#ifdef MULTIBYTE_GROFF
- /* Special case for ja_JP.UTF-8, which takes UTF-8 input recoded
- * from EUC-JP and produces UTF-8 output. This is rather filthy.
+ /* Special case for ja_JP.UTF-8 zh_CN.UTF-8 and zh_TW.UTF8, which
+ * takes UTF-8 input recoded from EUC-JP and produces UTF-8 output.
+ * This is rather filthy.
*/
- if (STREQ (input, "EUC-JP") && STREQ (output, "UTF-8"))
+ if ((STREQ (input, "EUC-JP") || STREQ (input, "BIG5") ||
+ STREQ (input, "GB18030") || STREQ (input, "GBK")) &&
+ STREQ (output, "UTF-8"))
return 1;
#endif /* MULTIBYTE_GROFF */
@@ -449,13 +464,17 @@ const char *get_roff_encoding (const cha
#ifdef MULTIBYTE_GROFF
/* An ugly special case is needed here. The utf8 device normally
* takes ISO-8859-1 input. However, with the multibyte patch, when
- * recoding from EUC-JP it takes UTF-8 input instead. This is evil,
- * but there's not much that can be done about it apart from waiting
- * for groff 2.0.
+ * recoding from EUC-JP, GB18030 or BIG5 it takes UTF-8 input
+ * instead. This is evil, but there's not much that can be done
+ * about it apart from waiting for groff 2.0.
+ *
*/
if (STREQ (device, "utf8")) {
const char *ctype = setlocale (LC_CTYPE, NULL);
- if (STREQ (ctype, "ja_JP.UTF-8"))
+ if (STREQ (ctype, "ja_JP.UTF-8") ||
+ STREQ (ctype, "zh_CN.UTF-8") ||
+ STREQ (ctype, "zh_SG.UTF-8") ||
+ STREQ (ctype, "zh_TW.UTF-8"))
roff_encoding = "UTF-8";
}
#endif /* MULTIBYTE_GROFF */

View File

@ -1,6 +1,6 @@
--- .pkgextract
+++ .pkgextract 2007-02-15 00:00:00.000000000 +0100
@@ -0,0 +1,7 @@
@@ -0,0 +1,8 @@
+bzcat ../man-db-2.4.3-6.diff.bz2 | patch -p1 -s --suffix=.debian
+patch -p0 -s --suffix=.groff < ../man-db-2.3.19deb4.0-groff.dif
+patch -p0 -s --suffix=.err < ../man-db-2.4.1-error.dif
@ -8,6 +8,7 @@
+patch -p0 -s --suffix=.secu2 < ../man-db-2.4.1-security2.dif
+patch -p0 -s --suffix=.secu4 < ../man-db-2.4.1-security4.dif
+patch -p0 -s --suffix=.firefox< ../man-db-2.4.3-firefox.dif
+patch -p0 -s --suffix=.chinese< ../man-db-2.4.3-chinese.dif
--- GNUmakefile.in
+++ GNUmakefile.in 2007-02-15 00:00:00.000000000 +0100
@@ -35,7 +35,7 @@
@ -783,17 +784,6 @@
+}
+
#endif /* COMP_SRC */
--- src/encodings.c
+++ src/encodings.c 2007-02-15 00:00:00.000000000 +0100
@@ -112,7 +112,7 @@ static struct directory_entry directory_
{ "ru", "KOI8-R", "KOI8-R" }, /* Russian */
{ "sk", "ISO-8859-2", "ISO-8859-2" }, /* Slovak */
{ "tr", "ISO-8859-9", "ISO-8859-9" }, /* Turkish */
-#endif /* MULTIBYTE_GROFF */
+#endif /* !MULTIBYTE_GROFF */
{ NULL, NULL, "NULL" }
};
--- src/fake_security.c
+++ src/fake_security.c 2007-02-15 00:00:00.000000000 +0100
@@ -45,6 +45,7 @@ extern int errno;

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Jul 19 17:36:07 CEST 2007 - werner@suse.de
- Add Chinese support to man (bug #292412)
-------------------------------------------------------------------
Wed Jul 18 15:11:37 CEST 2007 - werner@suse.de

View File

@ -13,7 +13,7 @@
Name: man
BuildRequires: flex gdbm-devel groff less libbz2-devel libzio-devel zlib-devel
Version: 2.4.3
Release: 66
Release: 67
Summary: A Program for Displaying man Pages
License: GPL v2 or later
Group: System/Base
@ -33,6 +33,7 @@ Patch4: man-db-%{version}-section.dif
Patch5: man-db-2.4.1-security2.dif
Patch6: man-db-2.4.1-security4.dif
Patch7: man-db-2.4.3-firefox.dif
Patch8: man-db-2.4.3-chinese.dif
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
@ -54,6 +55,7 @@ Authors:
%patch5 -p0 -b .secu2
%patch6 -p0 -b .secu4
%patch7 -p0 -b .firefox
%patch8 -p0 -b .chinese
%patch -p0
%build
@ -156,6 +158,8 @@ test -d var/catman/ && rm -rf var/catman/ || true
/var/adm/fillup-templates/sysconfig.cron-man
%changelog
* Thu Jul 19 2007 - werner@suse.de
- Add Chinese support to man (bug #292412)
* Wed Jul 18 2007 - werner@suse.de
- Add workaround for html browsers which do their job in
background: do not remove the temporary files to fast (#280613)