From 5ba7e544769c54089e5d7b3395af56519dcc24766a8ba1390c2bd436574568ab Mon Sep 17 00:00:00 2001 From: Thomas Schraitle Date: Thu, 19 Feb 2015 13:47:22 +0000 Subject: [PATCH] Accepting request 286765 from home:thomas-schraitle:branches:Documentation:Tools Slightly adapted %post and %postun section to fix bsc#918565 OBS-URL: https://build.opensuse.org/request/show/286765 OBS-URL: https://build.opensuse.org/package/show/Documentation:Tools/suse-xsl-stylesheets?expand=0&rev=86 --- suse-xsl-stylesheets.changes | 5 +++++ suse-xsl-stylesheets.spec | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/suse-xsl-stylesheets.changes b/suse-xsl-stylesheets.changes index 9cb2b29..c434578 100644 --- a/suse-xsl-stylesheets.changes +++ b/suse-xsl-stylesheets.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Feb 19 13:38:13 UTC 2015 - toms@opensuse.org + +- Slightly adapted %post and %postun section to fix bsc#918565 + ------------------------------------------------------------------- Thu Sep 25 08:34:11 UTC 2014 - toms@opensuse.org diff --git a/suse-xsl-stylesheets.spec b/suse-xsl-stylesheets.spec index eb1eacb..785ab46 100644 --- a/suse-xsl-stylesheets.spec +++ b/suse-xsl-stylesheets.spec @@ -1,7 +1,7 @@ # # spec file for package suse-xsl-stylesheets # -# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -170,15 +170,16 @@ fi # remove existing entries first - needed for # zypper in, since it does not call postun # delete ... -edit-xml-catalog --group --catalog /etc/xml/suse-catalog.xml \ - --del %{dtdname}-%{dtdversion} -# ... and add it again +if [ "2" = "$1" ]; then + edit-xml-catalog --group --catalog /etc/xml/suse-catalog.xml \ + --del %{dtdname}-%{dtdversion} || true + edit-xml-catalog --group --catalog /etc/xml/suse-catalog.xml \ + --del %{name} || true +fi + +# ... and (re)add it again edit-xml-catalog --group --catalog /etc/xml/suse-catalog.xml \ --add /etc/xml/%{novdoc_catalog} -# delete ... -edit-xml-catalog --group --catalog /etc/xml/suse-catalog.xml \ - --del %{name} -# ... and add it again edit-xml-catalog --group --catalog /etc/xml/suse-catalog.xml \ --add /etc/xml/%{susexsl_catalog} @@ -193,10 +194,9 @@ exit 0 # only run if package is really uninstalled ($1 = 0) and not # in case of an update # -if [ 0 = $1 ]; then +if [ "0" = "$1" ]; then if [ ! -f %{_sysconfdir}/xml/%{novdoc_catalog} -a -x /usr/bin/edit-xml-catalog ] ; then # SGML: novdoc dtd entry - echo "######################## deleting catalog in postun" %{regcat} -r %{_datadir}/sgml/CATALOG.%{dtdname}-%{dtdversion} >/dev/null 2>&1 || true # XML # novdoc dtd entry