Bug#366184: libghc6-c2hs-dev: should pre-depend on ghc6
I can reproduce this problem. I used packages from snapshot.debian.net:
http://snapshot.debian.net/archive/2006/03/27/debian/pool/main/g/ghc6/ghc6_6.4.1-2_i386.deb
http://snapshot.debian.net/archive/2006/03/27/debian/pool/main/g/ghc6/ghc6_6.4.1-2.1_i386.deb
http://snapshot.debian.net/archive/2006/04/17/debian/pool/main/c/c2hs/libghc6-c2hs-dev_0.13.6-4_i386.deb
http://snapshot.debian.net/archive/2006/04/17/debian/pool/main/c/c2hs/libghc6-c2hs-dev_0.13.6-4.1_i386.deb
The first step is downgrading to ghc6_6.4.1-2 and
libghc6-c2hs-dev_0.13.6-4. The latter seems quite broken; I had to
create a symlink
ln -s /usr/lib/libghc6-c2hs-dev /usr/lib/c2hs-0.13.6
to convince it to install. I also got a warning from ghc-pkg ("can't
find GHCi lib c2hs.o"), but it doesn't seem relevant.
Anyhow, once I had those two versions installed, I tried to upgrade:
# dpkg --install ghc6_6.4.1-2.1_i386.deb libghc6-c2hs-dev_0.13.6-4.1_i386.deb
(Reading database ... 102699 files and directories currently installed.)
Preparing to replace ghc6 6.4.1-2 (using ghc6_6.4.1-2.1_i386.deb) ...
Unpacking replacement ghc6 ...
Preparing to replace libghc6-c2hs-dev 0.13.6-4 (using libghc6-c2hs-dev_0.13.6-4.1_i386.deb) ...
/var/lib/dpkg/info/libghc6-c2hs-dev.prerm: line 22: ghc-pkg: command not found
dpkg: warning - old pre-removal script returned error exit status 127
dpkg - trying script from the new package instead ...
/var/lib/dpkg/tmp.ci/prerm: line 25: ghc-pkg: command not found
dpkg: error processing libghc6-c2hs-dev_0.13.6-4.1_i386.deb (--install):
subprocess new pre-removal script returned error exit status 127
/var/lib/dpkg/info/libghc6-c2hs-dev.postinst: line 26: ghc-pkg: command not found
dpkg: error while cleaning up:
subprocess post-installation script returned error exit status 127
Setting up ghc6 (6.4.1-2.1) ...
Errors were encountered while processing:
libghc6-c2hs-dev_0.13.6-4.1_i386.deb
dpkg.log:
2006-07-04 12:54:10 upgrade ghc6 6.4.1-2 6.4.1-2.1
2006-07-04 12:54:10 status half-configured ghc6 6.4.1-2
2006-07-04 12:54:11 status unpacked ghc6 6.4.1-2
2006-07-04 12:54:11 status half-installed ghc6 6.4.1-2
2006-07-04 12:54:14 status half-installed ghc6 6.4.1-2
2006-07-04 12:54:16 status unpacked ghc6 6.4.1-2.1
2006-07-04 12:54:16 status unpacked ghc6 6.4.1-2.1
2006-07-04 12:54:16 upgrade libghc6-c2hs-dev 0.13.6-4 0.13.6-4.1
2006-07-04 12:54:16 status half-configured libghc6-c2hs-dev 0.13.6-4
2006-07-04 12:54:16 status unpacked ghc6 6.4.1-2.1
2006-07-04 12:54:16 status half-configured ghc6 6.4.1-2.1
2006-07-04 12:54:17 status installed ghc6 6.4.1-2.1
This shows that dpkg is happy to deconfigure ghc6 (and leave it
deconfigured) before deconfiguring libghc6-c2hs-dev. My dpkg is
1.13.21. By the way, if I reverse the order of the packages on the dpkg
--install line, it works fine because dpkg deconfigures libghc6-c2hs-dev
first.
So it is currently a problem for a package to assume that a
Depended-upon package will be configured during prerm.
I note that the policy excerpt already cited in this bug is ambiguous:
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.
It isn't clear whether "present" means configured.
Another excerpt from the same section:
A Depends field takes effect _only_ when a package is to be
configured.
It isn't clear whether "configured" means "(de)configured".
Andrew
Reply to: