Index: basicnet/netprogs/ncftp/ncftp-config.xml
===================================================================
--- basicnet/netprogs/ncftp/ncftp-config.xml	(revision 5bc2a0191289807e492acaa2ade873e966bd7c0e)
+++ basicnet/netprogs/ncftp/ncftp-config.xml	(revision 70919becdad7b01f724f09aaa05dba1059a2dda9)
@@ -14,5 +14,5 @@
 options to alter in there, including:</para>
 
-<para><screen><userinput>yes-i-know-about-NcFTPd=yes</userinput></screen> : 
+<para><screen><userinput>yes-i-know-about-NcFTPd=yes</userinput></screen> 
 This disables the splash screen advertising the
 <application>NcFTPd</application> server.</para>
Index: introduction/welcome/changelog.xml
===================================================================
--- introduction/welcome/changelog.xml	(revision 5bc2a0191289807e492acaa2ade873e966bd7c0e)
+++ introduction/welcome/changelog.xml	(revision 70919becdad7b01f724f09aaa05dba1059a2dda9)
@@ -10,4 +10,7 @@
 
 <itemizedlist>
+
+<listitem><para>September 18th, 2003 [larry]: added compress doc page to
+postlfs.</para></listitem>
 
 <listitem><para>September 17th, 2003 [igor]: update to
Index: introduction/welcome/credits.xml
===================================================================
--- introduction/welcome/credits.xml	(revision 5bc2a0191289807e492acaa2ade873e966bd7c0e)
+++ introduction/welcome/credits.xml	(revision 70919becdad7b01f724f09aaa05dba1059a2dda9)
@@ -54,4 +54,7 @@
 <listitem><para>Chapter 03: The Bash Shell Startup Files <emphasis>James 
 Robertson</emphasis>.</para></listitem>
+
+<listitem><para>Chapter 03: Compressed docs <emphasis>Olivier
+Peres</emphasis>.</para></listitem>
 
 <listitem><para>Chapter 04: <!--<xref linkend="ch06-firewall"/>-->Firewalling: 
