CompressDoc fixes

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@1945 af4574ff-66df-0310-9fd7-8a98e5e911e0
This commit is contained in:
Tushar Teredesai 2004-03-30 07:32:43 +00:00
parent aabd7e50cd
commit 4067e17b75
2 changed files with 16 additions and 7 deletions

View File

@ -11,6 +11,10 @@ who wrote what.</para>
<itemizedlist>
<listitem><para>March 30th, 2004 [tushar]: Fixed compressdoc script so that it can
be called as compressdoc instead of /usr/bin/compressdoc. Moved the script to
/usr/sbin.</para></listitem>
<listitem><para>March 30th, 2004 [tushar]: Updated to xfsprogs-2.6.9.</para></listitem>
<listitem><para>March 27th, 2004 [tushar]: Updated mysql, postgresql, bind, dhcp

View File

@ -10,9 +10,9 @@ ideas like recursively calling <command>gzip</command> on them. A better way
to go is to use the script below.
</para>
<screen><userinput><command>cat &gt; /usr/bin/compressdoc &lt;&lt; "EOF"</command>
<screen><userinput><command>cat &gt; /usr/sbin/compressdoc &lt;&lt; "EOF"</command>
#!/bin/bash
# VERSION: 20031029.0025
# VERSION: 20040320.0026
#
# Compress (with bzip2 or gzip) all man pages in a hierarchy and
# update symlinks - By Marc Heerdink &lt;marc @ koelkast.net&gt;
@ -24,6 +24,8 @@ to go is to use the script below.
# to allow for changing hard-links into soft- ones, to specify the
# compression level, to parse the man.conf for all occurrences of MANPATH,
# to allow for a backup, to allow to keep the newest version of a page.
# Modified 20040330 by Tushar Teredesai to replace $0 by the name of the script.
# (Note: It is assumed that the script is in the user's PATH)
#
# TODO:
# - choose a default compress method to be based on the available
@ -42,7 +44,7 @@ function help ()
if [ -n "$1" ]; then
echo "Unknown option : $1"
fi
( echo "Usage: $0 &lt;comp_method&gt; [options] [dirs]" &amp;&amp; \
( echo "Usage: $MY_NAME &lt;comp_method&gt; [options] [dirs]" &amp;&amp; \
cat &lt;&lt; EOT
Where comp_method is one of :
--gzip, --gz, -g
@ -145,6 +147,9 @@ function check_unique ()
return 1
}
# Name of the script
MY_NAME=`basename $0`
# OK, parse the command-line for arguments, and initialize to some sensible
# state, that is : don't change links state, parse /etc/man.conf, be most
# silent, search man.conf in /etc, and don't force (re-)compression.
@ -338,7 +343,7 @@ for DIR in $MAN_DIR; do
echo "-&gt; Entering ${DIR}/${FILE}..." &gt; $DEST_FD0
# I need not pass --conf, as I specify the directory to work on
# But I need exit in case of error
"$0" ${COMP_METHOD} ${COMP_LVL} ${LN_OPT} ${VERBOSE_OPT} ${FORCE_OPT} "${DIR}/${FILE}" || exit 1
"$MY_NAME" ${COMP_METHOD} ${COMP_LVL} ${LN_OPT} ${VERBOSE_OPT} ${FORCE_OPT} "${DIR}/${FILE}" || exit 1
echo "&lt;- Leaving ${DIR}/${FILE}." &gt; $DEST_FD1
cd "$DIR" # Needed for the next iteration of the loop
@ -449,11 +454,11 @@ for DIR in $MAN_DIR; do
done # for FILE
done # for DIR
<command>EOF
chmod 755 /usr/bin/compressdoc</command></userinput></screen>
chmod 755 /usr/sbin/compressdoc</command></userinput></screen>
<para>Now, as root, you can issue a
<command>/usr/bin/compressdoc --bz2</command> to compress all your system man
pages. You can also run <command>/usr/bin/compressdoc --help</command> to get
<command>compressdoc --bz2</command> to compress all your system man
pages. You can also run <command>compressdoc --help</command> to get
a comprehensive help about what the script is able to do.</para>
<para> Don't forget that a few programs, like the <application>X</application>