diff options
Diffstat (limited to 'build-docbook-catalog')
-rwxr-xr-x | build-docbook-catalog | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/build-docbook-catalog b/build-docbook-catalog index 0c8a193..21054fb 100755 --- a/build-docbook-catalog +++ b/build-docbook-catalog @@ -1,5 +1,5 @@ #!/bin/bash -# $Header: /usr/local/src/gentoo/gentoo-src/cvsroot/gentoo-src/build-docbook-catalog/build-docbook-catalog,v 1.18 2012/03/28 19:27:46 vapier Exp $ +# $Header: /usr/local/src/gentoo/gentoo-src/cvsroot/gentoo-src/build-docbook-catalog/build-docbook-catalog,v 1.19 2012/03/28 19:34:46 vapier Exp $ # # build-docbook-catalog: populate /etc/xml/docbook based in # installed docbook-xml-dtd versions. @@ -61,6 +61,15 @@ main() { echo "Working on root ${ROOT}" fi + if [[ ! -d ${ROOT}${ROOTCONFDIR} ]] ; then + mkdir -p "${ROOT}${ROOTCONFDIR}" || error "could not create ${ROOTCONFDIR}" + fi + + ( + # Lock the dir to avoid trashing other runs that might + # be running parallel. + flock 123 || error "unable to lock ${ROOTCONFDIR}" + create_catalogs # will exit on error for type in xsl xsl-ns xsl-saxon xsl-xalan; do populate_xsl ${type} @@ -81,6 +90,8 @@ main() { populate_entities fi + ) 123>"${ROOT}${ROOTCONFDIR}/.keep" + exit 0 } @@ -142,10 +153,6 @@ multi_xmlcatalog_add() { create_catalogs() { local adds - if [[ ! -d ${ROOT}${ROOTCONFDIR} ]] ; then - mkdir -p "${ROOT}${ROOTCONFDIR}" || error "could not create ${ROOTCONFDIR}" - fi - if [[ ! -r ${ROOT}${ROOTCATALOG} ]] ; then echo "Creating XML Catalog root ${ROOTCATALOG}" xmlcatalog --noout --create "${ROOT}${ROOTCATALOG}" |