[wpkg-users] Orphaned packages (patches, settings and service packs)
Rainer Meier
r.meier at wpkg.org
Mon May 4 18:13:07 CEST 2009
Hi Mike,
Mike Moynihan wrote:
> I have several packages that look like this:
>
> <package id="abc" name="abc" priority="105">
> <check ..../>
> <install cmd .... />
> <remove cmd..../>
> </package>
> <package id="abc-sp1" name="abc-sp1" priority="104">
> <check ..../>
> <install cmd .... />
> </package>
> <package id="abc-sp2" name="abc-sp2" priority="103">
> <check ..../>
> <install cmd .... />
> </package>
>
> My question is when I remove package "abc" from a system that has both
> sp1 and sp2 installed, the packages for sp1 and sp2 remain in the client
> wpkg.xml file. The problem is that the removal is based on package "abc".
>
> Once I remove "abc" and it's sp's from the profile, and the wpkg.xml
> from the client is stripped of the primary package "abc", I find that
> every time wpkg.js runs, it checks both sp1 and sp2 packages and reports
> that it can not remove them.
>
> How do I get wpkg.js to remove these orphaned packages?
There are sevaral ways to achieve this. First of all it seems that you failed to
specify some dependencies between these packages ("abc-sp1" and "abc-sp2" depend
on "abc", maybe "abc-sp2" depends only on "abc-sp1" to create a chain... who
knows...). If you would have done so, then uninstalling "abc" would also remove
packages which depend on it (e.g. "abc-sp1" and "abc-sp2").
Now you end up with en uninstalled "abc" package while the "abc-sp1" and
"abc-sp2" packages still exist and WPKG of course tries to remove them while the
remove command of these packages might fail.
As long as "abc-sp1" and/or "abc-sp2" are stil part of the package database on
server side (packages.xml) WPKG will re-try to uninstall them properly on each
run. So you still have the chance to fix your "abc-sp1"/"abc-sp2" package
definitions to correctly uninstall even if "abc" has been removed already. To do
so you might just fix the package definition and increase the revision number.
So WPKG will first do an upgrade (using eventually defined upgrade commands) and
then uninstall it - using the new uninstall commands.
In case we are really talking about a service pack package or similar removing
them might not be required any more. In this case just remove
"abc-sp1"/"abc-sp2" completely from your packages.xml on server side. WPKG will
then try to remove it on client side and even if it fails to do so it will
remove the package from the local package database. This prevents you from
ending up in an endless remove-loop on each reboot.
So as long as you would like to keep a chance to fix your "abc-sp1"/"abc-sp2"
package you keep it within packages.xml and you might fix it as many times as
you like. As soon as you remove it completely WPKG will try once again to remove
it and then remove it anyway from the local wpkg.xml, thus not re-trying to
remove it on next reboot.
br,
Rainer
More information about the wpkg-users
mailing list