瀏覽代碼

chapter05: Translate test suite tools

Xi Ruoyao 6 年之前
父節點
當前提交
1e76e8c049
共有 3 個文件被更改,包括 124 次插入70 次删除
  1. 14 12
      chapter05/dejagnu.xml
  2. 46 29
      chapter05/expect.xml
  3. 64 29
      chapter05/tcl.xml

+ 14 - 12
chapter05/dejagnu.xml

@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
   <!ENTITY % general-entities SYSTEM "../general.ent">
@@ -23,8 +23,9 @@
   <sect2 role="package">
     <title/>
 
-    <para>The DejaGNU package contains a framework for testing other
-    programs.</para>
+    <!--para>The DejaGNU package contains a framework for testing other
+    programs.</para-->
+    <para>DejaGNU 软件包包含用于测试其他程序的框架。</para>
 
     <segmentedlist>
       <segtitle>&buildtime;</segtitle>
@@ -39,17 +40,17 @@
   </sect2>
 
   <sect2 role="installation">
-    <title>Installation of DejaGNU</title>
+    <title>安装 DejaGNU</title>
 
-    <para>Prepare DejaGNU for compilation:</para>
+    <para>准备编译 DejaGNU:</para>
 
 <screen><userinput remap="configure">./configure --prefix=/tools</userinput></screen>
 
-    <para>Build and install the package:</para>
+    <para>构建并安装该软件包:</para>
 
 <screen><userinput remap="install">make install</userinput></screen>
 
-    <para>To test the results, issue:</para>
+    <para>如果要测试该软件包,执行:</para>
 
 <screen><userinput remap="test">make check</userinput></screen>
 
@@ -57,10 +58,10 @@
 
 
   <sect2 id="contents-dejagnu" role="content">
-    <title>Contents of DejaGNU</title>
+    <title>DejaGNU 的内容</title>
 
     <segmentedlist>
-      <segtitle>Installed program</segtitle>
+      <segtitle>安装的程序</segtitle>
 
       <seglistitem>
         <seg>runtest</seg>
@@ -68,15 +69,16 @@
     </segmentedlist>
 
     <variablelist>
-      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
+      <bridgehead renderas="sect3">简要描述</bridgehead>
       <?dbfo list-presentation="list"?>
       <?dbhtml list-presentation="table"?>
 
       <varlistentry id="runtest">
         <term><command>runtest</command></term>
         <listitem>
-          <para>A wrapper script that locates the proper
-          <command>expect</command> shell and then runs DejaGNU</para>
+          <para>一个寻找正确的
+			  <command>expect</command> shell,
+			  并运行 DejaGNU 的封装脚本。</para>
           <indexterm zone="ch-tools-dejagnu runtest">
             <primary sortas="b-runtest">runtest</primary>
           </indexterm>

+ 46 - 29
chapter05/expect.xml

@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
   <!ENTITY % general-entities SYSTEM "../general.ent">
@@ -23,8 +23,10 @@
   <sect2 role="package">
     <title/>
 
-    <para>The Expect package contains a program for carrying out scripted
-    dialogues with other interactive programs.</para>
+    <!--para>The Expect package contains a program for carrying out scripted
+    dialogues with other interactive programs.</para-->
+    <para>Expect 软件包包含一个根据脚本,与其他交互程序进行对话的程序。
+	</para>
 
     <segmentedlist>
       <segtitle>&buildtime;</segtitle>
@@ -39,73 +41,89 @@
   </sect2>
 
   <sect2 role="installation">
-    <title>Installation of Expect</title>
+    <title>安装 Expect</title>
 
-    <para>First, force Expect's configure script to use <filename>/bin/stty</filename>
+    <!--para>First, force Expect's configure script to use <filename>/bin/stty</filename>
     instead of a <filename>/usr/local/bin/stty</filename> it may find on the host system.
     This will ensure that our test suite tools remain sane for the final builds of our