Index: postlfs/config/compressdoc.xml
===================================================================
--- postlfs/config/compressdoc.xml	(revision 70919becdad7b01f724f09aaa05dba1059a2dda9)
+++ postlfs/config/compressdoc.xml	(revision 70919becdad7b01f724f09aaa05dba1059a2dda9)
@@ -0,0 +1,160 @@
+<sect1 id="postlfs-config-compressdoc" xreflabel="compressdoc">
+<?dbhtml filename="compressdoc.html" dir="postlfs"?>
+<title>Compressing man and info pages</title>
+
+<para>Man and info reader programs can transparently process gzipped or
+bziptwoed pages, a feature you can use to free some disk space while keeping
+your documentation available. However, things are not that simple: man
+directories tend to contain links - hard and symbolic - which defeat simple
+ideas like recursively calling gzip on them. A better way to go is to use the
+script below.
+</para>
+
+<screen><userinput><command>cat &gt; /usr/bin/comprdoc &lt;&lt; "EOF"</command>
+
+#!/bin/sh
+
+function changefileext
+{
+ # prints the given filename with the new extension instead of
+ # the old one. ! - always prints an absolute filename even if
+ # the caller provides a relative one.
+ # parameters : 1 - file name
+ # 2 - old extension
+ # 3 - new extension (may be empty)
+
+ echo `dirname $1`\/`basename $1 $2`$3
+}
+
+# check that the command line is right, if not print a relevant message.
+
+if [ ! -d $1 -o -z $1 ] || [ "$2" != "gz" -a "$2" != "bz2" ]
+then
+ echo "Usage : $0 /path/to/doc/dir gz/bz2"
+ echo "e.g. $0 /usr/info gz to compress info pages in gzip format"
+ echo "or   $0 /usr/X11R6/man bz2 to compact X man pages using bzip2."
+ exit 1
+fi
+
+# set up a few variables.
+
+NEWEXT=.$2 # NEWEXT = extension of newly compressed files
+
+if [ "$NEWEXT" == ".bz2" ]
+then
+ OLDEXT=".gz" # OLDEXT = extensions of files to recompress
+ DECOMPRESS="gunzip -f" # DECOMPRESS = command to decompress a file
+ COMPRESS="bzip2 -f9" # COMPRESS = command to compress a file
+else
+ OLDEXT=".bz2"
+ DECOMPRESS="bunzip2 -f"
+ COMPRESS="gzip -f9"
+fi
+
+# process all files not in the target format under the provided root directory.
+# I use cd instead of giving $1 as an argument to find because this causes
+# problems with symbolic links, e.g. /usr/man -> /usr/share/man.
+
+cd $1
+
+for f in `find  . \! -name "*$NEWEXT"`
+do
+ # the following test is needed because we have to update links ahead of
+ # ourselves, so $f is sometimes a nonexistent file or a link to one.
+
+ if [ -f $f -o -L $f ]
+ then
+ FILE=$f # the file being processed
+ BASEFILE=`basename $FILE` # its basename (see HLINKS)
+ INODE=`find $FILE -printf %i` # its inode number (see HLINKS)
+ NEWFILE=`changefileext $FILE $OLDEXT $NEWEXT` # new file name
+
+ # HLINKS is the list of all hard links to the current file.
+
+ HLINKS=`find . \! -name $BASEFILE -inum $INODE`
+
+ if [ -L $FILE ]
+ then
+ # the current file is a symbolic link, so we change
+ # its name and the name of its target.
+
+ TARGET=`readlink $FILE`
+ rm -f $FILE
+ ln -sf `changefileext $TARGET $OLDEXT $NEWEXT` $NEWFILE
+ elif [ -f $FILE ]
+ then
+ # the current file is a regular file.
+
+ TEMPFILE=`changefileext $FILE $OLDEXT`
+
+# if there are several versions of a page (at worst, there can be
+# one uncompressed, one old-compressed and one new-compressed), then
+# we have to make sure that only the most recent file is kept, because
+# it most likely means the user installed several versions of a package.
+
+ # first, if we are dealing with an old-compressed file,
+ # expand it if it is more recent than the uncompressed
+ # file *and* the new-compressed file, else delete it.
+ # (works even if TEMPFILE and/or NEWFILE do not exist)
+
+ if [ "$FILE" != "$TEMPFILE" ]
+ then
+ if [ $FILE -nt $TEMPFILE -a \
+      $FILE -nt $NEWFILE ]
+ then
+ $DECOMPRESS $FILE
+ else
+ rm -f $FILE
+ fi
+ FILE=$TEMPFILE
+ fi
+
+ # now we are dealing with an uncompressed file that may
+ # exist or not (because of the above). If it is newer
+ # than both the new-compressed and the old-compressed
+ # files then it is compressed, else it is deleted.
+
+ if [ -f $FILE ]
+ then
+ if [ $FILE -nt $NEWFILE -a \
+      $FILE -nt $FILE$OLDEXT ]
+ then
+ $COMPRESS $FILE
+ else
+ rm -f $FILE
+ fi
+ fi
+ fi
+
+ # update the hard links to the current files,
+ # as the new inode number is now known.
+
+ for g in $HLINKS
+ do
+ rm -f $g
+ ln -f $NEWFILE `changefileext $g $OLDEXT $NEWEXT`
+ done
+ fi
+done
+
+<command>EOF
+chmod 755 /usr/bin/comprdoc</command></userinput></screen>
+
+<para>Now, as root, you can issue a
+<userinput><command>/usr/bin/comprdoc /usr/man bz2</command></userinput>
+to compress your system man pages. Similarly, you can run it on the
+<filename class="directory">/usr/info</filename> directory. Don't forget
+<filename class="directory">/usr/X11R6/man</filename> if you install the
+<application>X</application> Window system. A few other programs, like 
+<application>XEmacs</application>, also install their documentation in 
+nonstandard places.</para>
+
+<para>Generally, package installation systems do not compress the man/info
+pages, which means you will need to run the script again if you want to keep
+the size of your documentation as small as possible. Also, note that upgrading
+a package is safe: when you have several versions of a page (for example, a
+compressed and an uncompressed file), the script always keeps the most recent
+and deletes the others.</para>
+
+</sect1>
+
Index: postlfs/config/config.xml
===================================================================
--- postlfs/config/config.xml	(revision 5bc2a0191289807e492acaa2ade873e966bd7c0e)
+++ postlfs/config/config.xml	(revision 70919becdad7b01f724f09aaa05dba1059a2dda9)
@@ -39,6 +39,5 @@
 &postlfs-config-logon;
 &postlfs-config-random;
-&postlfs-config-manpages;
-&postlfs-config-infopages;
+&postlfs-config-compressdoc;
 
 </chapter>
Index: stlfs/config/infopages.xml
===================================================================
--- postlfs/config/infopages.xml	(revision 5bc2a0191289807e492acaa2ade873e966bd7c0e)
+++ 	(revision )
@@ -1,8 +1,0 @@
-<sect1 id="postlfs-config-infopages">
-<?dbhtml filename="infopages.html" dir="postlfs"?>
-<title>Info page issues</title>
-
-<para>NEW PAGE TO BE WRITTEN</para>
-
-</sect1>
-
Index: stlfs/config/manpages.xml
===================================================================
--- postlfs/config/manpages.xml	(revision 5bc2a0191289807e492acaa2ade873e966bd7c0e)
+++ 	(revision )
@@ -1,8 +1,0 @@
-<sect1 id="postlfs-config-manpages">
-<?dbhtml filename="manpages.html" dir="postlfs"?>
-<title>Man page issues</title>
-
-<para>NEW PAGE TO BE WRITTEN</para>
-
-</sect1>
-
Index: postlfs/postlfs.ent
===================================================================
--- postlfs/postlfs.ent	(revision 5bc2a0191289807e492acaa2ade873e966bd7c0e)
+++ postlfs/postlfs.ent	(revision 70919becdad7b01f724f09aaa05dba1059a2dda9)
@@ -9,6 +9,5 @@
 <!ENTITY postlfs-config-bootdisk SYSTEM "config/bootdisk.xml">
 <!ENTITY postlfs-config-random SYSTEM "config/random.xml">
-<!ENTITY postlfs-config-manpages SYSTEM "config/manpages.xml">
-<!ENTITY postlfs-config-infopages SYSTEM "config/infopages.xml">
+<!ENTITY postlfs-config-compressdoc SYSTEM "config/compressdoc.xml">
 <!ENTITY postlfs-config-skel SYSTEM "config/skel.xml">
 
