[maemo-developers] Optification breaks package on upgrade from non-optified older version

From: Anderson Lizardo anderson.lizardo at openbossa.org
Date: Fri Oct 16 17:20:01 EEST 2009
Hi Thomas,

On Fri, Oct 16, 2009 at 9:27 AM, Thomas Perl <th.perl at gmail.com> wrote:
> Feel free to test the newer version and rate/comment on the package here:
> http://maemo.org/packages/package_instance/view/fremantle_extras-testing_free_armel/gpodder/2.0+git20091013-thp1/
> The non-optified version from September is already in Extras, and it
> would be nice to get this updated, optified package into Extras before
> sales start to avoid having clueless users think that the app is broken :)

I did a small experiment here with a dummy package that creates a
single directory with a single file in it, and a newer version of it
(0.2) that has a symlink instead of the directory. As expected, dpkg
installed the new version of the package but left the old directory
intact (so the symlink was not installed. Strangely, no warning or
error was shown.

But after putting some lines on debian/preinst to remove the
directories that are being replaced (I used rmdir to ensure that it
didn't accidentally removed files from other packages), the symlink
was installed properly.

So I think you can do a similar thing to your packages (remove the
directories that are being replaced with symlinks on debian/preinst)
but the problem is that you can't know in advance which directories
are being optified. So I like better the suggestion given by someone
else to have maemo-optify add extra lines to debian/*.preinst files
(similar to how debhelper utilities do) to make this "cleanup" before
upgrades, but taking care to not delete files from other packages, as
Andrew pointed out.

Anderson Lizardo
OpenBossa Labs - INdT
Manaus - Brazil
More information about the maemo-developers mailing list