[wpkg-users] existing installed software does not get updates from wpkg

Rainer Meier r.meier at wpkg.org
Sun Oct 9 20:50:28 CEST 2011


Hi MI,

On 09.10.2011 18:50, MI wrote:
> I started using wpkg, after I had most software already installed on the machines.
>
> When I create a package, it doesn't seem to be applied, because the check
> condition (for example "uninstall" for "Thunderbird x.y.z") returns true.

Actually you seem to check for a concreate version of Thunderbird. So it looks 
like exactly this version is already installed. Usually there is no point to 
re-install exactly the same software again in such situation unless your package 
applies some modifications or policies too.


> In the package definition, I put revision="%version%-2" (where version = the
> software version, ie 6.0.2 for Thunderbird). However, revision doesn't seem to
> matter.

Revision does not matter for initial installations. Moreover the package 
revision is not necessarily related to the software version you're installing.

However when you apply Thunderbirt 6.0.2 with the package version 6.0.2 it might 
not be installed when the package checks are already true while the package is 
first applied to the host.


> How can I add a new package for existing software, so that the first time the
> package definition is seen, even though the check returns true, it still gets
> re-installed because it was never installed by wpkg before.

There are actually two ways to do it.

Use the precheck-install="neber" attribute in the <package /> node:
<package ... precheck-install="never" />

By default the precheck-install attribute is set to "always" which makes WPKG 
trust the checks whether a package is already installed. This allows to apply 
packages without re-installing huge packages if they are already installed on 
target host - thus allowing smooth integration of new hosts to the WPKG system. 
But as you see you can tell WPKG to ignore this check and execute the install 
commands anyway.


Second option is to add a check which fails no matter whether the software is 
already installed or not. For example check for the existence of 
c:\thunderbird-wpkg.dummy and add an install command to create this file. This 
way WPKG would execute the checks, find that the software is obviously not 
installed and runs the commands.


> On a more general note, is there a good overview somewhere about the logic tests
> done by wpkg to decide if a an install or upgrade cmd will be run? As a new user
> of wpkg, that is the part I find most confusing. A logic chart or something
> would be very helpful.

I don't know about such diagrams - maybe someone could write a document or it's 
somewhere in the wiki...

The most accurate document about WPKG is the XSD files shipped with each 
distribution.

In general WPKG works on package revision only. If the revision of the 
server-side package is newer than the local one, then an upgrade is performed. 
If it's lower, then it performs a downgrade. If the package is removed from the 
profile then it uninstalls.
And of course when a package is new to the host it installs. The logs would also 
have told you that WPKG runs the checks during installation and finds that the 
package is (according to the checks you've defined) already installed and this 
is the reason it does not run the commands again - which in most cases would 
just add overhead.

For example the precheck-* attributes also exist for other command types. In the 
XSD the documentation for the precheck-upgrade check is pretty clear too:

Currently supported values:

always: When a package is upgraded the checks specified will be be executed
before the upgrade takes place. If checks succeed, then the upgrade will not
be performed (WPKG just assumes that the new version is already applied
correctly. Please note that your checks shall verify a specific software
version and not just a generic check which is true for all versions. If your
checks are true for the old version too then WPKG would never perform the
upgrade in this mode.

never (default): When a package is about to be upgraded then WPKG will execute
the upgrade commands in any case without executing the checks first. This is
the recommended behavior. Note: Checks will still be done after package
upgrade to verify whether the upgrade was successful.


Basically when a package is applied to the system WPKG just follows the revision 
attribute changes.


HTH

Rainer



More information about the wpkg-users mailing list