#!/bin/sh if [ ! -f /etc/xml/catalog ]; then xmlcatalog --noout --create /etc/xml/catalog fi newver=${1%-r[0-9]*} oldver=${2%-r[0-9]*} if [ -n "$oldver" ]; then # upgrade xmlcatalog --noout --del \ "file://$docbookdir/xsl-stylesheets-$oldver" \ etc/xml/catalog fi docbookdir=/usr/share/xml/docbook urls=" http://cdn.docbook.org/release/xsl-nons http://docbook.sourceforge.net/release/xsl " for url in $urls; do for rewrite in rewriteSystem rewriteURI; do for version in $newver current; do xmlcatalog --noout --add "$rewrite" \ "$url/$version" \ "file://$docbookdir/xsl-stylesheets-$newver" \ etc/xml/catalog done done done