-    toolchain:</para>
+    toolchain:</para-->
+    <para>首先强制 Expect 的配置脚本使用 <filename>/bin/stty</filename>,
+		而不是宿主系统上可能存在的
+		<filename>/usr/local/bin/stty</filename>,
+		以保证测试套件工具在最终构建工具链时仍然完整:</para>
 
 <screen><userinput remap="pre">cp -v configure{,.orig}
 sed 's:/usr/local/bin:/bin:' configure.orig &gt; configure</userinput></screen>
 
-    <para>Now prepare Expect for compilation:</para>
+    <para>现在准备编译 Expect:</para>
 
 <screen><userinput remap="configure">./configure --prefix=/tools       \
             --with-tcl=/tools/lib \
             --with-tclinclude=/tools/include</userinput></screen>
 
     <variablelist>
-      <title>The meaning of the configure options:</title>
+      <title>配置选项的含义:</title>
 
       <varlistentry>
         <term><parameter>--with-tcl=/tools/lib</parameter></term>
         <listitem>
-          <para>This ensures that the configure script finds the Tcl
+          <!--para>This ensures that the configure script finds the Tcl
           installation in the temporary tools location instead of possibly
-          locating an existing one on the host system.</para>
+          locating an existing one on the host system.</para-->
+	      <para>这保证配置脚本找到临时工具中的 Tcl 安装,
+			  而不是宿主系统中可能存在的 Tcl 安装。</para>
         </listitem>
       </varlistentry>
 
       <varlistentry>
         <term><parameter>--with-tclinclude=/tools/include</parameter></term>
         <listitem>
-          <para>This explicitly tells Expect where to find Tcl's internal
+          <!--para>This explicitly tells Expect where to find Tcl's internal
           headers. Using this option avoids conditions where
           <command>configure</command> fails because it cannot automatically
-          discover the location of Tcl's headers.</para>
+          discover the location of Tcl's headers.</para-->
+          <para>该选项明确告诉 Expect 去哪里寻找 Tcl 的内部头文件。
+			  使用该选项可以避免某些情况下 <command>configure</command>
+			  由于找不到 Tcl 头文件的位置而失败。</para>
         </listitem>
       </varlistentry>
 
     </variablelist>
 
-    <para>Build the package:</para>
+    <para>构建该软件包:</para>
 
 <screen><userinput remap="make">make</userinput></screen>
 
-    <para>Compilation is now complete. As discussed earlier, running the test
+    <!--para>Compilation is now complete. As discussed earlier, running the test
     suite is not mandatory for the temporary tools here in this chapter. To run
-    the Expect test suite anyway, issue the following command:</para>
+    the Expect test suite anyway, issue the following command:</para-->
+    <para>现在编译已经完成,正如之前所述,
+		并不需要运行本章中临时工具的测试套件。如果一定要运行 Expect
+		的测试套件,输入下列命令:</para>
 
 <screen><userinput remap="test">make test</userinput></screen>
 
-    <para>Note that the Expect test suite is known to experience failures under
+    <!--para>Note that the Expect test suite is known to experience failures under
     certain host conditions that are not within our control. Therefore,
     test suite failures here are not surprising and are not considered
-    critical.</para>
+    critical.</para-->
+    <para>注意,已经知道在特定宿主环境下 Expect 测试套件会失败。
+		我们无法控制宿主环境,因此这里的测试失败并不令人吃惊,
+		也不会造成严重问题。</para>
 
-    <para>Install the package:</para>
+    <para>安装该软件包:</para>
 
 <screen><userinput remap="install">make SCRIPTS="" install</userinput></screen>
 
     <variablelist>
-      <title>The meaning of the make parameter:</title>
+      <title>make 命令参数的含义:</title>
 
       <varlistentry>
         <term><parameter>SCRIPTS=""</parameter></term>
         <listitem>
