Comment 7 for bug 714904

Revision history for this message
Stefan Bader (smb) wrote :

I am not completely sure how this should get fixed in the end. Definitely there is something wrong with the postinst script. It looks like the intention there is to check the package version and when updating from a version <= 1.1.0-6 save the files in if-up.d and if-post-down.d as defaults by moving them into if-pre-up.d (or if-down.d) after creating backup files at the target location.

This seems to hit two problems:
1. The postinst tries to decide whether files have to be moved by comparing the value passed as $2 against the version above. However, when installing the first time $2 == "" and that is always considered a lower version number.
2. The package actually provides files in if-pre.up.d _and_ if-up.d (which are different too). So by the time the postinst is executed, any previous version in if-up.d has been replaced by the version in the package anyway. So even if the version check would work, upgrading from an older version would break.

Maybe the way to fix this would be to create backup files at preinst time, then check for those at postinst time and optionally move the backups into their final positions.