Skip to content

Instantly share code, notes, and snippets.

@mkhl
Created July 3, 2010 12:05
Show Gist options
  • Save mkhl/462528 to your computer and use it in GitHub Desktop.
Save mkhl/462528 to your computer and use it in GitHub Desktop.
Register Homebrew-installed DocBook on Mac OS X
#!/bin/bash
# Bail out if anything goes wrong
set -e
# Make sure Homebrew and DocBook are present
which -s brew
docbook="$(brew --prefix docbook)"
test -d "$docbook"
# Make sure the XML catalog is present
test -d /etc/xml || mkdir /etc/xml
test -f /etc/xml/catalog || xmlcatalog --noout --create /etc/xml/catalog
# Register DocBook in the global XML catalog
for catalog in "$docbook"/docbook/{xml,xsl}/*/catalog.xml; do
xmlcatalog --noout --del "file://$catalog" /etc/xml/catalog
xmlcatalog --noout --add "nextCatalog" "" "file://$catalog" /etc/xml/catalog
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment