/[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.18 Revision 1.19
1#!/bin/bash 1#!/bin/bash
2# $Header: /var/cvsroot/gentoo-src/build-docbook-catalog/build-docbook-catalog,v 1.18 2012/03/28 19:27:46 vapier Exp $ 2# $Header: /var/cvsroot/gentoo-src/build-docbook-catalog/build-docbook-catalog,v 1.19 2012/03/28 19:34:46 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
59 [[ ${ROOT} != /* ]] && ROOT="${PWD}${ROOT}" 59 [[ ${ROOT} != /* ]] && ROOT="${PWD}${ROOT}"
60 if [[ ${ROOT} != "/" ]] ; then 60 if [[ ${ROOT} != "/" ]] ; then
61 echo "Working on root ${ROOT}" 61 echo "Working on root ${ROOT}"
62 fi 62 fi
63 63
64 if [[ ! -d ${ROOT}${ROOTCONFDIR} ]] ; then
65 mkdir -p "${ROOT}${ROOTCONFDIR}" || error "could not create ${ROOTCONFDIR}"
66 fi
67
68 (
69 # Lock the dir to avoid trashing other runs that might
70 # be running parallel.
71 flock 123 || error "unable to lock ${ROOTCONFDIR}"
72
64 create_catalogs # will exit on error 73 create_catalogs # will exit on error
65 for type in xsl xsl-ns xsl-saxon xsl-xalan; do 74 for type in xsl xsl-ns xsl-saxon xsl-xalan; do
66 populate_xsl ${type} 75 populate_xsl ${type}
67 done 76 done
68 77
79 populate_simple_dtd ${d} 88 populate_simple_dtd ${d}
80 done 89 done
81 populate_entities 90 populate_entities
82 fi 91 fi
83 92
93 ) 123>"${ROOT}${ROOTCONFDIR}/.keep"
94
84 exit 0 95 exit 0
85} 96}
86 97
87# 98#
88# verbose echo -- only echo if called with --verbose 99# verbose echo -- only echo if called with --verbose
139# 150#
140# create the catalogs root and docbook specific 151# create the catalogs root and docbook specific
141# 152#
142create_catalogs() { 153create_catalogs() {
143 local adds 154 local adds
144
145 if [[ ! -d ${ROOT}${ROOTCONFDIR} ]] ; then
146 mkdir -p "${ROOT}${ROOTCONFDIR}" || error "could not create ${ROOTCONFDIR}"
147 fi
148 155
149 if [[ ! -r ${ROOT}${ROOTCATALOG} ]] ; then 156 if [[ ! -r ${ROOT}${ROOTCATALOG} ]] ; then
150 echo "Creating XML Catalog root ${ROOTCATALOG}" 157 echo "Creating XML Catalog root ${ROOTCATALOG}"
151 xmlcatalog --noout --create "${ROOT}${ROOTCATALOG}" 158 xmlcatalog --noout --create "${ROOT}${ROOTCATALOG}"
152 if [[ ! -r ${ROOT}${ROOTCATALOG} ]] ; then 159 if [[ ! -r ${ROOT}${ROOTCATALOG} ]] ; then

Legend:
Removed from v.1.18  
changed lines
  Added in v.1.19

  ViewVC Help
Powered by ViewVC 1.1.20