-          <para>This prevents installation of the supplementary Expect
-          scripts, which are not needed.</para>
+          <!--para>This prevents installation of the supplementary Expect
+          scripts, which are not needed.</para-->
+	      <para>该选项使得一些不需要的 Expect 辅助脚本不被安装。</para>
         </listitem>
       </varlistentry>
 
@@ -114,11 +132,11 @@ sed 's:/usr/local/bin:/bin:' configure.orig &gt; configure</userinput></screen>
   </sect2>
 
   <sect2 id="contents-expect" role="content">
-    <title>Contents of Expect</title>
+    <title>Expect 的内容</title>
 
     <segmentedlist>
-      <segtitle>Installed program</segtitle>
-      <segtitle>Installed library</segtitle>
+      <segtitle>安装的程序</segtitle>
+      <segtitle>安装的库</segtitle>
 
       <seglistitem>
         <seg>expect</seg>
@@ -127,15 +145,14 @@ sed 's:/usr/local/bin:/bin:' configure.orig &gt; configure</userinput></screen>
     </segmentedlist>
 
     <variablelist>
-      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
+      <bridgehead renderas="sect3">简要描述</bridgehead>
       <?dbfo list-presentation="list"?>
       <?dbhtml list-presentation="table"?>
 
       <varlistentry id="expect">
         <term><command>expect</command></term>
         <listitem>
-          <para>Communicates with other interactive programs according
-          to a script</para>
+          <para>根据一个脚本与其他交互程序交流</para>
           <indexterm zone="ch-tools-expect expect">
             <primary sortas="b-expect">expect</primary>
           </indexterm>
@@ -145,8 +162,8 @@ sed 's:/usr/local/bin:/bin:' configure.orig &gt; configure</userinput></screen>
       <varlistentry id="libexpect">
         <term><filename class="libraryfile">libexpect-&expect-lib-version;.so</filename></term>
         <listitem>
-          <para>Contains functions that allow Expect to be used as a Tcl
-          extension or to be used directly from C or C++ (without Tcl)</para>
+		  <para>包含一些函数,使得 Expect 可以作为 Tcl 扩展使用,
+				也可以直接在 C 或 C++ 中使用(不使用 Tcl)</para>
           <indexterm zone="ch-tools-expect libexpect">
             <primary sortas="c-libexpect-&expect-lib-version;">libexpect-&expect-lib-version;</primary>
           </indexterm>

+ 64 - 29
chapter05/tcl.xml

@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
+<?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
   "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
   <!ENTITY % general-entities SYSTEM "../general.ent">
@@ -16,6 +16,12 @@
 
   <title>Tcl-core-&tcl-version;</title>
 
+  <note><title>译注</title>
+	  <para>尽管本节使用的软件包名称是 Tcl-core ,
+		  但在软件包下载页面给出的软件包名称是 Tcl。这不影响本节的命令。
+		  在作者对此表态之前,翻译时原样保留 Tcl-core 这个名称。</para>
+  </note>
+
   <indexterm zone="ch-tools-tcl">
     <primary sortas="a-Tcl">Tcl-core</primary>
   </indexterm>
@@ -23,7 +29,8 @@
   <sect2 role="package">
     <title/>
 
-    <para>The Tcl package contains the Tool Command Language.</para>
+    <!--para>The Tcl package contains the Tool Command Language.</para-->
+    <para>Tcl 软件包包含工具命令语言。</para>
 
     <segmentedlist>
       <segtitle>&buildtime;</segtitle>
@@ -38,86 +45,114 @@
   </sect2>
 
   <sect2 role="installation">
-    <title>Installation of Tcl-core</title>
+    <title>安装 Tcl-core</title>
 
-    <para>This package and the next two (Expect and DejaGNU) are
+    <!--para>This package and the next two (Expect and DejaGNU) are
     installed to support running the test suites for GCC and Binutils and other
     packages.  Installing three packages for testing purposes may seem
     excessive, but it is very reassuring, if not essential, to know that the
     most important tools are working properly. Even if the test suites are not
     run in this chapter (they are not mandatory), these packages are required
