[Beyond Linux From Scratch] #1775: Adapt compressdoc script to Man-DB

Beyond Linux From Scratch trac at linuxfromscratch.org
Sat Jan 28 06:50:44 PST 2006


#1775: Adapt compressdoc script to Man-DB
--------------------------------------------+-------------------------------
 Reporter:  alexander at linuxfromscratch.org  |        Owner:  blfs-book at linuxfromscratch.org
     Type:  defect                          |       Status:  new                           
 Priority:  normal                          |    Milestone:                                
Component:  BOOK                            |      Version:                                
 Severity:  normal                          |   Resolution:                                
 Keywords:                                  |  
--------------------------------------------+-------------------------------
Comment (by alexander at linuxfromscratch.org):

 Proposed patch:

 {{{
 --- compressdoc.orig    2006-01-28 13:57:43.000000000 +0000
 +++ compressdoc 2006-01-28 14:18:11.000000000 +0000
 @@ -20,6 +20,8 @@
  # Modified 20050112 by Randy McMurchy to shorten line lengths and
  # correct grammar errors.
  #
 +# Modified 20060128 by Alexander E. Patrakov for compatibility with Man-
 DB
 +#
  # TODO:
  #     - choose a default compress method to be based on the available
  #       tool : gzip or bzip2;
 @@ -74,7 +76,7 @@
                  backup mode.

    --conf=dir, --conf dir
 -                Specify the location of man.conf. Defaults to /etc.
 +                Specify the location of man_db.conf. Defaults to /etc.

    --verbose, -v Verbose mode, print the name of the directory being
                  processed. Double the flag to turn it even more verbose,
 @@ -84,7 +86,8 @@

    dirs          A list of space-separated _absolute_ pathnames to the
                  man directories. When empty, and only then, parse
 -                ${MAN_CONF}/man.conf for all occurrences of MANPATH.
 +                ${MAN_CONF}/man_db.conf for all occurrences of
 +                MANDATORY_MANPATH.

  Note about compression:
    There has been a discussion on blfs-support about compression ratios of
 @@ -149,7 +152,7 @@

  # 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
 +# /etc/man_db.conf, be most silent, search man_db.conf in /etc, and don't
  # force (re-)compression.
  COMP_METHOD=
  COMP_SUF=
 @@ -259,16 +262,16 @@
  # Note: on my machine, 'man --path' gives /usr/share/man twice, once
  # with a trailing '/', once without.
  if [ -z "$MAN_DIR" ]; then
 -  MAN_DIR=`man --path -C "$MAN_CONF"/man.conf \
 -            | sed 's/:/\\n/g' \
 +  MAN_DIR=`sed -n 's@^MANDATORY_MANPATH[^/]*\(/.*\)$@\1@ p' \
 +              "$MAN_CONF"/man_db.conf \
              | while read foo; do dirname "$foo"/.; done \
              | sort -u \
              | while read bar; do echo -n "$bar "; done`
  fi

 -# If no MANPATH in ${MAN_CONF}/man.conf, abort as well
 +# If no MANPATH in ${MAN_CONF}/man_db.conf, abort as well
  if [ -z "$MAN_DIR" ]; then
 -  echo "No directory specified, and no directory found with \`man
 --path'"
 +  echo "No directory specified, and no directory found in man_db.conf"
    exit 1
  fi

 @@ -287,7 +290,7 @@
    echo "Compression suffix: $COMP_SUF"
    echo -n "Force compression.: "
    [ "foo$FORCE_OPT" = "foo-F" ] && echo "yes" || echo "no"
 -  echo "man.conf is.......: ${MAN_CONF}/man.conf"
 +  echo "man_db.conf is.......: ${MAN_CONF}/man_db.conf"
    echo -n "Hard-links........: "
    [ "foo$LN_OPT" = "foo-S" ] &&
    echo "convert to soft-links" || echo "leave as is"

 }}}

-- 
Ticket URL: <http://wiki.linuxfromscratch.org/blfs/ticket/1775>
Beyond Linux From Scratch <http://wiki.linuxfromscratch.org/blfs>
Your Distro, Your Rules


More information about the blfs-book mailing list