Ticket #1786: compressdoc-fix.patch

File compressdoc-fix.patch, 2.7 KB (added by alexander@…, 19 years ago)
  • 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#
    2325# TODO:
    2426#     - choose a default compress method to be based on the available
    2527#       tool : gzip or bzip2;
     
    7476                backup mode.
    7577
    7678  --conf=dir, --conf dir
    77                 Specify the location of man.conf. Defaults to /etc.
     79                Specify the location of man_db.conf. Defaults to /etc.
    7880
    7981  --verbose, -v Verbose mode, print the name of the directory being
    8082                processed. Double the flag to turn it even more verbose,
     
    8486
    8587  dirs          A list of space-separated _absolute_ pathnames to the
    8688                man directories. When empty, and only then, parse
    87                 ${MAN_CONF}/man.conf for all occurrences of MANPATH.
     89                ${MAN_CONF}/man_db.conf for all occurrences of
     90                MANDATORY_MANPATH.
    8891
    8992Note about compression:
    9093  There has been a discussion on blfs-support about compression ratios of
     
    149152
    150153# OK, parse the command-line for arguments, and initialize to some
    151154# 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
     155# /etc/man_db.conf, be most silent, search man_db.conf in /etc, and don't
    153156# force (re-)compression.
    154157COMP_METHOD=
    155158COMP_SUF=
     
    259262# Note: on my machine, 'man --path' gives /usr/share/man twice, once
    260263# with a trailing '/', once without.
    261264if [ -z "$MAN_DIR" ]; then
    262   MAN_DIR=`man --path -C "$MAN_CONF"/man.conf \
    263             | sed 's/:/\\n/g' \
     265  MAN_DIR=`sed -n 's@^MANDATORY_MANPATH[^/]*\(/.*\)$@\1@ p' \
     266              "$MAN_CONF"/man_db.conf \
    264267            | while read foo; do dirname "$foo"/.; done \
    265268            | sort -u \
    266269            | while read bar; do echo -n "$bar "; done`
    267270fi
    268271
    269 # If no MANPATH in ${MAN_CONF}/man.conf, abort as well
     272# If no MANPATH in ${MAN_CONF}/man_db.conf, abort as well
    270273if [ -z "$MAN_DIR" ]; then
    271   echo "No directory specified, and no directory found with \`man --path'"
     274  echo "No directory specified, and no directory found in man_db.conf"
    272275  exit 1
    273276fi
    274277
     
    287290  echo "Compression suffix: $COMP_SUF"
    288291  echo -n "Force compression.: "
    289292  [ "foo$FORCE_OPT" = "foo-F" ] && echo "yes" || echo "no"
    290   echo "man.conf is.......: ${MAN_CONF}/man.conf"
     293  echo "man_db.conf is.......: ${MAN_CONF}/man_db.conf"
    291294  echo -n "Hard-links........: "
    292295  [ "foo$LN_OPT" = "foo-S" ] &&
    293296  echo "convert to soft-links" || echo "leave as is"