[wpkg-users] value have underscores?

Rainer Meier r.meier at wpkg.org
Tue May 15 12:10:08 CEST 2012


Hi Paul,

On 15.05.2012 10:40, Paul McGrath wrote:
> So far I have just used ‘.’ (dots, full stops, periods!) to denote version
> variables. Is it possible to use ‘_’ (underscores) e.g.
>
> <variable name="version" value="11_1_102_55"/>
>
> If the version is incremented then will upgrade work based on a value containing
> ‘_’?

I've done a quick test and in this case it works. Quickly tested your version 
number and then upgraded to 11_1_102_56:


2012-05-15 12:03:07, DEBUG   : Comparing version: '11_1_102_56' <=> '11_1_102_55'.
2012-05-15 12:03:07, DEBUG   : Comparing version fragments: '11' <=> '11'
2012-05-15 12:03:07, DEBUG   : Comparing version fragments: '1' <=> '1'
2012-05-15 12:03:07, DEBUG   : Comparing version fragments: '102' <=> '102'
2012-05-15 12:03:07, DEBUG   : Comparing version fragments: '56' <=> '55'
2012-05-15 12:03:07, INFO    : Package 'Testing package' (test): Already 
installed but version mismatch.|Installed revision: '11_1_102_55'|Available 
revision: '11_1_102_56'.|Preparing upgrade.


Although I still recommend to use standard "dotted" notation as the above one 
works only because WPKG splits each part of the version number by non-numeric 
characters. So therefore 11_1_102_55 is not interpreted as "11.1.102.55" but as 
the expression 11_1_102_55 which is split into distinct numbers and then 
compared piece by piece.

But as said, in your case it works perfectly as long as you just use digits 
split by non-digit characters. Seamlessly 11v1v102v55 would work too.

br,
Rainer



More information about the wpkg-users mailing list