[Midnightbsd-cvs] src [9738] U trunk/usr.bin/man: update man and sync with freebsd 12 current

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Fri Jan 19 00:03:07 EST 2018


Revision: 9738
          http://svnweb.midnightbsd.org/src/?rev=9738
Author:   laffer1
Date:     2018-01-19 00:03:06 -0500 (Fri, 19 Jan 2018)
Log Message:
-----------
update man and sync with freebsd 12 current

Modified Paths:
--------------
    trunk/usr.bin/man/Makefile
    trunk/usr.bin/man/man.1
    trunk/usr.bin/man/man.conf.5
    trunk/usr.bin/man/man.sh
    trunk/usr.bin/man/manpath.1

Removed Paths:
-------------
    trunk/usr.bin/man/apropos.1

Property Changed:
----------------
    trunk/usr.bin/man/man.1
    trunk/usr.bin/man/man.conf.5
    trunk/usr.bin/man/man.sh
    trunk/usr.bin/man/manpath.1

Modified: trunk/usr.bin/man/Makefile
===================================================================
--- trunk/usr.bin/man/Makefile	2018-01-19 04:37:57 UTC (rev 9737)
+++ trunk/usr.bin/man/Makefile	2018-01-19 05:03:06 UTC (rev 9738)
@@ -1,11 +1,9 @@
 # $MidnightBSD$
+# $FreeBSD: head/usr.bin/man/Makefile 315057 2017-03-11 06:51:21Z bapt $
 
 SCRIPTS= man.sh
-LINKS=	${BINDIR}/man ${BINDIR}/apropos \
-	${BINDIR}/man ${BINDIR}/manpath \
-	${BINDIR}/man ${BINDIR}/whatis
+LINKS=	${BINDIR}/man ${BINDIR}/manpath
 
-MAN=	man.1 manpath.1 apropos.1 man.conf.5
-MLINKS=	apropos.1 whatis.1
+MAN=	man.1 manpath.1 man.conf.5
 
 .include <bsd.prog.mk>

Deleted: trunk/usr.bin/man/apropos.1
===================================================================
--- trunk/usr.bin/man/apropos.1	2018-01-19 04:37:57 UTC (rev 9737)
+++ trunk/usr.bin/man/apropos.1	2018-01-19 05:03:06 UTC (rev 9738)
@@ -1,88 +0,0 @@
-.\"-
-.\"  Copyright (c) 2010 Gordon Tetlow
-.\"  All rights reserved.
-.\"
-.\"  Redistribution and use in source and binary forms, with or without
-.\"  modification, are permitted provided that the following conditions
-.\"  are met:
-.\"  1. Redistributions of source code must retain the above copyright
-.\"     notice, this list of conditions and the following disclaimer.
-.\"  2. Redistributions in binary form must reproduce the above copyright
-.\"     notice, this list of conditions and the following disclaimer in the
-.\"     documentation and/or other materials provided with the distribution.
-.\"
-.\"  THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-.\"  ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-.\"  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-.\"  ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-.\"  FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-.\"  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-.\"  OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-.\"  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-.\"  LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-.\"  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-.\"  SUCH DAMAGE.
-.\"
-.\" $MidnightBSD$
-.\"
-.Dd September 1, 2010
-.Dt APROPOS 1
-.Os
-.Sh NAME
-.Nm apropos ,
-.Nm whatis
-.Nd keyword search whatis documentation databases
-.Sh SYNOPSIS
-.Nm
-.Op Fl d
-.Ar keyword ...
-.Nm whatis
-.Op Fl d
-.Ar keyword ...
-.Sh DESCRIPTION
-The
-.Nm
-utility searches a set of databases looking for documentation matching each
-.Ar keyword
-and displays the results.
-The
-.Nm whatis
-utility does the same search but only on complete words.
-.Bl -tag -width ".Fl d"
-.It Fl d
-Print extra debugging information.
-.El
-.Pp
-The
-.Ar keyword
-is simply passed to
-.Xr grep 1
-allowing for extended regular expression matches.
-.Sh ENVIRONMENT
-The following environment variables affect the execution of
-.Nm :
-.Bl -tag -width ".Ev PAGER"
-.It Ev MANLOCALES , MANPATH , PATH
-Used to find the location of the
-.Nm whatis
-database files. See
-.Xr manpath 1
-for additional information.
-.It Ev PAGER
-Program used to display files.
-If unset,
-.Ic "more -s"
-is used.
-.El
-.Sh DIAGNOSTICS
-The
-.Nm
-utility exits 0 if a keyword matched and 1 if no keywords are matched or no
-.Nm whatis
-databases are found.
-.Sh SEE ALSO
-.Xr grep 1 ,
-.Xr makewhatis 1 ,
-.Xr man 1 ,
-.Xr manpath 1 ,
-.Xr man.conf 5

