--- trunk/core/include/haskell.sminc 2010/06/30 22:49:24 5500 +++ trunk/core/include/haskell.sminc 2010/06/30 23:02:55 5502 @@ -23,7 +23,7 @@ HASKELL_PNAME="${PNAME}" SPECIAL_VARS="HASKELL_PNAME" -SPECIAL_FUNCTIONS="${SPECIAL_FUNCTIONS} haskell_preinstall haskell_postinstall haskell_preremove" +SPECIAL_FUNCTIONS="${SPECIAL_FUNCTIONS} haskell_preinstall haskell_postinstall haskell_preremove haskell_postremove" haskell_ghc_version() { @@ -136,4 +136,23 @@ # fi # } -export_inherits haskell src_prepare src_compile src_install preinstall postinstall #preremove +# to be on the safe side, fix all broken packages afer a package remove +haskell_postremove() +{ + if [[ -x $(which ghc-pkg) ]] + then + local broken="$(ghc-pkg check --simple-output)" + if [[ ! -z ${broken} ]] + then + echo "fixing broken haskell modules:" + local pkg + for pkg in ${broken} + do + echo " unregister ${pkg} ..." + ghc-pkg unregister ${pkg} + done + fi + fi +} + +export_inherits haskell src_prepare src_compile src_install preinstall postinstall postremove #preremove