( cd usr/bin ; rm -rf apropos )
( cd usr/bin ; ln -sf whatis apropos )
( cd usr/lib64 ; rm -rf libpipeline.so )
( cd usr/lib64 ; ln -sf libpipeline.so.1.5.7 libpipeline.so )
( cd usr/lib64 ; rm -rf libpipeline.so.1 )
( cd usr/lib64 ; ln -sf libpipeline.so.1.5.7 libpipeline.so.1 )
( cd usr/lib64/man-db ; rm -rf libman.so )
( cd usr/lib64/man-db ; ln -sf libman-2.12.1.so libman.so )
( cd usr/lib64/man-db ; rm -rf libmandb.so )
( cd usr/lib64/man-db ; ln -sf libmandb-2.12.1.so libmandb.so )
( cd usr/man/man3 ; rm -rf pipecmd_arg.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_arg.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_argf.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_argf.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_args.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_args.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_argstr.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_argstr.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_argv.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_argv.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_chdir.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_chdir.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_clearenv.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_clearenv.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_discard_err.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_discard_err.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_dump.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_dump.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_dup.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_dup.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_exec.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_exec.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_fchdir.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_fchdir.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_free.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_free.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_get_nargs.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_get_nargs.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_new.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_new.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_new_args.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_new_args.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_new_argstr.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_new_argstr.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_new_argv.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_new_argv.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_new_function.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_new_function.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_new_passthrough.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_new_passthrough.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_new_sequence.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_new_sequence.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_new_sequencev.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_new_sequencev.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_nice.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_nice.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_pre_exec.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_pre_exec.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_sequence_command.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_sequence_command.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_setenv.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_setenv.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_tostring.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_tostring.3.gz )
( cd usr/man/man3 ; rm -rf pipecmd_unsetenv.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipecmd_unsetenv.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_command.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_command.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_command_args.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_command_args.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_command_argstr.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_command_argstr.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_command_argv.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_command_argv.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_commands.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_commands.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_commandv.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_commandv.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_connect.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_connect.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_dump.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_dump.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_free.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_free.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_get_command.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_get_command.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_get_infile.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_get_infile.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_get_ncommands.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_get_ncommands.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_get_outfile.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_get_outfile.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_get_pid.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_get_pid.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_ignore_signals.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_ignore_signals.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_install_post_fork.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_install_post_fork.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_join.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_join.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_new.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_new.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_new_command_args.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_new_command_args.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_new_command_argv.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_new_command_argv.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_new_commands.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_new_commands.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_new_commandv.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_new_commandv.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_peek.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_peek.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_peek_size.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_peek_size.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_peek_skip.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_peek_skip.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_peekline.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_peekline.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_pump.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_pump.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_read.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_read.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_readline.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_readline.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_run.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_run.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_set_command.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_set_command.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_start.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_start.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_tostring.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_tostring.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_wait.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_wait.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_wait_all.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_wait_all.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_want_in.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_want_in.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_want_infile.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_want_infile.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_want_out.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_want_out.3.gz )
( cd usr/man/man3 ; rm -rf pipeline_want_outfile.3.gz )
( cd usr/man/man3 ; ln -sf libpipeline.3.gz pipeline_want_outfile.3.gz )


config() {
  NEW="$1"
  OLD="$(dirname $NEW)/$(basename $NEW .new)"
  # If there's no config file by that name, mv it over:
  if [ ! -r $OLD ]; then
    mv $NEW $OLD
  elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
    # toss the redundant copy
    rm $NEW
  fi
  # Otherwise, we leave the .new copy for the admin to consider...
}
config etc/man_db.conf.new
config etc/profile.d/man-db.csh.new
config etc/profile.d/man-db.sh.new

# Slackware change: commenting the stuff below out. We're not going to
# generate a database during a package installation...  especially since
# it appears that it only provides "whatis" services. The rest of the
# manpage system works fine without it. So, people can wait until the
# first time the cron job runs (or root can run it manually), just like
# "locate" has been handled forever.

## In English, the if/find below means "only run the database creation if
## it was last done over an hour ago". This is needed because upgradepkg
## runs doinst.sh twice, but I don't want the 10+ minute long database
## creation to happen twice on upgrade (or at all, when I'm repeatedly
## reinstalling man-db for testing purposes).
#
#if  \
#  [ ! -e /var/cache/man/man-db ] || \
#  [ -n "$( find var/cache/man/ -type d -a -name man-db -a -mmin +60 )" ]
#then
## Generate the initial man database (or rebuild it if it exists).
## We want to skip this step if installing somewhere besides / (e.g. with
## the -root option or ROOT env variable set for installpkg), hence the
## readlink silliness.
#
## The -c option means it blows away any existing db. I thought about
## leaving it off (it will still create the db if it doesn't exist),
## but decided it's better to build it fresh if the package gets
## reinstalled (in case the db format has changed, or in case the
## db is corrupted and the user is trying to fix it by reinstalling
## this package).
#
## the 2>/dev/null was added for 2.7.6 because it complains about
## missing CACHEDIR.TAG files... which don't matter, because we've
## got NOCACHE in the config file.
#  ( \
#    [ -x /bin/readlink ] && \
#    [ "$( /bin/readlink -f $( pwd ) )" = "/" ] && \
#    ( [ -x /opt/man-db/bin/mandb ] && /opt/man-db/bin/mandb -c -q ) || \
#    ( [ -x /usr/bin/mandb ] && /usr/bin/mandb -c -q ) \
#  ) 2>/dev/null
#fi
