aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-03-27 22:46:32 +0000
committerMike Frysinger <vapier@gentoo.org>2012-03-27 22:46:32 +0000
commit512615b2d0239e2ba8cff77831a0b44cc6a115b7 (patch)
treeb75d664a6812474c20f953ef0d0ddcbc6f702fc4
parentdrop hardcoded full paths as there is no need for that -- $PATH works just fine (diff)
downloadbuild-docbook-catalog-512615b2d0239e2ba8cff77831a0b44cc6a115b7.tar.gz
build-docbook-catalog-512615b2d0239e2ba8cff77831a0b44cc6a115b7.tar.bz2
build-docbook-catalog-512615b2d0239e2ba8cff77831a0b44cc6a115b7.zip
attempt to create /etc/xml if it does not exist so `rm -rf /etc/xml && build-docbook-catalog` works
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rwxr-xr-xbuild-docbook-catalog11
1 files changed, 8 insertions, 3 deletions
diff --git a/build-docbook-catalog b/build-docbook-catalog
index c0f5f5d..a135062 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.12 2012/03/27 22:44:46 vapier Exp $
+# $Header: /usr/local/src/gentoo/gentoo-src/cvsroot/gentoo-src/build-docbook-catalog/build-docbook-catalog,v 1.13 2012/03/27 22:46:32 vapier Exp $
#
# build-docbook-catalog: populate /etc/xml/docbook based in
# installed docbook-xml-dtd versions.
@@ -9,8 +9,9 @@
# written by Aron Griffis
#
-ROOTCATALOG=/etc/xml/catalog
-CATALOG=/etc/xml/docbook
+ROOTCONFDIR=/etc/xml
+ROOTCATALOG=${ROOTCONFDIR}/catalog
+CATALOG=${ROOTCONFDIR}/docbook
DOCBOOKDIR=/usr/share/sgml/docbook
DTDS=
LATEST_DTD=
@@ -112,6 +113,10 @@ set_dtds() {
# create the catalogs root and docbook specific
#
create_catalogs() {
+ if [[ ! -d ${ROOTCONFDIR} ]] ; then
+ mkdir -p "${ROOTCONFDIR}" || error "could not create ${ROOTCONFDIR}"
+ fi
+
if [[ ! -r ${ROOTCATALOG} ]] ; then
echo "Creating XML Catalog root ${ROOTCATALOG}"
xmlcatalog --noout --create ${ROOTCATALOG}