Modified: trunk/usr.bin/man/man.1
===================================================================
--- trunk/usr.bin/man/man.1	2018-01-19 04:37:57 UTC (rev 9737)
+++ trunk/usr.bin/man/man.1	2018-01-19 05:03:06 UTC (rev 9738)
@@ -23,9 +23,10 @@
 .\"  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\"  SUCH DAMAGE.
 .\"
+.\" $FreeBSD: head/usr.bin/man/man.1 327396 2017-12-31 00:35:11Z eadler $
 .\" $MidnightBSD$
 .\"
-.Dd June 3, 2011
+.Dd March 11, 2017
 .Dt MAN 1
 .Os
 .Sh NAME
@@ -58,6 +59,37 @@
 .Nm
 restricts the search to the specific section of the manual.
 .Pp
+The sections of the manual are:
+.Bl -enum -offset indent -compact
+.It
+.Mx
+General Commands Manual
+.It
+.Mx
+System Calls Manual
+.It
+.Mx
+Library Functions Manual
+.It
+.Mx
+Kernel Interfaces Manual
+.It
+.Mx
+File Formats Manual
+.It
+.Mx
+Games Manual
+.It
+.Mx
+Miscellaneous Information Manual
+.It
+.Mx
+System Manager's Manual
+.It
+.Mx
+Kernel Developer's Manual
+.El
+.Pp
 Options that
 .Nm
 understands:
@@ -211,11 +243,11 @@
 For example, if
 .Ev MACHINE_ARCH
 is set to
-.Dq Li i386
+.Dq Li aarch64
 and
 .Ev MACHINE
 is set to
-.Dq Li pc98 ,
+.Dq Li arm64 ,
 .Nm
 will search the following paths when considering section 4 manual pages in
 .Pa /usr/share/man :
@@ -222,9 +254,9 @@
 .Pp
 .Bl -item -offset indent -compact
 .It
-.Pa /usr/share/man/man4/pc98
+.Pa /usr/share/man/man4/aarch64
 .It
-.Pa /usr/share/man/man4/i386
+.Pa /usr/share/man/man4/arm64
 .It
 .Pa /usr/share/man/man4
 .El
@@ -264,13 +296,22 @@
 .Fl m
 option.
 .It Ev MANPATH
-Used to find the location of the manual files.
-See
-.Xr manpath 1
-for additional information.
-Corresponds to the
-.Fl M
-option.
+The standard search path used by
+.Xr man 1
+may be changed by specifying a path in the
+.Ev MANPATH
+environment variable.
+Invalid paths, or paths without manual databases, are ignored.
+Overridden by
+.Fl M .
+If
+.Ev MANPATH
+begins with a colon, it is appended to the default list;
+if it ends with a colon, it is prepended to the default list;
+or if it contains two adjacent colons,
+the standard search path is inserted between the colons.
+If none of these conditions are met, it overrides the
+standard search path.
 .It Ev MANROFFSEQ
 Used to determine the preprocessors for the manual source before running
 .Xr nroff 1
