/[gentoo-src]/build-docbook-catalog/build-docbook-catalog
Gentoo

Diff of /build-docbook-catalog/build-docbook-catalog

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.15 Revision 1.16
1#!/bin/bash 1#!/bin/bash
2# $Header: /var/cvsroot/gentoo-src/build-docbook-catalog/build-docbook-catalog,v 1.15 2012/03/27 22:54:41 vapier Exp $ 2# $Header: /var/cvsroot/gentoo-src/build-docbook-catalog/build-docbook-catalog,v 1.16 2012/03/28 18:46:29 vapier Exp $
3# 3#
4# build-docbook-catalog: populate /etc/xml/docbook based in 4# build-docbook-catalog: populate /etc/xml/docbook based in
5# installed docbook-xml-dtd versions. 5# installed docbook-xml-dtd versions.
6# 6#
7# Copyright 2004-2012 Gentoo Foundation 7# Copyright 2004-2012 Gentoo Foundation
38# main (called from bottom) 38# main (called from bottom)
39# 39#
40main() { 40main() {
41 local d v opts 41 local d v opts
42 42
43 opts=$(getopt -o hv --long help,verbose -n "$ZERO" -- "$@") || exit 1 43 opts=$(getopt -o hv --long help,verbose -n "${ZERO}" -- "$@") || exit 1
44 eval set -- "$opts" 44 eval set -- "${opts}"
45 while true; do 45 while true; do
46 case "$1" in 46 case $1 in
47 -h|--help) usage ;; 47 -h|--help) usage ;;
48 -v|--verbose) VERBOSE=true ;; 48 -v|--verbose) VERBOSE=true ;;
49 --) break ;; 49 --) break ;;
50 *) usage "options parsing failed on $1!" ;; 50 *) usage "options parsing failed on $1!" ;;
51 esac 51 esac
52 shift 52 shift
53 done 53 done
54 54
55 create_catalogs # will exit on error 55 create_catalogs # will exit on error
56 for type in xsl xsl-ns xsl-saxon xsl-xalan; do 56 for type in xsl xsl-ns xsl-saxon xsl-xalan; do
57 populate_xsl $type 57 populate_xsl ${type}
58 done 58 done
59 59
60 # Clean out old dtds from catalog 60 # Clean out old dtds from catalog
61 verb "Cleaning out old DocBook XML versions from ${CATALOG} and ${ROOTCATALOG}" 61 verb "Cleaning out old DocBook XML versions from ${CATALOG} and ${ROOTCATALOG}"
62 clean_catalog "${DOCBOOKDIR}/xml\(-simple\)*-dtd-[^/\"']*/[^/\"']*" "${CATALOG}" 62 clean_catalog "${DOCBOOKDIR}/xml\(-simple\)*-dtd-[^/\"']*/[^/\"']*" "${CATALOG}"
77 77
78# 78#
79# verbose echo -- only echo if called with --verbose 79# verbose echo -- only echo if called with --verbose
80# 80#
81verb() { 81verb() {
82 $VERBOSE && echo "$*" 82 ${VERBOSE} && echo "$*"
83} 83}
84 84
85# 85#
86# show an error and abort 86# show an error and abort
87# 87#
231 if [[ -z ${dtd_date} ]]; then 231 if [[ -z ${dtd_date} ]]; then
232 verb " Couldn't find RCS date in ${dtd}, ignoring entities" 232 verb " Couldn't find RCS date in ${dtd}, ignoring entities"
233 return 0 233 return 0
234 fi 234 fi
235 verb " RCS datestamp in ${dtd} is ${dtd_date}" 235 verb " RCS datestamp in ${dtd} is ${dtd_date}"
236 dtd_date=$(date -d "$dtd_date" +%s) 236 dtd_date=$(date -d "${dtd_date}" +%s)
237 if [[ -z $LATEST_DTD || $dtd_date -gt $LATEST_DATE ]]; then 237 if [[ ${dtd_date} -gt ${LATEST_DATE:-0} ]] ; then
238 LATEST_DATE=${dtd_date} 238 LATEST_DATE=${dtd_date}
239 LATEST_DTD=${dtd} 239 LATEST_DTD=${dtd}
240 fi 240 fi
241} 241}
242 242

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.20