docbook-xsl sysconf fix
This commit is contained in:
1 parent
468a52716c
commit
3fcaaa8d82
1 file changed
+6
-6
@@ -6,8 +6,8 @@ if [ ! -f /etc/xml/catalog ]; then
|
|||||||
xmlcatalog --noout --create /etc/xml/catalog
|
xmlcatalog --noout --create /etc/xml/catalog
|
||||||
fi
|
fi
|
||||||
|
|
||||||
newver=${1%-r[0-9]*}
|
metadata="/var/lib/ymp/metadata/docbook-xsl.yaml"
|
||||||
oldver=${2%-r[0-9]*}
|
ver=$(grep version $metadata | cut -f2 -d":" | tr -d " ")
|
||||||
|
|
||||||
docbookdir=/usr/share/xml/docbook
|
docbookdir=/usr/share/xml/docbook
|
||||||
urls="
|
urls="
|
||||||
@@ -20,20 +20,20 @@ update_catalog(){
|
|||||||
|
|
||||||
for url in $urls; do
|
for url in $urls; do
|
||||||
for rewrite in rewriteSystem rewriteURI; do
|
for rewrite in rewriteSystem rewriteURI; do
|
||||||
for version in $newver current; do
|
for version in $ver current; do
|
||||||
xmlcatalog --noout --add "$rewrite" \
|
xmlcatalog --noout --add "$rewrite" \
|
||||||
"$url/$version" \
|
"$url/$version" \
|
||||||
"file://$docbookdir/xsl-stylesheets-$newver" \
|
"file://$docbookdir/xsl-stylesheets-$version" \
|
||||||
/etc/xml/catalog
|
/etc/xml/catalog
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
current=$(date +%s -r $docbookdir)
|
current=$(date +%s -r $metadata)
|
||||||
last=$(cat /var/lib/ymp/sysconf/docbook-xsl/update.date)
|
last=$(cat /var/lib/ymp/sysconf/docbook-xsl/update.date)
|
||||||
if [ "$current" != "$last" ] ; then
|
if [ "$current" != "$last" ] ; then
|
||||||
update_catalog
|
update_catalog
|
||||||
date +%s -r $docbookdir > /var/lib/ymp/sysconf/docbook-xsl/update.date
|
date +%s -r $metadata > /var/lib/ymp/sysconf/docbook-xsl/update.date
|
||||||
fi
|
fi
|
||||||
|
|
||||||
Reference in new issue
Block a user