Lines Matching +full:ascii +full:. +full:r

4 #  All rights reserved.
9 # 1. Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 # 2. Redistributions in binary form must reproduce the above copyright
13 # documentation and/or other materials provided with the distribution.
18 # ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
25 # SUCH DAMAGE.
27 # $FreeBSD: releng/10.3/usr.bin/man/man.sh 278693 2015-02-13 18:45:44Z sbruno $
30 # Adds a variable to manpath while ensuring we don't have duplicates.
31 # Returns true if we were able to add something. False otherwise.
49 # Builds a correct MANLOCALES variable.
51 # If the user has set manlocales, who are we to argue.
65 # Builds a correct MANPATH variable.
69 # If the user has set a manpath, who are we to argue.
92 # Checks to see if a cat glob is available.
107 # see if the catglob is also available and up to date.
137 # Echoes to stderr string prefaced with -- if high enough debuglevel.
145 # Returns true if glob resolves to a real file.
153 # exists or not.
158 if [ "$1" != "$2" -a -r "$2" ]; then
167 # Returns: true if something is matched and found.
168 # Search the given path/section combo for a given page.
184 mann="$manroot/$4.$2*"
186 catn="$catroot/$4.$2*"
189 # This is the behavior as seen by the original man utility.
190 # Let's not change that which doesn't seem broken.
205 # Returns true if file1 is newer than file2 as calculated by mtime.
217 # Parses commandline options for manpath.
232 # Display usage for the manpath(1) utility.
239 # Display some warnings to stderr.
251 # Returns: True if able to resolve the file, false if it ended in tears.
252 # Detects the presence of the .so directive and causes the file to be
253 # redirected to another source file.
259 # We need to loop to accommodate multiple .so directives.
264 .so*) trim "${line#.so}"
266 # Glob and check for the file.
285 # We are called with IFS set to colon. This causes really weird
286 # things to happen for the variables that have spaces in them.
290 # just zcat the catpage and we are done.
315 # So, we really do need to parse the manpage. First, figure out the
316 # device flag (-T) we have to pass to eqn(1) and groff(1). Then,
317 # setup the pipeline of commands based on the user's request.
320 # to properly output for the correct device.
322 *.${man_charset}/*)
324 # previous version of man(1).
326 KOI8-R) nroff_dev="koi8-r" ;;
330 *) nroff_dev="ascii" ;;
337 # then we need to define the locale string.
339 */${man_lang}_${man_country}.${man_charset}/*)
340 NROFF="$NROFF -dlocale=$man_lang.$man_charset"
342 */${man_lang}.${man_charset}/*)
343 NROFF="$NROFF -dlocale=$man_lang.$man_charset"
348 # set of utilities.
372 g) ;; # Ignore for compatibility.
374 r) pipeline="$pipeline | $REFER" ;;
380 # Strip the leading " | " from the resulting pipeline.
402 # Search through the manpaths looking for the given page.
406 # Check to see if it's a file. But only if it has a '/' in
407 # the filename.
409 */*) if [ -f "$1" -a -r "$1" ]; then
429 p=${p%/.} # Rid ourselves of the trailing /.
431 # Check if there is a MACHINE specific manpath.
445 # specific manpath.
458 # Check plain old manpath.
475 # Nothing? Well, we are done then.
484 # Parses commandline options for man.
509 # Check the args for incompatible options.
545 # Setup various trivial but essential variables.
547 # Setup machine and architecture variables.
553 MACHINE_ARCH=$($SYSCTL -n hw.machine_arch)
556 MACHINE=$($SYSCTL -n hw.machine)
562 # Setup manual sections to search.
574 # Set up page width.
602 # Setup necessary locale variables.
606 locpaths='.'
607 man_charset='US-ASCII'
609 # Setup locale information.
619 [a-z][a-z]_[A-Z][A-Z]\.*)
620 lang_cc="${LC_CTYPE%.*}"
623 man_charset="${LC_CTYPE#*.}"
625 locpaths="$locpaths:$man_lang.$man_charset"
627 locpaths="$locpaths:en.$man_charset"
629 locpaths="$locpaths:."
640 # Display usage for the man utility.
644 echo ' [-m arch[:machine]] [-p [eprtv]] [mansect] page [...]'
645 echo ' man -f page [...] -- Emulates whatis(1)'
646 echo ' man -k page [...] -- Emulates apropos(1)'
648 # When exit'ing with -h, it's not an error.
653 # Reads the end-user adjustable config files.
664 # to override config_local.
665 if [ -r "$config_global" ]; then
669 # Glob the list of files to parse.
675 if [ -r "$file" ]; then
684 # Reads the specified config files.
718 # Traverse $PATH looking for manpaths.
727 # are in /usr/share/man instead of /usr/man or /man.
780 if [ -f "$path/$f" -a -r "$path/$f" ]; then
786 if [ -f "$path/$loc/$f" -a -r "$path/$loc/$f" ]; then
810 # Strip leading carriage return.
829 *.bz) cattool='/usr/bin/bzcat' ;;
830 *.bz2) cattool='/usr/bin/bzcat' ;;
831 *.gz) cattool='/usr/bin/zcat' ;;
832 *.lzma) cattool='/usr/bin/lzcat' ;;
833 *.xz) cattool='/usr/bin/xzcat' ;;
841 # Setup pager.
870 # Parse commandline args for whatis and apropos.
886 # Display usage for the whatis/apropos utility.
888 echo "usage: $cmd [-d] keyword [...]"
934 # User's PATH setting decides on the groff-suite to pick up.
952 config_global='/etc/man.conf'
954 # This can be overridden via a setting in /etc/man.conf.
955 config_local='/usr/local/etc/man.d/*.conf'
957 # Set noglobbing for now. I don't want spurious globbing.