@@ -315,6 +356,8 @@
 .It Pa /usr/local/etc/man.d/*.conf
 Local configuration files.
 .El
+.Sh EXIT STATUS
+.Ex -std
 .Sh SEE ALSO
 .Xr apropos 1 ,
 .Xr intro 1 ,
@@ -323,4 +366,12 @@
 .Xr nroff 1 ,
 .Xr troff 1 ,
 .Xr whatis 1 ,
-.Xr man.conf 5
+.Xr intro 2 ,
+.Xr intro 3 ,
+.Xr intro 4 ,
+.Xr intro 5 ,
+.Xr man.conf 5 ,
+.Xr intro 6 ,
+.Xr intro 7 ,
+.Xr intro 8 ,
+.Xr intro 9


Property changes on: trunk/usr.bin/man/man.1
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.bin/man/man.conf.5
===================================================================
--- trunk/usr.bin/man/man.conf.5	2018-01-19 04:37:57 UTC (rev 9737)
+++ trunk/usr.bin/man/man.conf.5	2018-01-19 05:03:06 UTC (rev 9738)
@@ -23,11 +23,12 @@
 .\"  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\"  SUCH DAMAGE.
 .\"
+.\" $FreeBSD: head/usr.bin/man/man.conf.5 236508 2012-06-03 11:09:51Z joel $
 .\" $MidnightBSD$
 .\"
 .Dd June 3, 2011
+.Dt MAN.CONF 5
 .Os
-.Dt MAN.CONF 5
 .Sh NAME
 .Nm man.conf
 .Nd
@@ -57,7 +58,7 @@
 is intended to be used by the local administrator to set additional policy.
 .Pp
 Currently supported configuration variables include:
-.Bl -tag -offset indent
+.Bl -tag -width 12n -offset indent
 .It MANCONFIG
 Overrides the default location to import additional manual configuration files.
 Defaults to
@@ -70,7 +71,8 @@
 .Pp
 For pages in a given language, overriding the default toolset for
 display is supported via the following definitions:
-.Bl -tag -offset indent -compact
+.Pp
+.Bl -tag -width 12n -offset indent -compact
 .It EQN Ns _ Ns Va LANG
 .It NROFF Ns _ Ns Va LANG
 .It PIC Ns _ Ns Va LANG
@@ -87,7 +89,7 @@
 The parser used for this utility is very basic and only supports comment
 characters (#) at the beginning of a line.
 .Sh FILES
-.Bl -tag -compact
+.Bl -tag -width "Pa /usr/local/etc/man.d/*.conf" -compact
 .It Pa /etc/man.conf
 System configuration file.
 .It Pa /usr/local/etc/man.d/*.conf


Property changes on: trunk/usr.bin/man/man.conf.5
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.bin/man/man.sh
===================================================================
--- trunk/usr.bin/man/man.sh	2018-01-19 04:37:57 UTC (rev 9737)
+++ trunk/usr.bin/man/man.sh	2018-01-19 05:03:06 UTC (rev 9738)
@@ -1,5 +1,7 @@
 #! /bin/sh
 #
+# SPDX-License-Identifier: BSD-2-Clause-FreeBSD
+#
 #  Copyright (c) 2010 Gordon Tetlow
 #  All rights reserved.
 #
@@ -24,6 +26,7 @@
 #  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 #  SUCH DAMAGE.
 #
+# $FreeBSD: head/usr.bin/man/man.sh 326527 2017-12-04 12:51:05Z bapt $
 # $MidnightBSD$
 
 # Usage: add_to_manpath path
@@ -68,9 +71,25 @@
 
 	# If the user has set a manpath, who are we to argue.
 	if [ -n "$MANPATH" ]; then
-		return
+		case "$MANPATH" in
+		*:) PREPEND_MANPATH=${MANPATH} ;;
+		:*) APPEND_MANPATH=${MANPATH} ;;
+		*::*)
+			PREPEND_MANPATH=${MANPATH%%::*}
+			APPEND_MANPATH=${MANPATH#*::}
+			;;
+		*) return ;;
+		esac
 	fi
 
+	if [ -n "$PREPEND_MANPATH" ]; then
+		IFS=:
+		for path in $PREPEND_MANPATH; do
+			add_to_manpath "$path"
+		done
+		unset IFS
+	fi
+
 	search_path
 
 	decho "Adding default manpath entries"
@@ -82,6 +101,13 @@
 
 	parse_configs
 
+	if [ -n "$APPEND_MANPATH" ]; then
+		IFS=:
+		for path in $APPEND_MANPATH; do
+			add_to_manpath "$path"
+		done
+		unset IFS
+	fi
 	# Trim leading colon
 	MANPATH=${manpath#:}
 
@@ -176,7 +202,7 @@
 		catroot="$catroot/$3"
 	fi
 
-	if [ ! -d "$manroot" ]; then
+	if [ ! -d "$manroot" -a ! -d "$catroot" ]; then
 		return 1
 	fi
 	decho "  Searching directory $manroot" 2
@@ -238,10 +264,6 @@
 # Usage: manpath_warnings
 # Display some warnings to stderr.
 manpath_warnings() {
-	if [ -z "$Lflag" -a -n "$MANPATH" ]; then
-		echo "(Warning: MANPATH environment variable set)" >&2
-	fi
-
 	if [ -n "$Lflag" -a -n "$MANLOCALES" ]; then
 		echo "(Warning: MANLOCALES environment variable set)" >&2
 	fi
@@ -255,6 +277,9 @@
 	local IFS line tstr
 
 	unset IFS
+	if [ -n "$catpage" ]; then
+		return 0
+	fi
 
 	# We need to loop to accommodate multiple .so directives.
 	while true
@@ -279,8 +304,7 @@
 # Usage: man_display_page
 # Display either the manpage or catpage depending on the use_cat variable
 man_display_page() {
-	local EQN NROFF PIC TBL TROFF REFER VGRIND
-	local IFS l nroff_dev pipeline preproc_arg tool
+	local IFS pipeline testline
 
 	# We are called with IFS set to colon. This causes really weird
 	# things to happen for the variables that have spaces in them.
@@ -312,6 +336,43 @@
 		return
 	fi
 
+	if [ -n "$use_width" ]; then
+		mandoc_args="-O width=${use_width}"
+	fi
+	testline="mandoc -Tlint -Wunsupp >/dev/null 2>&1"
+	if [ -n "$tflag" ]; then
+		pipeline="mandoc -Tps $mandoc_args"
+	else
+		pipeline="mandoc $mandoc_args | $MANPAGER"
+	fi
+
+	if ! eval "$cattool $manpage | $testline" ;then
+		if which -s groff; then
+			man_display_page_groff
+		else
+			echo "This manpage needs groff(1) to be rendered" >&2
+			echo "First install groff(1): " >&2
+			echo "pkg install groff " >&2
+			ret=1
+		fi
+		return
+	fi
+
+	if [ $debug -gt 0 ]; then
+		decho "Command: $cattool $manpage | $pipeline"
+		ret=0
+	else
+		eval "$cattool $manpage | $pipeline"
+		ret=$?
+	fi
+}
+
+# Usage: man_display_page_groff
+# Display the manpage using groff
+man_display_page_groff() {
+	local EQN NROFF PIC TBL TROFF REFER VGRIND
+	local IFS l nroff_dev pipeline preproc_arg tool
+
 	# So, we really do need to parse the manpage. First, figure out the
 	# device flag (-T) we have to pass to eqn(1) and groff(1). Then,
 	# setup the pipeline of commands based on the user's request.
@@ -369,7 +430,7 @@
 		while getopts 'egprtv' preproc_arg; do
 			case "${preproc_arg}" in
 			e)	pipeline="$pipeline | $EQN" ;;
-			g)	;; # Ignore for compatability.
+			g)	;; # Ignore for compatibility.
 			p)	pipeline="$pipeline | $PIC" ;;
 			r)	pipeline="$pipeline | $REFER" ;;
 			t)	pipeline="$pipeline | $TBL" ;;
@@ -723,24 +784,19 @@
 
 	IFS=:
 	for path in $PATH; do
-		# Do a little special casing since the base manpages
-		# are in /usr/share/man instead of /usr/man or /man.
-		case "$path" in
-		/bin|/usr/bin)	add_to_manpath "/usr/share/man" ;;
-		*)	if add_to_manpath "$path/man"; then
-				:
-			elif add_to_manpath "$path/MAN"; then
-				:
-			else
-				case "$path" in
-				*/bin)	p="${path%/bin}/man"
-					add_to_manpath "$p"
-					;;
-				*)	;;
-				esac
-			fi
-			;;
-		esac
+		if add_to_manpath "$path/man"; then
+			:
+		elif add_to_manpath "$path/MAN"; then
+			:
+		else
+			case "$path" in
+			*/bin)	p="${path%/bin}/share/man"
+				add_to_manpath "$p"
+				p="${path%/bin}/man"
+				add_to_manpath "$p"
+				;;
+			esac
+		fi
 	done
 	unset IFS
 