-    to run the test suites in <xref linkend="chapter-building-system"/>.</para>
-
-    <para>Note that the Tcl package used here is a minimal version needed
+    to run the test suites in <xref linkend="chapter-building-system"/>.</para-->
+    <para>为了支持 GCC 和 Binutils 等软件包测试套件的运行,
+		需要安装这个软件包和接下来的两个 (Expect 与 DejaGNU)。
+		为了测试目的安装三个软件包看似浪费,
+		但实际上,我们运行了测试,才能放心地确定多数重要工具可以正常工作,
+		即使测试不是必要的。另外,即使在本章中不运行测试套件
+		(本章中的测试并不必要),我们必须安装这三个软件包,
+		才能执行 <xref linkend="chapter-building-system"/> 中的测试套件。
+	</para>
+
+    <!--para>Note that the Tcl package used here is a minimal version needed
     to run the LFS tests.  For the full package, see the  
-    <ulink url='&blfs-book;general/tcl.html'>BLFS Tcl procedures</ulink>.</para>
+    <ulink url='&blfs-book;general/tcl.html'>BLFS Tcl procedures</ulink>.</para-->
+    <para>注意,这里使用的 Tcl 软件包是一个最小版本,仅用于运行 LFS 的测试。
+		如果需要完整的软件包,阅读
+		<ulink url='&blfs-book;general/tcl.html'>BLFS Tcl 安装过程</ulink>
+		。</para>
 
-    <para>Prepare Tcl for compilation:</para>
+    <para>准备编译 Tcl:</para>
 
 <screen><userinput remap="configure">cd unix
 ./configure --prefix=/tools</userinput></screen>
 
-    <para>Build the package:</para>
+    <para>构建该软件包:</para>
 
 <screen><userinput remap="make">make</userinput></screen>
 
-    <para>Compilation is now complete. As discussed earlier, running the test
+    <!--para>Compilation is now complete. As discussed earlier, running the test
     suite is not mandatory for the temporary tools here in this chapter. To run
-    the Tcl test suite anyway, issue the following command:</para>
+    the Tcl test suite anyway, issue the following command:</para-->
+    <para>现在编译已经完成。正如之前讨论的,对于本章中的临时工具而言,
+		没有必要运行测试套件。如果无论如何要运行测试套件,
+		执行下列命令:</para>
 
 <screen><userinput remap="test">TZ=UTC make test</userinput></screen>
 
-    <para>The Tcl test suite may experience failures under certain host
+    <!--para>The Tcl test suite may experience failures under certain host
     conditions that are not fully understood. Therefore, test suite failures
     here are not surprising, and are not considered critical. The
     <parameter>TZ=UTC</parameter> parameter sets the time zone to Coordinated
     Universal Time (UTC), but only
     for the duration of the test suite run. This ensures that the clock tests
     are exercised correctly. Details on the <envar>TZ</envar> environment
-    variable are provided in <xref linkend="chapter-bootscripts"/>.</para>
+    variable are provided in <xref linkend="chapter-bootscripts"/>.</para-->
+
+	<para>在某些特定的宿主环境下,Tcl 测试套件可能失败,
+		失败原因还没有完全理解清楚。因此,测试套件的失败并不令人吃惊,
+		也不会造成严重问题。<parameter>TZ=UTC</parameter>
+		参数在测试套件的运行过程中将时区设为协调世界时 (UTC),
+		这保证时钟测试能够正常进行。<envar>TZ</envar>
+		环境变量的详细知识在 <xref linkend="chapter-bootscripts"/> 中讲解。
+	</para>
+
 
-    <para>Install the package:</para>
+    <para>安装该软件包:</para>
 
 <screen><userinput remap="install">make install</userinput></screen>
 
