Rev 7156 |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
# SOME DESCRIPTIVE TITLE
# Copyright (C) YEAR Free Software Foundation, Inc.
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2016-09-23 12:04+0200\n"
"PO-Revision-Date: 2016-08-17 12:36+0000\n"
"Last-Translator: lescactus <amaldeme@free.fr>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: fr\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
"X-Generator: Pootle 2.7\n"
"X-POOTLE-MTIME: 1471437403.000000\n"
#. type: Content of: <sect1><sect1info>
#: blfs-en/archive/compressdoc.xml:12
#, fuzzy
#| msgid ""
#| "<othername>$LastChangedBy: fernando $</othername> <date>$Date: 2015-11-13 "
#| "15:24:57 +0100 (Fri, 13 Nov 2015) $</date>"
msgid ""
"<othername>$LastChangedBy: fernando $</othername> <date>$Date: 2015-11-13 "
"15:24:57 +0100 (Fri 13 Nov 2015) $</date>"
msgstr ""
"<othername>$LastChangedBy: fernando $</othername> <date>$Date: 2015-11-13 "
"15:24:57 +0100 (ven. 13 nov. 2015) $</date>"
#. type: Content of: <sect1><title>
#: blfs-en/archive/compressdoc.xml:16
msgid "Compressing Man and Info Pages"
msgstr "Compresser des pages de man et d'infos"
#. type: Content of: <sect1><indexterm><primary>
#: blfs-en/archive/compressdoc.xml:19
msgid "compressdoc"
msgstr "compressdoc"
#. type: Content of: <sect1><para>
#: blfs-en/archive/compressdoc.xml:22
msgid ""
"Man and info reader programs can transparently process files compressed with "
"<command>gzip</command> or <command>bzip2</command>, 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 "
"<command>gzip</command> on them. A better way to go is to use the script "
"below. If you would prefer to download the file instead of creating it by "
"typing or copy-and-pasting, you can find it at <ulink url=\"&files-anduin;/"
"compressdoc\"/> (the file should be installed in the <filename class="
"\"directory\">/usr/sbin</filename> directory)."
msgstr ""
"Les lecteurs de man et d'infos peuvent gérer de façon transparente des "
"fichiers compressés avec <command>gzip</command> ou <command>bzip2</"
"command>, une fonctionnalité que vous pouvez utiliser pour libérer de "
"l'espace disque en laissant disponible la documentation. Les choses ne sont "
"cependant pas si simples ; les répertoires de man ont tendance à "
"contenir des liens—durs et symboliques—qui remettent en cause "
"les idées simples telles que l'appel de <command>gzip</command> sur eux de "
"manière récursive. Une meilleure manière de faire est d'utiliser le script "
"ci-dessous. Si vous préférez télécharger le fichier au lieu de le créer en "
"tapant ou en faisant un copier-coller, vous pouvez le trouver sur <ulink url="
"\"&files-anduin;/compressdoc\"/> (vous devriez installer le fichier dans le "
"répertoire <filename class=\"directory\">/usr/sbin</filename>)."
#. type: Content of: <sect1><screen>
#: blfs-en/archive/compressdoc.xml:33
#, fuzzy, no-wrap
msgid ""
"<userinput>cat > /usr/sbin/compressdoc << \"EOF\"\n"
"<literal>#!/bin/bash\n"
"# VERSION: 20080421.1623\n"
"#\n"
"# Compress (with bzip2 or gzip) all man pages in a hierarchy and\n"
"# update symlinks - By Marc Heerdink <marc @ koelkast.net>\n"
"#\n"
"# Modified to be able to gzip or bzip2 files as an option and to deal\n"
"# with all symlinks properly by Mark Hymers <markh @ &lfs-domainname;>\n"
"#\n"
"# Modified 20030930 by Yann E. Morin <yann.morin.1998 @ anciens.enib.fr>\n"
"# to accept compression/decompression, to correctly handle hard-links,\n"
"# to allow for changing hard-links into soft- ones, to specify the\n"
"# compression level, to parse the man.conf for all occurrences of MANPATH,\n"
"# to allow for a backup, to allow to keep the newest version of a page.\n"
"#\n"
"# Modified 20040330 by Tushar Teredesai to replace $0 by the name of the\n"
"# script.\n"
"# (Note: It is assumed that the script is in the user's PATH)\n"
"#\n"
"# Modified 20050112 by Randy McMurchy to shorten line lengths and\n"
"# correct grammar errors.\n"
"#\n"
"# Modified 20060128 by Alexander E. Patrakov for compatibility with Man-DB.\n"
"#\n"
"# Modified 20060311 by Archaic to use Man-DB manpath utility which is a\n"
"# replacement for man --path from Man.\n"
"#\n"
"# Modified 20080421 by Dan Nicholson to properly execute the correct\n"
"# compressdoc when working recursively. This means the same compressdoc\n"
"# will be used whether a full path was given or it was resolved from PATH.\n"
"#\n"
"# Modified 20080421 by Dan Nicholson to be more robust with directories\n"
"# that don't exist or don't have sufficient permissions.\n"
"#\n"
"# Modified 20080421 by Lars Bamberger to (sort of) automatically choose\n"
"# a compression method based on the size of the manpage. A couple bug\n"
"# fixes were added by Dan Nicholson.\n"
"#\n"
"# Modified 20080421 by Dan Nicholson to suppress warnings from manpath\n"
"# since these are emitted when $MANPATH is set. Removed the TODO for\n"
"# using the $MANPATH variable since manpath(1) handles this already.\n"
"#\n"
"# TODO:\n"
"# - choose a default compress method to be based on the available\n"
"# tool : gzip or bzip2;\n"
"# - offer an option to restore a previous backup;\n"
"# - add other compression engines (compress, zip, etc?). Needed?\n"
"\n"
"# Funny enough, this function prints some help.\n"
"function help ()\n"
"{\n"
" if [ -n \"$1\" ]; then\n"
" echo \"Unknown option : $1\"\n"
" fi\n"
" ( echo \"Usage: $MY_NAME <comp_method> [options] [dirs]\" && \\\n"
" cat << EOT\n"
"Where comp_method is one of :\n"
" --gzip, --gz, -g\n"
" --bzip2, --bz2, -b\n"
" Compress using gzip or bzip2.\n"
" --automatic\n"
" Compress using either gzip or bzip2, depending on the\n"
" size of the file to be compressed. Files larger than 5\n"
" kB are bzipped, files larger than 1 kB are gzipped and\n"
" files smaller than 1 kB are not compressed.\n"
"\n"
" --decompress, -d\n"
" Decompress the man pages.\n"
"\n"
" --backup Specify a .tar backup shall be done for all directories.\n"
" In case a backup already exists, it is saved as .tar.old\n"
" prior to making the new backup. If a .tar.old backup\n"
" exists, it is removed prior to saving the backup.\n"
" In backup mode, no other action is performed.\n"
"\n"
"And where options are :\n"
" -1 to -9, --fast, --best\n"
" The compression level, as accepted by gzip and bzip2.\n"
" When not specified, uses the default compression level\n"
" for the given method (-6 for gzip, and -9 for bzip2).\n"
" Not used when in backup or decompress modes.\n"
"\n"
" --force, -F Force (re-)compression, even if the previous one was\n"
" the same method. Useful when changing the compression\n"
" ratio. By default, a page will not be re-compressed if\n"
" it ends with the same suffix as the method adds\n"
" (.bz2 for bzip2, .gz for gzip).\n"
"\n"
" --soft, -S Change hard-links into soft-links. Use with _caution_\n"
" as the first encountered file will be used as a\n"
" reference. Not used when in backup mode.\n"
"\n"
" --hard, -H Change soft-links into hard-links. Not used when in\n"
" backup mode.\n"
"\n"
" --conf=dir, --conf dir\n"
" Specify the location of man_db.conf. Defaults to /etc.\n"
"\n"
" --verbose, -v Verbose mode, print the name of the directory being\n"
" processed. Double the flag to turn it even more verbose,\n"
" and to print the name of the file being processed.\n"
"\n"
" --fake, -f Fakes it. Print the actual parameters compressdoc will use.\n"
"\n"
" dirs A list of space-separated _absolute_ pathnames to the\n"
" man directories. When empty, and only then, use manpath\n"
" to parse ${MAN_CONF}/man_db.conf for all valid occurrences\n"
" of MANDATORY_MANPATH.\n"
"\n"
"Note about compression:\n"
" There has been a discussion on blfs-support about compression ratios of\n"
" both gzip and bzip2 on man pages, taking into account the hosting fs,\n"
" the architecture, etc... On the overall, the conclusion was that gzip\n"
" was much more efficient on 'small' files, and bzip2 on 'big' files,\n"
" small and big being very dependent on the content of the files.\n"
"\n"
" See the original post from Mickael A. Peters, titled\n"
" \"Bootable Utility CD\", dated 20030409.1816(+0200), and subsequent posts:\n"
" http://&lfs-domainname;/pipermail/blfs-support/2003-April/038817.html\n"
"\n"
" On my system (x86, ext3), man pages were 35564KB before compression.\n"
" gzip -9 compressed them down to 20372KB (57.28%), bzip2 -9 got down to\n"
" 19812KB (55.71%). That is a 1.57% gain in space. YMMV.\n"
"\n"
" What was not taken into consideration was the decompression speed. But\n"
" does it make sense to? You gain fast access with uncompressed man\n"
" pages, or you gain space at the expense of a slight overhead in time.\n"
" Well, my P4-2.5GHz does not even let me notice this... :-)\n"
"\n"
"EOT\n"
") | less\n"
"}\n"
"\n"
"# This function checks that the man page is unique amongst bzip2'd,\n"
"# gzip'd and uncompressed versions.\n"
"# $1 the directory in which the file resides\n"
"# $2 the file name for the man page\n"
"# Returns 0 (true) if the file is the latest and must be taken care of,\n"
"# and 1 (false) if the file is not the latest (and has therefore been\n"
"# deleted).\n"
"function check_unique ()\n"
"{\n"
" # NB. When there are hard-links to this file, these are\n"
" # _not_ deleted. In fact, if there are hard-links, they\n"
" # all have the same date/time, thus making them ready\n"
" # for deletion later on.\n"
"\n"
" # Build the list of all man pages with the same name\n"
" DIR=$1\n"
" BASENAME=`basename \"${2}\" .bz2`\n"
" BASENAME=`basename \"${BASENAME}\" .gz`\n"
" GZ_FILE=\"$BASENAME\".gz\n"
" BZ_FILE=\"$BASENAME\".bz2\n"
"\n"
" # Look for, and keep, the most recent one\n"
" LATEST=`(cd \"$DIR\"; ls -1rt \"${BASENAME}\" \"${GZ_FILE}\" \"${BZ_FILE}\" \\\n"
" 2>/dev/null | tail -n 1)`\n"
" for i in \"${BASENAME}\" \"${GZ_FILE}\" \"${BZ_FILE}\"; do\n"
" [ \"$LATEST\" != \"$i\" ] && rm -f \"$DIR\"/\"$i\"\n"
" done\n"
"\n"
" # In case the specified file was the latest, return 0\n"
" [ \"$LATEST\" = \"$2\" ] && return 0\n"
" # If the file was not the latest, return 1\n"
" return 1\n"
"}\n"
"\n"
"# Name of the script\n"
"MY_NAME=`basename $0`\n"
"\n"
"# OK, parse the command-line for arguments, and initialize to some\n"
"# sensible state, that is: don't change links state, parse\n"
"# /etc/man_db.conf, be most silent, search man_db.conf in /etc, and don't\n"
"# force (re-)compression.\n"
"COMP_METHOD=\n"
"COMP_SUF=\n"
"COMP_LVL=\n"
"FORCE_OPT=\n"
"LN_OPT=\n"
"MAN_DIR=\n"
"VERBOSE_LVL=0\n"
"BACKUP=no\n"
"FAKE=no\n"
"MAN_CONF=/etc\n"
"while [ -n \"$1\" ]; do\n"
" case $1 in\n"
" --gzip|--gz|-g)\n"
" COMP_SUF=.gz\n"
" COMP_METHOD=$1\n"
" shift\n"
" ;;\n"
" --bzip2|--bz2|-b)\n"
" COMP_SUF=.bz2\n"
" COMP_METHOD=$1\n"
" shift\n"
" ;;\n"
" --automatic)\n"
" COMP_SUF=TBD\n"
" COMP_METHOD=$1\n"
" shift\n"
" ;;\n"
" --decompress|-d)\n"
" COMP_SUF=\n"
" COMP_LVL=\n"
" COMP_METHOD=$1\n"
" shift\n"
" ;;\n"
" -[1-9]|--fast|--best)\n"
" COMP_LVL=$1\n"
" shift\n"
" ;;\n"
" --force|-F)\n"
" FORCE_OPT=-F\n"
" shift\n"
" ;;\n"
" --soft|-S)\n"
" LN_OPT=-S\n"
" shift\n"
" ;;\n"
" --hard|-H)\n"
" LN_OPT=-H\n"
" shift\n"
" ;;\n"
" --conf=*)\n"
" MAN_CONF=`echo $1 | cut -d '=' -f2-`\n"
" shift\n"
" ;;\n"
" --conf)\n"
" MAN_CONF=\"$2\"\n"
" shift 2\n"
" ;;\n"
" --verbose|-v)\n"
" let VERBOSE_LVL++\n"
" shift\n"
" ;;\n"
" --backup)\n"
" BACKUP=yes\n"
" shift\n"
" ;;\n"
" --fake|-f)\n"
" FAKE=yes\n"
" shift\n"
" ;;\n"
" --help|-h)\n"
" help\n"
" exit 0\n"
" ;;\n"
" /*)\n"
" MAN_DIR=\"${MAN_DIR} ${1}\"\n"
" shift\n"
" ;;\n"
" -*)\n"
" help $1\n"
" exit 1\n"
" ;;\n"
" *)\n"
" echo \"\\\"$1\\\" is not an absolute path name\"\n"
" exit 1\n"
" ;;\n"
" esac\n"
"done\n"
"\n"
"# Redirections\n"
"case $VERBOSE_LVL in\n"
" 0)\n"
" # O, be silent\n"
" DEST_FD0=/dev/null\n"
" DEST_FD1=/dev/null\n"
" VERBOSE_OPT=\n"
" ;;\n"
" 1)\n"
" # 1, be a bit verbose\n"
" DEST_FD0=/dev/stdout\n"
" DEST_FD1=/dev/null\n"
" VERBOSE_OPT=-v\n"
" ;;\n"
" *)\n"
" # 2 and above, be most verbose\n"
" DEST_FD0=/dev/stdout\n"
" DEST_FD1=/dev/stdout\n"
" VERBOSE_OPT=\"-v -v\"\n"
" ;;\n"
"esac\n"
"\n"
"# Note: on my machine, 'man --path' gives /usr/share/man twice, once\n"
"# with a trailing '/', once without.\n"
"if [ -z \"$MAN_DIR\" ]; then\n"
" MAN_DIR=`manpath -q -C \"$MAN_CONF\"/man_db.conf \\\n"
" | sed 's/:/\\\\n/g' \\\n"
" | while read foo; do dirname \"$foo\"/.; done \\\n"
" | sort -u \\\n"
" | while read bar; do echo -n \"$bar \"; done`\n"
"fi\n"
"\n"
"# If no MANDATORY_MANPATH in ${MAN_CONF}/man_db.conf, abort as well\n"
"if [ -z \"$MAN_DIR\" ]; then\n"
" echo \"No directory specified, and no directory found with \\`manpath'\"\n"
" exit 1\n"
"fi\n"
"\n"
"# Check that the specified directories actually exist and are readable\n"
"for DIR in $MAN_DIR; do\n"
" if [ ! -d \"$DIR\" -o ! -r \"$DIR\" ]; then\n"
" echo \"Directory '$DIR' does not exist or is not readable\"\n"
" exit 1\n"
" fi\n"
"done\n"
"\n"
"# Fake?\n"
"if [ \"$FAKE\" != \"no\" ]; then\n"
" echo \"Actual parameters used:\"\n"
" echo -n \"Compression.......: \"\n"
" case $COMP_METHOD in\n"
" --bzip2|--bz2|-b) echo -n \"bzip2\";;\n"
" --gzip|--gz|-g) echo -n \"gzip\";;\n"
" --automatic) echo -n \"compressing\";;\n"
" --decompress|-d) echo -n \"decompressing\";;\n"
" *) echo -n \"unknown\";;\n"
" esac\n"
" echo \" ($COMP_METHOD)\"\n"
" echo \"Compression level.: $COMP_LVL\"\n"
" echo \"Compression suffix: $COMP_SUF\"\n"
" echo -n \"Force compression.: \"\n"
" [ \"foo$FORCE_OPT\" = \"foo-F\" ] && echo \"yes\" || echo \"no\"\n"
" echo \"man_db.conf is....: ${MAN_CONF}/man_db.conf\"\n"
" echo -n \"Hard-links........: \"\n"
" [ \"foo$LN_OPT\" = \"foo-S\" ] &&\n"
" echo \"convert to soft-links\" || echo \"leave as is\"\n"
" echo -n \"Soft-links........: \"\n"
" [ \"foo$LN_OPT\" = \"foo-H\" ] &&\n"
" echo \"convert to hard-links\" || echo \"leave as is\"\n"
" echo \"Backup............: $BACKUP\"\n"
" echo \"Faking (yes!).....: $FAKE\"\n"
" echo \"Directories.......: $MAN_DIR\"\n"
" echo \"Verbosity level...: $VERBOSE_LVL\"\n"
" exit 0\n"
"fi\n"
"\n"
"# If no method was specified, print help\n"
"if [ -z \"${COMP_METHOD}\" -a \"${BACKUP}\" = \"no\" ]; then\n"
" help\n"
" exit 1\n"
"fi\n"
"\n"
"# In backup mode, do the backup solely\n"
"if [ \"$BACKUP\" = \"yes\" ]; then\n"
" for DIR in $MAN_DIR; do\n"
" cd \"${DIR}/..\"\n"
" if [ ! -w \"`pwd`\" ]; then\n"
" echo \"Directory '`pwd`' is not writable\"\n"
" exit 1\n"
" fi\n"
" DIR_NAME=`basename \"${DIR}\"`\n"
" echo \"Backing up $DIR...\" > $DEST_FD0\n"
" [ -f \"${DIR_NAME}.tar.old\" ] && rm -f \"${DIR_NAME}.tar.old\"\n"
" [ -f \"${DIR_NAME}.tar\" ] &&\n"
" mv \"${DIR_NAME}.tar\" \"${DIR_NAME}.tar.old\"\n"
" tar -cvf \"${DIR_NAME}.tar\" \"${DIR_NAME}\" > $DEST_FD1\n"
" done\n"
" exit 0\n"
"fi\n"
"\n"
"# I know MAN_DIR has only absolute path names\n"
"# I need to take into account the localized man, so I'm going recursive\n"
"for DIR in $MAN_DIR; do\n"
" MEM_DIR=`pwd`\n"
" if [ ! -w \"$DIR\" ]; then\n"
" echo \"Directory '$DIR' is not writable\"\n"
" exit 1\n"
" fi\n"
" cd \"$DIR\"\n"
" for FILE in *; do\n"
" # Fixes the case were the directory is empty\n"
" if [ \"foo$FILE\" = \"foo*\" ]; then continue; fi\n"
"\n"
" # Fixes the case when hard-links see their compression scheme change\n"
" # (from not compressed to compressed, or from bz2 to gz, or from gz\n"
" # to bz2)\n"
" # Also fixes the case when multiple version of the page are present,\n"
" # which are either compressed or not.\n"
" if [ ! -L \"$FILE\" -a ! -e \"$FILE\" ]; then continue; fi\n"
"\n"
" # Do not compress whatis files\n"
" if [ \"$FILE\" = \"whatis\" ]; then continue; fi\n"
"\n"
" if [ -d \"$FILE\" ]; then\n"
" # We are going recursive to that directory\n"
" echo \"-> Entering ${DIR}/${FILE}...\" > $DEST_FD0\n"
" # I need not pass --conf, as I specify the directory to work on\n"
" # But I need exit in case of error. We must change back to the\n"
" # original directory so $0 is resolved correctly.\n"
" (cd \"$MEM_DIR\" && eval \"$0\" ${COMP_METHOD} ${COMP_LVL} ${LN_OPT} \\\n"
" ${VERBOSE_OPT} ${FORCE_OPT} \"${DIR}/${FILE}\") || exit $?\n"
" echo \"<- Leaving ${DIR}/${FILE}.\" > $DEST_FD1\n"
"\n"
" else # !dir\n"
" if ! check_unique \"$DIR\" \"$FILE\"; then continue; fi\n"
"\n"
" # With automatic compression, get the uncompressed file size of\n"
" # the file (dereferencing symlinks), and choose an appropriate\n"
" # compression method.\n"
" if [ \"$COMP_METHOD\" = \"--automatic\" ]; then\n"
" declare -i SIZE\n"
" case \"$FILE\" in\n"
" *.bz2)\n"
" SIZE=$(bzcat \"$FILE\" | wc -c) ;;\n"
" *.gz)\n"
" SIZE=$(zcat \"$FILE\" | wc -c) ;;\n"
" *)\n"
" SIZE=$(wc -c < \"$FILE\") ;;\n"
" esac\n"
" if (( $SIZE >= (5 * 2**10) )); then\n"
" COMP_SUF=.bz2\n"
" elif (( $SIZE >= (1 * 2**10) )); then\n"
" COMP_SUF=.gz\n"
" else\n"
" COMP_SUF=\n"
" fi\n"
" fi\n"
"\n"
" # Check if the file is already compressed with the specified method\n"
" BASE_FILE=`basename \"$FILE\" .gz`\n"
" BASE_FILE=`basename \"$BASE_FILE\" .bz2`\n"
" if [ \"${FILE}\" = \"${BASE_FILE}${COMP_SUF}\" \\\n"
" -a \"foo${FORCE_OPT}\" = \"foo\" ]; then continue; fi\n"
"\n"
" # If we have a symlink\n"
" if [ -h \"$FILE\" ]; then\n"
" case \"$FILE\" in\n"
" *.bz2)\n"
" EXT=bz2 ;;\n"
" *.gz)\n"
" EXT=gz ;;\n"
" *)\n"
" EXT=none ;;\n"
" esac\n"
"\n"
" if [ ! \"$EXT\" = \"none\" ]; then\n"
" LINK=`ls -l \"$FILE\" | cut -d \">\" -f2 \\\n"
" | tr -d \" \" | sed s/\\.$EXT$//`\n"
" NEWNAME=`echo \"$FILE\" | sed s/\\.$EXT$//`\n"
" mv \"$FILE\" \"$NEWNAME\"\n"
" FILE=\"$NEWNAME\"\n"
" else\n"
" LINK=`ls -l \"$FILE\" | cut -d \">\" -f2 | tr -d \" \"`\n"
" fi\n"
"\n"
" if [ \"$LN_OPT\" = \"-H\" ]; then\n"
" # Change this soft-link into a hard- one\n"
" rm -f \"$FILE\" && ln \"${LINK}$COMP_SUF\" \"${FILE}$COMP_SUF\"\n"
" chmod --reference \"${LINK}$COMP_SUF\" \"${FILE}$COMP_SUF\"\n"
" else\n"
" # Keep this soft-link a soft- one.\n"
" rm -f \"$FILE\" && ln -s \"${LINK}$COMP_SUF\" \"${FILE}$COMP_SUF\"\n"
" fi\n"
" echo \"Relinked $FILE\" > $DEST_FD1\n"
"\n"
" # else if we have a plain file\n"
" elif [ -f \"$FILE\" ]; then\n"
" # Take care of hard-links: build the list of files hard-linked\n"
" # to the one we are {de,}compressing.\n"
" # NB. This is not optimum has the file will eventually be\n"
" # compressed as many times it has hard-links. But for now,\n"
" # that's the safe way.\n"
" inode=`ls -li \"$FILE\" | awk '{print $1}'`\n"
" HLINKS=`find . \\! -name \"$FILE\" -inum $inode`\n"
"\n"
" if [ -n \"$HLINKS\" ]; then\n"
" # We have hard-links! Remove them now.\n"
" for i in $HLINKS; do rm -f \"$i\"; done\n"
" fi\n"
"\n"
" # Now take care of the file that has no hard-link\n"
" # We do decompress first to re-compress with the selected\n"
" # compression ratio later on...\n"
" case \"$FILE\" in\n"
" *.bz2)\n"
" bunzip2 $FILE\n"
" FILE=`basename \"$FILE\" .bz2`\n"
" ;;\n"
" *.gz)\n"
" gunzip $FILE\n"
" FILE=`basename \"$FILE\" .gz`\n"
" ;;\n"
" esac\n"
"\n"
" # Compress the file with the given compression ratio, if needed\n"
" case $COMP_SUF in\n"
" *bz2)\n"
" bzip2 ${COMP_LVL} \"$FILE\" && chmod 644 \"${FILE}${COMP_SUF}\"\n"
" echo \"Compressed $FILE\" > $DEST_FD1\n"
" ;;\n"
" *gz)\n"
" gzip ${COMP_LVL} \"$FILE\" && chmod 644 \"${FILE}${COMP_SUF}\"\n"
" echo \"Compressed $FILE\" > $DEST_FD1\n"
" ;;\n"
" *)\n"
" echo \"Uncompressed $FILE\" > $DEST_FD1\n"
" ;;\n"
" esac\n"
"\n"
" # If the file had hard-links, recreate those (either hard or soft)\n"
" if [ -n \"$HLINKS\" ]; then\n"
" for i in $HLINKS; do\n"
" NEWFILE=`echo \"$i\" | sed s/\\.gz$// | sed s/\\.bz2$//`\n"
" if [ \"$LN_OPT\" = \"-S\" ]; then\n"
" # Make this hard-link a soft- one\n"
" ln -s \"${FILE}$COMP_SUF\" \"${NEWFILE}$COMP_SUF\"\n"
" else\n"
" # Keep the hard-link a hard- one\n"
" ln \"${FILE}$COMP_SUF\" \"${NEWFILE}$COMP_SUF\"\n"
" fi\n"
" # Really work only for hard-links. Harmless for soft-links\n"
" chmod 644 \"${NEWFILE}$COMP_SUF\"\n"
" done\n"
" fi\n"
"\n"
" else\n"
" # There is a problem when we get neither a symlink nor a plain\n"
" # file. Obviously, we shall never ever come here... :-(\n"
" echo -n \"Whaooo... \\\"${DIR}/${FILE}\\\" is neither a symlink \"\n"
" echo \"nor a plain file. Please check:\"\n"
" ls -l \"${DIR}/${FILE}\"\n"
" exit 1\n"
" fi\n"
" fi\n"
" done # for FILE\n"
"done # for DIR</literal>\n"
"\n"
"EOF</userinput>"
msgstr ""
"<userinput>cat > /usr/sbin/compressdoc << \"EOF\"\n"
"<literal>#!/bin/bash\n"
"# VERSION: 20080421.1623\n"
"#\n"
"# Compress (with bzip2 or gzip) all man pages in a hierarchy and\n"
"# update symlinks - By Marc Heerdink <marc @ koelkast.net>\n"
"#\n"
"# Modified to be able to gzip or bzip2 files as an option and to deal\n"
"# with all symlinks properly by Mark Hymers <markh @ &lfs-domainname;>\n"
"#\n"
"# Modified 20030930 by Yann E. Morin <yann.morin.1998 @ anciens.enib.fr>\n"
"# to accept compression/decompression, to correctly handle hard-links,\n"
"# to allow for changing hard-links into soft- ones, to specify the\n"
"# compression level, to parse the man.conf for all occurrences of MANPATH,\n"
"# to allow for a backup, to allow to keep the newest version of a page.\n"
"#\n"
"# Modified 20040330 by Tushar Teredesai to replace $0 by the name of the\n"
"# script.\n"
"# (Note: It is assumed that the script is in the user's PATH)\n"
"#\n"
"# Modified 20050112 by Randy McMurchy to shorten line lengths and\n"
"# correct grammar errors.\n"
"#\n"
"# Modified 20060128 by Alexander E. Patrakov for compatibility with Man-DB.\n"
"#\n"
"# Modified 20060311 by Archaic to use Man-DB manpath utility which is a\n"
"# replacement for man --path from Man.\n"
"#\n"
"# Modified 20080421 by Dan Nicholson to properly execute the correct\n"
"# compressdoc when working recursively. This means the same compressdoc\n"
"# will be used whether a full path was given or it was resolved from PATH.\n"
"#\n"
"# Modified 20080421 by Dan Nicholson to be more robust with directories\n"
"# that don't exist or don't have sufficient permissions.\n"
"#\n"
"# Modified 20080421 by Lars Bamberger to (sort of) automatically choose\n"
"# a compression method based on the size of the manpage. A couple bug\n"
"# fixes were added by Dan Nicholson.\n"
"#\n"
"# Modified 20080421 by Dan Nicholson to suppress warnings from manpath\n"
"# since these are emitted when $MANPATH is set. Removed the TODO for\n"
"# using the $MANPATH variable since manpath(1) handles this already.\n"
"#\n"
"# TODO:\n"
"# - choose a default compress method to be based on the available\n"
"# tool : gzip or bzip2;\n"
"# - offer an option to restore a previous backup;\n"
"# - add other compression engines (compress, zip, etc?). Needed?\n"
"\n"
"# Funny enough, this function prints some help.\n"
"function help ()\n"
"{\n"
" if [ -n \"$1\" ]; then\n"
" echo \"Unknown option : $1\"\n"
" fi\n"
" ( echo \"Usage: $MY_NAME <comp_method> [options] [dirs]\" && \\\n"
" cat << EOT\n"
"Where comp_method is one of :\n"
" --gzip, --gz, -g\n"
" --bzip2, --bz2, -b\n"
" Compress using gzip or bzip2.\n"
" --automatic\n"
" Compress using either gzip or bzip2, depending on the\n"
" size of the file to be compressed. Files larger than 5\n"
" kB are bzipped, files larger than 1 kB are gzipped and\n"
" files smaller than 1 kB are not compressed.\n"
"\n"
" --decompress, -d\n"
" Decompress the man pages.\n"
"\n"
" --backup Specify a .tar backup shall be done for all directories.\n"
" In case a backup already exists, it is saved as .tar.old\n"
" prior to making the new backup. If a .tar.old backup\n"
" exists, it is removed prior to saving the backup.\n"
" In backup mode, no other action is performed.\n"
"\n"
"And where options are :\n"
" -1 to -9, --fast, --best\n"
" The compression level, as accepted by gzip and bzip2.\n"
" When not specified, uses the default compression level\n"
" for the given method (-6 for gzip, and -9 for bzip2).\n"
" Not used when in backup or decompress modes.\n"
"\n"
" --force, -F Force (re-)compression, even if the previous one was\n"
" the same method. Useful when changing the compression\n"
" ratio. By default, a page will not be re-compressed if\n"
" it ends with the same suffix as the method adds\n"
" (.bz2 for bzip2, .gz for gzip).\n"
"\n"
" --soft, -S Change hard-links into soft-links. Use with _caution_\n"
" as the first encountered file will be used as a\n"
" reference. Not used when in backup mode.\n"
"\n"
" --hard, -H Change soft-links into hard-links. Not used when in\n"
" backup mode.\n"
"\n"
" --conf=dir, --conf dir\n"
" Specify the location of man_db.conf. Defaults to /etc.\n"
"\n"
" --verbose, -v Verbose mode, print the name of the directory being\n"
" processed. Double the flag to turn it even more verbose,\n"
" and to print the name of the file being processed.\n"
"\n"
" --fake, -f Fakes it. Print the actual parameters compressdoc will use.\n"
"\n"
" dirs A list of space-separated _absolute_ pathnames to the\n"
" man directories. When empty, and only then, use manpath\n"
" to parse ${MAN_CONF}/man_db.conf for all valid occurrences\n"
" of MANDATORY_MANPATH.\n"
"\n"
"Note about compression:\n"
" There has been a discussion on blfs-support about compression ratios of\n"
" both gzip and bzip2 on man pages, taking into account the hosting fs,\n"
" the architecture, etc... On the overall, the conclusion was that gzip\n"
" was much more efficient on 'small' files, and bzip2 on 'big' files,\n"
" small and big being very dependent on the content of the files.\n"
"\n"
" See the original post from Mickael A. Peters, titled\n"
" \"Bootable Utility CD\", dated 20030409.1816(+0200), and subsequent posts:\n"
" http://&lfs-domainname;/pipermail/blfs-support/2003-April/038817.html\n"
"\n"
" On my system (x86, ext3), man pages were 35564KB before compression.\n"
" gzip -9 compressed them down to 20372KB (57.28%), bzip2 -9 got down to\n"
" 19812KB (55.71%). That is a 1.57% gain in space. YMMV.\n"
"\n"
" What was not taken into consideration was the decompression speed. But\n"
" does it make sense to? You gain fast access with uncompressed man\n"
" pages, or you gain space at the expense of a slight overhead in time.\n"
" Well, my P4-2.5GHz does not even let me notice this... :-)\n"
"\n"
"EOT\n"
") | less\n"
"}\n"
"\n"
"# This function checks that the man page is unique amongst bzip2'd,\n"
"# gzip'd and uncompressed versions.\n"
"# $1 the directory in which the file resides\n"
"# $2 the file name for the man page\n"
"# Returns 0 (true) if the file is the latest and must be taken care of,\n"
"# and 1 (false) if the file is not the latest (and has therefore been\n"
"# deleted).\n"
"function check_unique ()\n"
"{\n"
" # NB. When there are hard-links to this file, these are\n"
" # _not_ deleted. In fact, if there are hard-links, they\n"
" # all have the same date/time, thus making them ready\n"
" # for deletion later on.\n"
"\n"
" # Build the list of all man pages with the same name\n"
" DIR=$1\n"
" BASENAME=`basename \"${2}\" .bz2`\n"
" BASENAME=`basename \"${BASENAME}\" .gz`\n"
" GZ_FILE=\"$BASENAME\".gz\n"
" BZ_FILE=\"$BASENAME\".bz2\n"
"\n"
" # Look for, and keep, the most recent one\n"
" LATEST=`(cd \"$DIR\"; ls -1rt \"${BASENAME}\" \"${GZ_FILE}\" \"${BZ_FILE}\" \\\n"
" 2>/dev/null | tail -n 1)`\n"
" for i in \"${BASENAME}\" \"${GZ_FILE}\" \"${BZ_FILE}\"; do\n"
" [ \"$LATEST\" != \"$i\" ] && rm -f \"$DIR\"/\"$i\"\n"
" done\n"
"\n"
" # In case the specified file was the latest, return 0\n"
" [ \"$LATEST\" = \"$2\" ] && return 0\n"
" # If the file was not the latest, return 1\n"
" return 1\n"
"}\n"
"\n"
"# Name of the script\n"
"MY_NAME=`basename $0`\n"
"\n"
"# OK, parse the command-line for arguments, and initialize to some\n"
"# sensible state, that is: don't change links state, parse\n"
"# /etc/man_db.conf, be most silent, search man_db.conf in /etc, and don't\n"
"# force (re-)compression.\n"
"COMP_METHOD=\n"
"COMP_SUF=\n"
"COMP_LVL=\n"
"FORCE_OPT=\n"
"LN_OPT=\n"
"MAN_DIR=\n"
"VERBOSE_LVL=0\n"
"BACKUP=no\n"
"FAKE=no\n"
"MAN_CONF=/etc\n"
"while [ -n \"$1\" ]; do\n"
" case $1 in\n"
" --gzip|--gz|-g)\n"
" COMP_SUF=.gz\n"
" COMP_METHOD=$1\n"
" shift\n"
" ;;\n"
" --bzip2|--bz2|-b)\n"
" COMP_SUF=.bz2\n"
" COMP_METHOD=$1\n"
" shift\n"
" ;;\n"
" --automatic)\n"
" COMP_SUF=TBD\n"
" COMP_METHOD=$1\n"
" shift\n"
" ;;\n"
" --decompress|-d)\n"
" COMP_SUF=\n"
" COMP_LVL=\n"
" COMP_METHOD=$1\n"
" shift\n"
" ;;\n"
" -[1-9]|--fast|--best)\n"
" COMP_LVL=$1\n"
" shift\n"
" ;;\n"
" --force|-F)\n"
" FORCE_OPT=-F\n"
" shift\n"
" ;;\n"
" --soft|-S)\n"
" LN_OPT=-S\n"
" shift\n"
" ;;\n"
" --hard|-H)\n"
" LN_OPT=-H\n"
" shift\n"
" ;;\n"
" --conf=*)\n"
" MAN_CONF=`echo $1 | cut -d '=' -f2-`\n"
" shift\n"
" ;;\n"
" --conf)\n"
" MAN_CONF=\"$2\"\n"
" shift 2\n"
" ;;\n"
" --verbose|-v)\n"
" let VERBOSE_LVL++\n"
" shift\n"
" ;;\n"
" --backup)\n"
" BACKUP=yes\n"
" shift\n"
" ;;\n"
" --fake|-f)\n"
" FAKE=yes\n"
" shift\n"
" ;;\n"
" --help|-h)\n"
" help\n"
" exit 0\n"
" ;;\n"
" /*)\n"
" MAN_DIR=\"${MAN_DIR} ${1}\"\n"
" shift\n"
" ;;\n"
" -*)\n"
" help $1\n"
" exit 1\n"
" ;;\n"
" *)\n"
" echo \"\\\"$1\\\" is not an absolute path name\"\n"
" exit 1\n"
" ;;\n"
" esac\n"
"done\n"
"\n"
"# Redirections\n"
"case $VERBOSE_LVL in\n"
" 0)\n"
" # O, be silent\n"
" DEST_FD0=/dev/null\n"
" DEST_FD1=/dev/null\n"
" VERBOSE_OPT=\n"
" ;;\n"
" 1)\n"
" # 1, be a bit verbose\n"
" DEST_FD0=/dev/stdout\n"
" DEST_FD1=/dev/null\n"
" VERBOSE_OPT=-v\n"
" ;;\n"
" *)\n"
" # 2 and above, be most verbose\n"
" DEST_FD0=/dev/stdout\n"
" DEST_FD1=/dev/stdout\n"
" VERBOSE_OPT=\"-v -v\"\n"
" ;;\n"
"esac\n"
"\n"
"# Note: on my machine, 'man --path' gives /usr/share/man twice, once\n"
"# with a trailing '/', once without.\n"
"if [ -z \"$MAN_DIR\" ]; then\n"
" MAN_DIR=`manpath -q -C \"$MAN_CONF\"/man_db.conf \\\n"
" | sed 's/:/\\\\n/g' \\\n"
" | while read foo; do dirname \"$foo\"/.; done \\\n"
" | sort -u \\\n"
" | while read bar; do echo -n \"$bar \"; done`\n"
"fi\n"
"\n"
"# If no MANDATORY_MANPATH in ${MAN_CONF}/man_db.conf, abort as well\n"
"if [ -z \"$MAN_DIR\" ]; then\n"
" echo \"No directory specified, and no directory found with \\`manpath'\"\n"
" exit 1\n"
"fi\n"
"\n"
"# Check that the specified directories actually exist and are readable\n"
"for DIR in $MAN_DIR; do\n"
" if [ ! -d \"$DIR\" -o ! -r \"$DIR\" ]; then\n"
" echo \"Directory '$DIR' does not exist or is not readable\"\n"
" exit 1\n"
" fi\n"
"done\n"
"\n"
"# Fake?\n"
"if [ \"$FAKE\" != \"no\" ]; then\n"
" echo \"Actual parameters used:\"\n"
" echo -n \"Compression.......: \"\n"
" case $COMP_METHOD in\n"
" --bzip2|--bz2|-b) echo -n \"bzip2\";;\n"
" --gzip|--gz|-g) echo -n \"gzip\";;\n"
" --automatic) echo -n \"compressing\";;\n"
" --decompress|-d) echo -n \"decompressing\";;\n"
" *) echo -n \"unknown\";;\n"
" esac\n"
" echo \" ($COMP_METHOD)\"\n"
" echo \"Compression level.: $COMP_LVL\"\n"
" echo \"Compression suffix: $COMP_SUF\"\n"
" echo -n \"Force compression.: \"\n"
" [ \"foo$FORCE_OPT\" = \"foo-F\" ] && echo \"yes\" || echo \"no\"\n"
" echo \"man_db.conf is....: ${MAN_CONF}/man_db.conf\"\n"
" echo -n \"Hard-links........: \"\n"
" [ \"foo$LN_OPT\" = \"foo-S\" ] &&\n"
" echo \"convert to soft-links\" || echo \"leave as is\"\n"
" echo -n \"Soft-links........: \"\n"
" [ \"foo$LN_OPT\" = \"foo-H\" ] &&\n"
" echo \"convert to hard-links\" || echo \"leave as is\"\n"
" echo \"Backup............: $BACKUP\"\n"
" echo \"Faking (yes!).....: $FAKE\"\n"
" echo \"Directories.......: $MAN_DIR\"\n"
" echo \"Verbosity level...: $VERBOSE_LVL\"\n"
" exit 0\n"
"fi\n"
"\n"
"# If no method was specified, print help\n"
"if [ -z \"${COMP_METHOD}\" -a \"${BACKUP}\" = \"no\" ]; then\n"
" help\n"
" exit 1\n"
"fi\n"
"\n"
"# In backup mode, do the backup solely\n"
"if [ \"$BACKUP\" = \"yes\" ]; then\n"
" for DIR in $MAN_DIR; do\n"
" cd \"${DIR}/..\"\n"
" if [ ! -w \"`pwd`\" ]; then\n"
" echo \"Directory '`pwd`' is not writable\"\n"
" exit 1\n"
" fi\n"
" DIR_NAME=`basename \"${DIR}\"`\n"
" echo \"Backing up $DIR...\" > $DEST_FD0\n"
" [ -f \"${DIR_NAME}.tar.old\" ] && rm -f \"${DIR_NAME}.tar.old\"\n"
" [ -f \"${DIR_NAME}.tar\" ] &&\n"
" mv \"${DIR_NAME}.tar\" \"${DIR_NAME}.tar.old\"\n"
" tar -cvf \"${DIR_NAME}.tar\" \"${DIR_NAME}\" > $DEST_FD1\n"
" done\n"
" exit 0\n"
"fi\n"
"\n"
"# I know MAN_DIR has only absolute path names\n"
"# I need to take into account the localized man, so I'm going recursive\n"
"for DIR in $MAN_DIR; do\n"
" MEM_DIR=`pwd`\n"
" if [ ! -w \"$DIR\" ]; then\n"
" echo \"Directory '$DIR' is not writable\"\n"
" exit 1\n"
" fi\n"
" cd \"$DIR\"\n"
" for FILE in *; do\n"
" # Fixes the case were the directory is empty\n"
" if [ \"foo$FILE\" = \"foo*\" ]; then continue; fi\n"
"\n"
" # Fixes the case when hard-links see their compression scheme change\n"
" # (from not compressed to compressed, or from bz2 to gz, or from gz\n"
" # to bz2)\n"
" # Also fixes the case when multiple version of the page are present,\n"
" # which are either compressed or not.\n"
" if [ ! -L \"$FILE\" -a ! -e \"$FILE\" ]; then continue; fi\n"
"\n"
" # Do not compress whatis files\n"
" if [ \"$FILE\" = \"whatis\" ]; then continue; fi\n"
"\n"
" if [ -d \"$FILE\" ]; then\n"
" # We are going recursive to that directory\n"
" echo \"-> Entering ${DIR}/${FILE}...\" > $DEST_FD0\n"
" # I need not pass --conf, as I specify the directory to work on\n"
" # But I need exit in case of error. We must change back to the\n"
" # original directory so $0 is resolved correctly.\n"
" (cd \"$MEM_DIR\" && eval \"$0\" ${COMP_METHOD} ${COMP_LVL} ${LN_OPT} \\\n"
" ${VERBOSE_OPT} ${FORCE_OPT} \"${DIR}/${FILE}\") || exit $?\n"
" echo \"<- Leaving ${DIR}/${FILE}.\" > $DEST_FD1\n"
"\n"
" else # !dir\n"
" if ! check_unique \"$DIR\" \"$FILE\"; then continue; fi\n"
"\n"
" # With automatic compression, get the uncompressed file size of\n"
" # the file (dereferencing symlinks), and choose an appropriate\n"
" # compression method.\n"
" if [ \"$COMP_METHOD\" = \"--automatic\" ]; then\n"
" declare -i SIZE\n"
" case \"$FILE\" in\n"
" *.bz2)\n"
" SIZE=$(bzcat \"$FILE\" | wc -c) ;;\n"
" *.gz)\n"
" SIZE=$(zcat \"$FILE\" | wc -c) ;;\n"
" *)\n"
" SIZE=$(wc -c < \"$FILE\") ;;\n"
" esac\n"
" if (( $SIZE >= (5 * 2**10) )); then\n"
" COMP_SUF=.bz2\n"
" elif (( $SIZE >= (1 * 2**10) )); then\n"
" COMP_SUF=.gz\n"
" else\n"
" COMP_SUF=\n"
" fi\n"
" fi\n"
"\n"
" # Check if the file is already compressed with the specified method\n"
" BASE_FILE=`basename \"$FILE\" .gz`\n"
" BASE_FILE=`basename \"$BASE_FILE\" .bz2`\n"
" if [ \"${FILE}\" = \"${BASE_FILE}${COMP_SUF}\" \\\n"
" -a \"foo${FORCE_OPT}\" = \"foo\" ]; then continue; fi\n"
"\n"
" # If we have a symlink\n"
" if [ -h \"$FILE\" ]; then\n"
" case \"$FILE\" in\n"
" *.bz2)\n"
" EXT=bz2 ;;\n"
" *.gz)\n"
" EXT=gz ;;\n"
" *)\n"
" EXT=none ;;\n"
" esac\n"
"\n"
" if [ ! \"$EXT\" = \"none\" ]; then\n"
" LINK=`ls -l \"$FILE\" | cut -d \">\" -f2 \\\n"
" | tr -d \" \" | sed s/\\.$EXT$//`\n"
" NEWNAME=`echo \"$FILE\" | sed s/\\.$EXT$//`\n"
" mv \"$FILE\" \"$NEWNAME\"\n"
" FILE=\"$NEWNAME\"\n"
" else\n"
" LINK=`ls -l \"$FILE\" | cut -d \">\" -f2 | tr -d \" \"`\n"
" fi\n"
"\n"
" if [ \"$LN_OPT\" = \"-H\" ]; then\n"
" # Change this soft-link into a hard- one\n"
" rm -f \"$FILE\" && ln \"${LINK}$COMP_SUF\" \"${FILE}$COMP_SUF\"\n"
" chmod --reference \"${LINK}$COMP_SUF\" \"${FILE}$COMP_SUF\"\n"
" else\n"
" # Keep this soft-link a soft- one.\n"
" rm -f \"$FILE\" && ln -s \"${LINK}$COMP_SUF\" \"${FILE}$COMP_SUF\"\n"
" fi\n"
" echo \"Relinked $FILE\" > $DEST_FD1\n"
"\n"
" # else if we have a plain file\n"
" elif [ -f \"$FILE\" ]; then\n"
" # Take care of hard-links: build the list of files hard-linked\n"
" # to the one we are {de,}compressing.\n"
" # NB. This is not optimum has the file will eventually be\n"
" # compressed as many times it has hard-links. But for now,\n"
" # that's the safe way.\n"
" inode=`ls -li \"$FILE\" | awk '{print $1}'`\n"
" HLINKS=`find . \\! -name \"$FILE\" -inum $inode`\n"
"\n"
" if [ -n \"$HLINKS\" ]; then\n"
" # We have hard-links! Remove them now.\n"
" for i in $HLINKS; do rm -f \"$i\"; done\n"
" fi\n"
"\n"
" # Now take care of the file that has no hard-link\n"
" # We do decompress first to re-compress with the selected\n"
" # compression ratio later on...\n"
" case \"$FILE\" in\n"
" *.bz2)\n"
" bunzip2 $FILE\n"
" FILE=`basename \"$FILE\" .bz2`\n"
" ;;\n"
" *.gz)\n"
" gunzip $FILE\n"
" FILE=`basename \"$FILE\" .gz`\n"
" ;;\n"
" esac\n"
"\n"
" # Compress the file with the given compression ratio, if needed\n"
" case $COMP_SUF in\n"
" *bz2)\n"
" bzip2 ${COMP_LVL} \"$FILE\" && chmod 644 \"${FILE}${COMP_SUF}\"\n"
" echo \"Compressed $FILE\" > $DEST_FD1\n"
" ;;\n"
" *gz)\n"
" gzip ${COMP_LVL} \"$FILE\" && chmod 644 \"${FILE}${COMP_SUF}\"\n"
" echo \"Compressed $FILE\" > $DEST_FD1\n"
" ;;\n"
" *)\n"
" echo \"Uncompressed $FILE\" > $DEST_FD1\n"
" ;;\n"
" esac\n"
"\n"
" # If the file had hard-links, recreate those (either hard or soft)\n"
" if [ -n \"$HLINKS\" ]; then\n"
" for i in $HLINKS; do\n"
" NEWFILE=`echo \"$i\" | sed s/\\.gz$// | sed s/\\.bz2$//`\n"
" if [ \"$LN_OPT\" = \"-S\" ]; then\n"
" # Make this hard-link a soft- one\n"
" ln -s \"${FILE}$COMP_SUF\" \"${NEWFILE}$COMP_SUF\"\n"
" else\n"
" # Keep the hard-link a hard- one\n"
" ln \"${FILE}$COMP_SUF\" \"${NEWFILE}$COMP_SUF\"\n"
" fi\n"
" # Really work only for hard-links. Harmless for soft-links\n"
" chmod 644 \"${NEWFILE}$COMP_SUF\"\n"
" done\n"
" fi\n"
"\n"
" else\n"
" # There is a problem when we get neither a symlink nor a plain\n"
" # file. Obviously, we shall never ever come here... :-(\n"
" echo -n \"Whaooo... \\\"${DIR}/${FILE}\\\" is neither a symlink \"\n"
" echo \"nor a plain file. Please check:\"\n"
" ls -l \"${DIR}/${FILE}\"\n"
" exit 1\n"
" fi\n"
" fi\n"
" done # for FILE\n"
"done # for DIR</literal>\n"
"\n"
"EOF</userinput>"
#. type: Content of: <sect1><note><para>
#: blfs-en/archive/compressdoc.xml:567
msgid ""
"Doing a very large copy/paste directly to a terminal may result in a "
"corrupted file. Copying to an editor may overcome this issue."
msgstr ""
"Faire un grand copier/coller directement dans un terminal peut engendrer un "
"fichier corrompu. Copier dans un éditeur peut résoudre ce problème."
#. type: Content of: <sect1><para>
#: blfs-en/archive/compressdoc.xml:572
msgid ""
"As <systemitem class=\"username\">root</systemitem>, make "
"<command>compressdoc</command> executable for all users:"
msgstr ""
"En tant qu'utilisateur <systemitem class=\"username\">root</systemitem>, "
"rendez exécutable <command>compressdoc</command> pour tous les "
"utilisateurs :"
#. type: Content of: <sect1><screen>
#: blfs-en/archive/compressdoc.xml:575
#, no-wrap
msgid "<userinput>chmod -v 755 /usr/sbin/compressdoc</userinput>"
msgstr "<userinput>chmod -v 755 /usr/sbin/compressdoc</userinput>"
#. type: Content of: <sect1><para>
#: blfs-en/archive/compressdoc.xml:577
msgid ""
"Now, as <systemitem class=\"username\">root</systemitem>, you can issue the "
"command <command>compressdoc --bz2</command> to compress all your system man "
"pages. You can also run <command>compressdoc --help</command> to get "
"comprehensive help about what the script is able to do."
msgstr ""
"Maintenant, en tant qu'utilisateur <systemitem class=\"username\">root</"
"systemitem>, vous pouvez exécuter la commande <command>compressdoc --bz2</"
"command> pour compresser toutes les pages de man de votre système. Vous "
"pouvez aussi lancer <command>compressdoc --help</command> pour obtenir une "
"aide complète sur les possibilités du script."
#. type: Content of: <sect1><para>
#: blfs-en/archive/compressdoc.xml:582
msgid ""
"Don't forget that a few programs, like the <application>X Window System</"
"application> and <application>XEmacs</application> also install their "
"documentation in non-standard places (such as <filename class=\"directory\">/"
"usr/X11R6/man</filename>, etc.). Be sure to add these locations to the file "
"<filename>/etc/man_db.conf</filename>, as <envar>MANDATORY_MANPATH</envar> "
"<replaceable></path></replaceable> lines."
msgstr ""
"N'oubliez pas que quelques paquets tels que le <application>Système X "
"Window</application> et <application>XEmacs</application> installent aussi "
"leur documentation à des endroits non standards (tels que <filename class="
"\"directory\">/usr/X11R6/man</filename>, etc.). Assurez-vous d'ajouter ces "
"emplacements au fichier <filename>/etc/man_db.conf</filename>, sous forme de "
"lignes <envar>MANDATORY_MANPATH</envar> <replaceable></chemin></"
"replaceable>."
#. type: Content of: <sect1><para>
#: blfs-en/archive/compressdoc.xml:590
msgid "Example:"
msgstr "Exemple :"
#. type: Content of: <sect1><screen>
#: blfs-en/archive/compressdoc.xml:592
#, no-wrap
msgid ""
"<literal> ...\n"
" MANDATORY_MANPATH /usr/share/man\n"
" MANDATORY_MANPATH /usr/X11R6/man\n"
" MANDATORY_MANPATH /usr/local/man\n"
" MANDATORY_MANPATH /opt/qt/doc/man\n"
" ...</literal>"
msgstr ""
"<literal> ...\n"
" MANDATORY_MANPATH /usr/share/man\n"
" MANDATORY_MANPATH /usr/X11R6/man\n"
" MANDATORY_MANPATH /usr/local/man\n"
" MANDATORY_MANPATH /opt/qt/doc/man\n"
" ...</literal>"
#. type: Content of: <sect1><para>
#: blfs-en/archive/compressdoc.xml:599
msgid ""
"Generally, package installation systems do not compress 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 running the "
"script after upgrading a package is safe; when you have several versions of "
"a page (for example, one compressed and one uncompressed), the most recent "
"one is kept and the others are deleted."
msgstr ""
"En général, les systèmes d'installation des paquets ne compressent pas les "
"pages de man/info, ce qui veut dire que vous devrez de nouveau lancer le "
"script si vous voulez maintenir la taille de documentation la plus petite "
"possible. Remarquez aussi que l'exécution du script après la mise à jour "
"d'un paquet est sécurisée ; quand vous avez plusieurs versions d'une "
"page (par exemple, une compressée et une décompressée), celle la plus "
"récente est conservée et les autres sont effacées."