From owner-svn-doc-head@FreeBSD.ORG Tue Aug 26 21:05:47 2014 Return-Path: Delivered-To: svn-doc-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 6ACBD6DC; Tue, 26 Aug 2014 21:05:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 566863DB0; Tue, 26 Aug 2014 21:05:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id s7QL5lhv015776; Tue, 26 Aug 2014 21:05:47 GMT (envelope-from gjb@FreeBSD.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id s7QL5lu7015774; Tue, 26 Aug 2014 21:05:47 GMT (envelope-from gjb@FreeBSD.org) Message-Id: <201408262105.s7QL5lu7015774@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: gjb set sender to gjb@FreeBSD.org using -f From: Glen Barber Date: Tue, 26 Aug 2014 21:05:47 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r45523 - head/share/examples X-SVN-Group: doc-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the doc tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Aug 2014 21:05:47 -0000 Author: gjb Date: Tue Aug 26 21:05:46 2014 New Revision: 45523 URL: http://svnweb.freebsd.org/changeset/doc/45523 Log: Add the script I used to find manual pages missing from head/share/xml/man-refs.ent. Sponsored by: The FreeBSD Foundation Added: head/share/examples/missing-manrefs.sh (contents, props changed) Added: head/share/examples/missing-manrefs.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/examples/missing-manrefs.sh Tue Aug 26 21:05:46 2014 (r45523) @@ -0,0 +1,94 @@ +#!/bin/sh +#- +# 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. +# +# $FreeBSD$ +# + +# Creates an output directory and an obj/ directory, +# builds the manual pages from the specified src/ tree, +# installs to the output directory, and checks the results +# against man-refs.ent. +# + +PATH="/usr/bin:/bin:/usr/local/bin:/usr/sbin:/sbin" +export PATH + +docs=${1} +srcs=${2} +sects=$(seq 1 9) + +usage() { + echo "Usage:" + echo "${0} " + exit 1 +} + +if [ -z "${docs}" -o -z "${srcs}" ]; then + usage +fi + +outdir=$(mktemp -d /tmp/manrefresh.outdir.XXXXXX) +objdir=$(mktemp -d /tmp/manrefresh.objdir.XXXXXX) + +build_manpages() { + MAKEOBJDIRPREFIX=${objdir} + export MAKEOBJDIRPREFIX + make -s -C ${srcs} DESTDIR=${outdir} \ + SRCCONF=/dev/null __MAKE_CONF=/dev/null \ + MANOWN=$USER MANGRP=$USER MANMODE=0666 \ + NO_MLINKS=1 obj hier all-man maninstall +} + +build_cleanup() { + make -s -C ${srcs} DESTDIR=${outdir} \ + SRCCONF=/dev/null __MAKE_CONF=/dev/null \ + NO_MLINKS=1 cleandir +} + +add_manref() { + _man=${_m} + _man=$(echo ${_man} | sed -e 's/\./_/g') + _man=${_man%%_[0-9]} + _sec=${_man##*_} + yes | sh ${docs}/share/examples/add-manref.sh \ + ${docs}/share/xml/man-refs.ent ${_man} ${_sec} +} + +main() { + build_manpages + for sect in ${sects}; do + cd ${outdir}/usr/share/man/man${sect} + for _m in $(find . -mindepth 1 -maxdepth 1 -type f | sort); do + _m=${_m%%\.gz} + _m=$(echo ${_m} | sed -e 's,\./,,') + _m=$(echo ${_m} | sed -e 's/_/./g') + grep -q "man.${_m}" \ + ${docs}/share/xml/man-refs.ent \ + || add_manref ${_m} + done + done + build_cleanup + rm -vr ${outdir} ${objdir} +} + +main "$@"