[wpkg-users] package is run one more time after removal

Rainer Meier r.meier at wpkg.org
Thu Jun 4 17:56:48 CEST 2009


Hi Simon,

simplesi wrote:
> Another possibility, (But a lot more work!) would be to check to see if an
> uninstall parameter exists - if no parameter exists then WPKG could ignore
> the installPackage(serverPackage) line automatically - if an uninstall
> parameter exists then the existing behaviour of trying to update before
> removal could be kept.

Unfortunately I think this would not work as expected. Remember that the
installPackage() method is there to verify the package and its install state. It
is also used to make sure the latest/assigned version of the package is
installed on the client. So the synchronize method uses it to upgrade packages.
Making installPackage() ignoring packages which have no uninstall strings would
prevent any upgrade (upgrades are done by the same method). In general I would
say it's not correct to threat packages differently if they do not have remove
commands. Especially because this would render the upgrade-before-remove feature
useless in case the administrator completely forgot to specify any remove
commands (which is probably one of the most common reasons to use the
upgrade-before-remove feature -> just adding the missing commands, increase
version and remove it from the profile).

More over if you would have uninstall entries and somebody tries to do the same
as you did with an execute=always package then WPKG would still run the install
commands once more (unless appropriate checks are defined). The different states
of a package are a bit complicated and it's difficult to do such a change by
making sure not to break any existing package.

So for the moment an option to disable the upgrade-before-remove functionality
would be sufficient.
So expect that I will add such an option soon. I will let you know when it's
ready. Until then feel free to use your modified wpkg.js ;-)

br,
Rainer



More information about the wpkg-users mailing list