wok-next diff docbook-xml/receipt @ rev 21047
Up tazpkg (971), cookutils (1095)
author | Aleksej Bobylev <al.bobylev@gmail.com> |
---|---|
date | Mon Nov 26 21:15:05 2018 +0200 (2018-11-26) |
parents | a20a093a9790 |
children |
line diff
1.1 --- a/docbook-xml/receipt Fri Oct 12 05:04:27 2018 +0300 1.2 +++ b/docbook-xml/receipt Mon Nov 26 21:15:05 2018 +0200 1.3 @@ -260,27 +260,24 @@ 1.4 } 1.5 1.6 post_install() { 1.7 - [ -d "$1/etc/xml/catalog" ] && 1.8 - chroot "$1/" xmlcatalog --noout --del file:///etc/xml/docbook-xml /etc/xml/catalog 1.9 + local F="file:///etc/xml/docbook-xml" 1.10 + local C="/etc/xml/catalog" 1.11 1.12 - chroot "$1/" xmlcatalog --noout --add "delegatePublic" \ 1.13 - "-//OASIS//ENTITIES DocBook XML" \ 1.14 - "file:///etc/xml/docbook-xml" \ 1.15 - "/etc/xml/catalog" 1.16 - chroot "$1/" xmlcatalog --noout --add "delegatePublic" \ 1.17 - "-//OASIS//DTD DocBook XML" \ 1.18 - "file:///etc/xml/docbook-xml" \ 1.19 - "/etc/xml/catalog" 1.20 - chroot "$1/" xmlcatalog --noout --add "delegateSystem" \ 1.21 - "http://www.oasis-open.org/docbook/" \ 1.22 - "file:///etc/xml/docbook-xml" \ 1.23 - "/etc/xml/catalog" 1.24 - chroot "$1/" xmlcatalog --noout --add "delegateURI" \ 1.25 - "http://www.oasis-open.org/docbook/" \ 1.26 - "file:///etc/xml/docbook-xml" \ 1.27 - "/etc/xml/catalog" 1.28 + # Create a /etc/xml/catalog if it absent 1.29 + [ -s "$1/etc/xml/catalog" ] || 1.30 + chroot "$1/" xmlcatalog --noout --create "$C" 1.31 + 1.32 + # Remove the catalog items prior to upgrading 1.33 + chroot "$1/" xmlcatalog --noout --del "$F" "$C" 1.34 + 1.35 + chroot "$1/" xmlcatalog --noout --add "delegatePublic" "-//OASIS//ENTITIES DocBook XML" "$F" "$C" 1.36 + chroot "$1/" xmlcatalog --noout --add "delegatePublic" "-//OASIS//DTD DocBook XML" "$F" "$C" 1.37 + chroot "$1/" xmlcatalog --noout --add "delegateSystem" "http://www.oasis-open.org/docbook/" "$F" "$C" 1.38 + chroot "$1/" xmlcatalog --noout --add "delegateURI" "http://www.oasis-open.org/docbook/" "$F" "$C" 1.39 } 1.40 1.41 +# In most cases xmlcatalog unavailable at this point, use sed instead of: 1.42 +# chroot "$1/" xmlcatalog --noout --del file:///etc/xml/docbook-xml /etc/xml/catalog 1.43 post_remove() { 1.44 - chroot "$1/" xmlcatalog --noout --del file:///etc/xml/docbook-xml /etc/xml/catalog 1.45 + sed -i '/file:\/\/\/etc\/xml\/docbook-xml/d' "$1/etc/xml/catalog" 1.46 }