Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 15 Jun 2013 12:08:46 GMT
From:      Doug Barton <dougb@dougbarton.us>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   misc/179570: New version of /etc/periodic/weekly/330.catman
Message-ID:  <201306151208.r5FC8kFm053489@oldred.freebsd.org>
Resent-Message-ID: <201306151210.r5FCA1eD063110@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         179570
>Category:       misc
>Synopsis:       New version of /etc/periodic/weekly/330.catman
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jun 15 12:10:01 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Doug Barton
>Release:        DNA
>Organization:
AAAG
>Environment:
DNA
>Description:
This is a new version of 330.catman. It simplifies the code quite a bit, and pre-creates the necessary cat directories so that the script will not fail if they do not exist. The latter problem is especially noticeable with Perl ports.

If someone can show the output of 'manpath -qL' when locales are in use, and explain how that output relates to the directories under $MANPATH, it should be fairly simple to replicate the cat directory creation routine for them.
>How-To-Repeat:

>Fix:


Patch attached with submission follows:

#!/bin/sh -
#
# $FreeBSD: release/9.1.0/etc/periodic/weekly/330.catman 208060 2010-05-14 04:53:57Z dougb $
#

# If there is a global system configuration file, suck it in.
#
if [ -r /etc/defaults/periodic.conf ]
then
	. /etc/defaults/periodic.conf
	source_periodic_confs
fi

case "$weekly_catman_enable" in
[Yy][Ee][Ss])
	echo ''
	MANPATH=`/usr/bin/manpath -q`
	if [ -z "${MANPATH}" ]
	then
		echo 'manpath failed to find any MANPATH directories'
		exit 2
	fi

	echo 'Ensuring that necessary cat directories exist'

	oldIFS="$IFS" ; IFS=':'
	for path in ${MANPATH}
	do
		cd "$path" || exit 3
		for m in man*
		do
			install -d -o man -g wheel -m 755 cat${m#man} || exit 3
		done
	done
	IFS="$oldIFS"

	echo 'Reformatting manual pages:'

	# Preformat original, non-localized manpages
	su -fm man /usr/libexec/catman.local -r "$MANPATH" || exit 3

	# Preformat localized manpages
	man_locales=`/usr/bin/manpath -qL`
	for l in $man_locales
	do
		LC_ALL=$l su -fm man /usr/libexec/catman.local -Lr "$MANPATH" ||
		    exit 3
	done ;;
*)	;;
esac

exit 0


>Release-Note:
>Audit-Trail:
>Unformatted:



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