Hi people,
I was just looking at the bugs of c2hs (I am thinking about adopting it) and noticed bug 366184 [1]. The submitter did a big upgrade and the configuration of libghc6-c2hs-dev failed because ghc-pkg was not available yet because ghc6 was not yet configured. ghc-pkg is an alternative configured in ghc6 postinst script.
My first though was just calling ghc-pkg6 which is available before ghc6 postinst script has run. But this also cause problems because the global package configuration file of ghc6 is not available before ghc6 postinst has run.
Here are the relevant parts of the postinst from ghc6
case "$1" in configure|abort-upgrade|abort-remove|abort-deconfigure) ... update-alternatives \ --install $execdir/ghc ghc $bindir/ghc 600 \ --slave $execdir/ghc-pkg ghc-pkg $bindir/ghc-pkg \ ... if [ ! -e $libdir/package.conf ] then cp $libdir/package.conf.shipped $libdir/package.conf fi ....
What we see is that the ghc-pkg command is only available after ghc6 postinst and more importantly that the global package.conf is only available after the postinst.
So every libghc6-FOO-dev package will have this bug and could cause problem during upgrades.
To solve this we either Pre-Depends on ghc6 so it is configured before we install or we have to change the ghc6 package to support registering packages right after unpacking. Personally I think Pre-Depends is the way to go because we really need ghc6 configured before registering libghc6-FOO-dev. It also is much easier to implement than alternative two.
I would like to hear your opinions.
Greetings Arjan
Arjan Oosting wrote:
To solve this we either Pre-Depends on ghc6
No, that is the wrong solution. Pre-Depends are mainly used in Essential: yes packages; it is wrong in almost all other cases.
This bug seems strange, though. Since libghc6-c2hs-dev depends on ghc6, the latter should be configured when libghc6-c2hs-dev is being (de)configured. I suspect that libghc6-c2hs-dev was not the only package involved in the upgrade, yet the bug logs don't show the whole upgrade; that we are not seeing the whole picture here.
Op di, 16-05-2006 te 22:21 +0300, schreef Antti-Juhani Kaijanaho:
Arjan Oosting wrote:
To solve this we either Pre-Depends on ghc6
No, that is the wrong solution. Pre-Depends are mainly used in Essential: yes packages; it is wrong in almost all other cases.
This bug seems strange, though. Since libghc6-c2hs-dev depends on ghc6, the latter should be configured when libghc6-c2hs-dev is being (de)configured. I suspect that libghc6-c2hs-dev was not the only package involved in the upgrade, yet the bug logs don't show the whole upgrade; that we are not seeing the whole picture here.
Indeed you are right and I am wrong :)
From policy:
Depends
This declares an absolute dependency. A package will not be configured unless all of the packages listed in its Depends field have been correctly configured.
The Depends field should be used if the depended-on package is required for the depending package to provide a significant amount of functionality.
The Depends field should also be used if the postinst, prerm or postrm scripts require the package to be present in order to run. Note, however, that the postrm cannot rely on any non-essential packages to be present during the purge phase.
So indeed the Depends relationship is right and it should NOT be a pre-depends. Sorry for the noise.
Greetings Arjan
debian-haskell@lists.urchin.earth.li