[Fedora-haskell-list] Revised Haskell Guidelines 2008.08.13
Tom Moertel
tmoertel at gmail.com
Fri Aug 22 14:15:32 UTC 2008
Jens Petersen wrote:
> I don't quite understand %ghc_preinst_script and %ghc_postun_script: why
> do we need them?
Here's the rationale for those bits:
http://www.serpentine.com/blog/2007/02/20/haskell-cabal-now-with-extra-crunchy-rpm-goodness/#comment-20132
Quoting:
Let me point out a wrinkle I encountered when registering
RPM-installed packages with GHC. When upgrading an RPM file that
contains the same Cabal name+version of a package as the
previously installed version (say with only an RPM release being
different), the %pre, %post, %preun, and %postun scripts will all
be asking GHC to register/unregister what it thinks are the same
library. As a result, when the %preun script is called, which
occurs *after* the new package is installed but before the old
package is removed, its unregister script will actually unregister
the newly installed library, leaving the new library unregistered
with GHC.
To test for the problem, take the existing spec file for an
already-installed package, bump its RPM release, rebuild the RPMs,
and then try to upgrade to the new version. After the upgrade, GHC
will no longer know about the package.
To avoid this problem, I’ve worked out the following spec-script
dance...
Cheers,
Tom
More information about the Fedora-haskell-list
mailing list