From ea552a4daf0a4e2a42f2947231d2140deb23015d Mon Sep 17 00:00:00 2001 From: Jens Petersen Date: Tue, 30 Oct 2012 11:00:23 +0900 Subject: [PATCH] add haddock reindexing for %postun also This will slow down removal of ghc-*-devel pkgs but seems no simple way round that and removal is less common than installing anyway. --- ghc-rpm-macros.ghc | 8 ++++++++ ghc-rpm-macros.spec | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ghc-rpm-macros.ghc b/ghc-rpm-macros.ghc index d73ac37..aedf13c 100644 --- a/ghc-rpm-macros.ghc +++ b/ghc-rpm-macros.ghc @@ -224,6 +224,14 @@ fi\ \ %postun -n %{basepkg}-devel\ %ghc_pkg_recache\ +if [ $1 -gt 1 ] ; then\ + if [ -d %{_localstatedir}/lib/rpm-state/ghc/ ]; then\ + touch %{_localstatedir}/lib/rpm-state/ghc/haddock-reindex\ + fi\ +else\ + cd %{ghcdocbasedir}/libraries\ + ./gen_contents_index\ +fi\ \ %posttrans -n %{basepkg}-devel\ if [ -f %{_localstatedir}/lib/rpm-state/ghc/haddock-reindex ]; then\ diff --git a/ghc-rpm-macros.spec b/ghc-rpm-macros.spec index 2bae0ee..6d61ee0 100644 --- a/ghc-rpm-macros.spec +++ b/ghc-rpm-macros.spec @@ -73,8 +73,8 @@ EOF %changelog * Mon Oct 29 2012 Jens Petersen - 0.98-1 -- gen_contents_index is now run once from posttrans (#870694) - http://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Saving_state_between_scriptlets +- gen_contents_index is now run once from posttrans or after removal (#870694) + see http://fedoraproject.org/wiki/Packaging:ScriptletSnippets#Saving_state_between_scriptlets * Thu Oct 25 2012 Jens Petersen - 0.97.3-1 - BR redhat-rpm-config instead of ghc-rpm-macros