Ticket #1786: compressdoc-man_db-2.patch

File compressdoc-man_db-2.patch, 3.0 KB (added by dnicholson@…, 19 years ago)

Patch using `manpath' utility

  • TabularUnified compressdoc

    old new  
    2020# Modified 20050112 by Randy McMurchy to shorten line lengths and
    2121# correct grammar errors.
    2222#
     23# Modified 20060128 by Alexander E. Patrakov for compatibility with Man-DB
     24#
     25# Modified 20060311 by Archaic to use Man-DB manpath utility which is a
     26# replacement for man --path from Man.
     27#
    2328# TODO:
    2429#     - choose a default compress method to be based on the available
    2530#       tool : gzip or bzip2;
     
    7479                backup mode.
    7580
    7681  --conf=dir, --conf dir
    77                 Specify the location of man.conf. Defaults to /etc.
     82                Specify the location of man_db.conf. Defaults to /etc.
    7883
    7984  --verbose, -v Verbose mode, print the name of the directory being
    8085                processed. Double the flag to turn it even more verbose,
    8186                and to print the name of the file being processed.
    8287
    83   --fake, -f    Fakes it. Print the actual parameters compman will use.
     88  --fake, -f    Fakes it. Print the actual parameters compressdoc will use.
    8489
    8590  dirs          A list of space-separated _absolute_ pathnames to the
    86                 man directories. When empty, and only then, parse
    87                 ${MAN_CONF}/man.conf for all occurrences of MANPATH.
     91                man directories. When empty, and only then, use manpath
     92                to parse ${MAN_CONF}/man_db.conf for all valid occurrences
     93                of MANDATORY_MANPATH.
    8894
    8995Note about compression:
    9096  There has been a discussion on blfs-support about compression ratios of
     
    149155
    150156# OK, parse the command-line for arguments, and initialize to some
    151157# sensible state, that is: don't change links state, parse
    152 # /etc/man.conf, be most silent, search man.conf in /etc, and don't
     158# /etc/man_db.conf, be most silent, search man_db.conf in /etc, and don't
    153159# force (re-)compression.
    154160COMP_METHOD=
    155161COMP_SUF=
     
    259265# Note: on my machine, 'man --path' gives /usr/share/man twice, once
    260266# with a trailing '/', once without.
    261267if [ -z "$MAN_DIR" ]; then
    262   MAN_DIR=`man --path -C "$MAN_CONF"/man.conf \
     268  MAN_DIR=`manpath -C "$MAN_CONF"/man_db.conf \
    263269            | sed 's/:/\\n/g' \
    264270            | while read foo; do dirname "$foo"/.; done \
    265271            | sort -u \
    266272            | while read bar; do echo -n "$bar "; done`
    267273fi
    268274
    269 # If no MANPATH in ${MAN_CONF}/man.conf, abort as well
     275# If no MANDATORY_MANPATH in ${MAN_CONF}/man_db.conf, abort as well
    270276if [ -z "$MAN_DIR" ]; then
    271   echo "No directory specified, and no directory found with \`man --path'"
     277  echo "No directory specified, and no directory found with \`manpath'"
    272278  exit 1
    273279fi
    274280
     
    287293  echo "Compression suffix: $COMP_SUF"
    288294  echo -n "Force compression.: "
    289295  [ "foo$FORCE_OPT" = "foo-F" ] && echo "yes" || echo "no"
    290   echo "man.conf is.......: ${MAN_CONF}/man.conf"
     296  echo "man_db.conf is....: ${MAN_CONF}/man_db.conf"
    291297  echo -n "Hard-links........: "
    292298  [ "foo$LN_OPT" = "foo-S" ] &&
    293299  echo "convert to soft-links" || echo "leave as is"