Comment 1 for bug 676454

Marcin Juszkiewicz (hrw) wrote :

This should be done in the preinst instead. Rationale: update-alternatives is part of dpkg, so doesn't require any Pre-Depends; and a dependency (such as the gcc-arm-linux-gnueabi dependency on gcc-4.5-arm-linux-gnueabi) does not prevent one package from being unpacked before the postinst of another package it depends on has been run. So if you do this in the postinst, you get:

 - gcc-4.5-arm-linux-gnueabi unpacked (enforced by the Conflicts: from gcc-arm-linux-gnueabi)
 - gcc-arm-linux-gnueabi unpacked; overwrites /usr/bin/arm-linux-gnueabi-gcc symlink
 - gcc-4.5-arm-linux-gnueabi configured; u-a remove runs, removing the symlink
 - gcc-arm-linux-gnueabi configured - but the gcc symlink is now missing

Otherwise, this looks ok.