Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Jul 2015 09:10:04 +0000 (UTC)
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r285835 - head/usr.bin/man
Message-ID:  <201507240910.t6O9A4Cj096922@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bapt
Date: Fri Jul 24 09:10:03 2015
New Revision: 285835
URL: https://svnweb.freebsd.org/changeset/base/285835

Log:
  Fix man -k with mandocdb
  
  If apropos(1) and whatis(1) are not hardlinks to man(1) that means the system is
  using mandocdb, then man -k should spawn apropos(1) and/or whatis(1) directly
  
  Reported by:	kevlo
  Tested by:	kevlo
  Sponsored by:	gandi.net

Modified:
  head/usr.bin/man/man.sh

Modified: head/usr.bin/man/man.sh
==============================================================================
--- head/usr.bin/man/man.sh	Fri Jul 24 07:46:02 2015	(r285834)
+++ head/usr.bin/man/man.sh	Fri Jul 24 09:10:03 2015	(r285835)
@@ -925,6 +925,8 @@ whatis_usage() {
 
 # Supported commands
 do_apropos() {
+	[ $(stat -f %i /usr/bin/man) -eq $(stat -f %i /usr/bin/apropos) ] && \
+		exec apropos "$@"
 	search_whatis apropos "$@"
 }
 
@@ -960,6 +962,8 @@ do_manpath() {
 }
 
 do_whatis() {
+	[ $(stat -f %i /usr/bin/man) -eq $(stat -f %i /usr/bin/whatis) ] && \
+		exec whatis "$@"
 	search_whatis whatis "$@"
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201507240910.t6O9A4Cj096922>