@@ -893,6 +949,8 @@
 
 # Supported commands
 do_apropos() {
+	[ $(stat -f %i /usr/bin/man) -ne $(stat -f %i /usr/bin/apropos) ] && \
+		exec apropos "$@"
 	search_whatis apropos "$@"
 }
 
@@ -928,6 +986,8 @@
 }
 
 do_whatis() {
+	[ $(stat -f %i /usr/bin/man) -ne $(stat -f %i /usr/bin/whatis) ] && \
+		exec whatis "$@"
 	search_whatis whatis "$@"
 }
 
@@ -946,7 +1006,7 @@
 
 debug=0
 man_default_sections='1:8:2:3:n:4:5:6:7:9:l'
-man_default_path='/usr/share/man:/usr/share/openssl/man:/usr/local/man'
+man_default_path='/usr/share/man:/usr/share/openssl/man:/usr/local/share/man:/usr/local/man'
 cattool='/usr/bin/zcat -f'
 
 config_global='/etc/man.conf'


Property changes on: trunk/usr.bin/man/man.sh
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.bin/man/manpath.1
===================================================================
--- trunk/usr.bin/man/manpath.1	2018-01-19 04:37:57 UTC (rev 9737)
+++ trunk/usr.bin/man/manpath.1	2018-01-19 05:03:06 UTC (rev 9738)
@@ -23,9 +23,10 @@
 .\"  OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 .\"  SUCH DAMAGE.
 .\"
+.\" $FreeBSD: head/usr.bin/man/manpath.1 315142 2017-03-12 10:56:19Z tijl $
 .\" $MidnightBSD$
 .\"
-.Dd September 1, 2010
+.Dd March 11, 2017
 .Dt MANPATH 1
 .Os
 .Sh NAME
@@ -66,15 +67,10 @@
 .Pa pathname/MAN
 .It
 If pathname ends with /bin:
+.Pa pathname/../share/man
+and
 .Pa pathname/../man
 .El
-Note: Special logic exists to make
-.Pa /bin
-and
-.Pa /usr/bin
-look in
-.Pa /usr/share/man
-for manual files.
 .It
 The configuration files listed in the
 .Sx FILES


Property changes on: trunk/usr.bin/man/manpath.1
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property


More information about the Midnightbsd-cvs mailing list