-    <para>Make the installed library writable so debugging symbols can
-    be removed later:</para>
+    <!--para>Make the installed library writable so debugging symbols can
+    be removed later:</para-->
+    <para>将安装好的库加上写入权限,以便将来移除调试符号:</para>
 
 <screen><userinput remap="install">chmod -v u+w /tools/lib/libtcl&tcl-major-version;.so</userinput></screen>
 
-    <para>Install Tcl's headers. The next package, Expect, requires them
-    to build.</para>
+    <!--para>Install Tcl's headers. The next package, Expect, requires them
+    to build.</para-->
+    <para>安装 Tcl 的头文件,因为下一个软件包 Expect 需要它们才能构建。
+    </para>
 
 <screen><userinput remap="install">make install-private-headers</userinput></screen>
 
-    <para>Now make a necessary symbolic link:</para>
+    <!--para>Now make a necessary symbolic link:</para-->
+    <para>创建一个必要的符号链接:</para>
 
 <screen><userinput remap="install">ln -sv tclsh&tcl-major-version; /tools/bin/tclsh</userinput></screen>
 
   </sect2>
 
   <sect2 id="contents-tcl" role="content">
-    <title>Contents of Tcl-core</title>
+    <title>Tcl-core 的内容</title>
 
     <segmentedlist>
-      <segtitle>Installed programs</segtitle>
-      <segtitle>Installed library</segtitle>
+      <segtitle>安装的程序</segtitle>
+      <segtitle>安装的库</segtitle>
 
       <seglistitem>
-        <seg>tclsh (link to tclsh&tcl-major-version;) and tclsh&tcl-major-version;</seg>
+        <seg>tclsh (到 tclsh&tcl-major-version; 的链接) 和 tclsh&tcl-major-version;</seg>
         <seg>libtcl&tcl-major-version;.so, libtclstub&tcl-major-version;.a</seg>
       </seglistitem>
     </segmentedlist>
 
     <variablelist>
-      <bridgehead renderas="sect3">Short Descriptions</bridgehead>
+      <bridgehead renderas="sect3">简要描述</bridgehead>
       <?dbfo list-presentation="list"?>
       <?dbhtml list-presentation="table"?>
 
       <varlistentry id="tclsh&tcl-major-version;">
         <term><command>tclsh&tcl-major-version;</command></term>
         <listitem>
-          <para>The Tcl command shell</para>
+          <para>Tcl 命令行 shell</para>
           <indexterm zone="ch-tools-tcl tclsh&tcl-major-version;">
             <primary sortas="b-tclsh&tcl-major-version;">tclsh&tcl-major-version;</primary>
           </indexterm>
@@ -127,7 +162,7 @@
       <varlistentry id="tclsh">
         <term><command>tclsh</command></term>
         <listitem>
-          <para>A link to tclsh&tcl-major-version;</para>
+          <para>一个指向 tclsh&tcl-major-version; 的链接</para>
           <indexterm zone="ch-tools-tcl tclsh">
             <primary sortas="b-tclsh">tclsh</primary>
           </indexterm>
@@ -137,7 +172,7 @@
       <varlistentry id="libtcl&tcl-major-version;.so">
         <term><filename class="libraryfile">libtcl&tcl-major-version;.so</filename></term>
         <listitem>
-          <para>The Tcl library</para>
+          <para>Tcl 运行库</para>
           <indexterm zone="ch-tools-tcl libtcl&tcl-major-version;.so">
             <primary sortas="c-libtcl&tcl-major-version;.so">libtcl&tcl-major-version;.so</primary>
           </indexterm>
@@ -147,7 +182,7 @@
       <varlistentry id="libtclstub&tcl-major-version;.a">
         <term><filename class="libraryfile">libtclstub&tcl-major-version;.a</filename></term>
         <listitem>
-          <para>The Tcl Stub library</para>
+          <para>Tcl 端桩库</para>
           <indexterm zone="ch-tools-tcl libtclstub&tcl-major-version;.a">
             <primary sortas="c-libtclstub&tcl-major-version;.a">libtclstub&tcl-major-version;.a</primary>
           </indexterm>