pct / tunnelblick

Automatically exported from code.google.com/p/tunnelblick
0 stars 0 forks source link

Inconsistent version format reported from system profiler between different versions of tunnelblick #155

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
NOTE: We suggest that you post on the Tunnelblick Discussion Group before
submitting an "Issue". (http://groups.google.com/group/tunnelblick-discuss)

I've been working on a system software inventory system for mac os x, and 
tunnelblick is one of our important, monitored applications.

What steps will reproduce the problem?
1. Run system profiler on different macs with different versions of Tunnelblick
2. system profiler reports back significantly different  version strings for 
different versions, for example, on different versions of tunnelblick, we have 
seen strings such as:

3.0b24
3.0_build_1437
Tunnelblock_3.0b21

This makes comparisons between versions quite difficult.

What is the expected output? A consistent version format.

What do you see instead? At least three different formats.

What version of Tunnelblick are you using? On what version of OS X?

Tunnelblick:
3.0b24
3.0_build_1437
Tunnelblock_3.0b21

Mac OS 10.6.4

Please provide any additional information below. Please include your
configuration file and the contents of the OpenVPN Log window (including
the first few lines with version information), but remember to remove any
sensitive information such as IP addresses.

It's not really a problem with the day-to-day operation of Tunnelblick, it 
works just fine.

In this case the following value in the 
/applications/Tunnelblick.app/Contents/Info.plist file is what the System 
Profiler utility seems to be reading:

<key>CFBundleShortVersionString</key>
<string>3.0 (build 1437)</string>

Anyways, this string makes it a little hard to do version comparisons. 
Something like 3.0build1437 might be better.  Even better might be version 3.0, 
or 3.01 if changes were made.  But even that is not so much of a big deal.  The 
real problem is that one time it is 3.0_build_1437, another time it is 
Tunnelblick_3.0b10 and yet another time it is 3.0b24.  This makes trying to 
track which version is the newest quite difficult.

Thanks!

Original issue reported on code.google.com by greg.ver...@gmail.com on 15 Jul 2010 at 8:17

GoogleCodeExporter commented 9 years ago
Until r371, which is incorporated in Tunnelblick versions 3.0b26 and above, 
Tunnelblick used (as described in the bug report) several formats for its 
Info.plist "CFBundleShortVersionString" key, which is apparently the key 
reported by System Profiler.

Since r371, Tunnelblick has consistently used the following scheme:

CFBundleShortVersionString is a string containing the "marketing" version: for 
example, "3.0b26 (build 1395)". 

CFBundleVersion is a string containing the build number, for example, "1395".

Starting with version 3.1, beta versions are more clearly identified in the 
marketing string; for example, "3.1beta04 (build 1745)".

Depending on your purpose, you would use one or the other:

* If you want something human-readable to display, use 
CFBundleShortVersionString

* If you want to compare versions, use CFBundleVersion. Or strip everything to 
the left of and including "(build " in CFBundleShortVersionString.

Background:

Version information in a Cocoa application is contained in the 
.app/Contents/Info.plist file. Apple has specified meanings for the keys in the 
file. The two keys that are used are 

CFBundleShortVersionString - a localizable "marketing" version.

CFBundleVersion - this is supposed to be limited to digits and decimal points 
so it can be parsed. It is the key used by the system to determine the latest 
version of an application. My understanding is that many applications violate 
this by including a "b" to indicate beta versions.

The problem with CFBundleShortVersionString (and the pre-r371 use of 
CFBundleVersion) is that the human-readable string, even if consistent, is not 
ordered properly: "3.0" comes before "3.0b20", which is not correct -- 3.0b20 
is really "beta 20 for version 3.0", and 3.0 is the later (released) version.

There is a long thread on the Apple Discussion Board about version info, 
located at
http://lists.apple.com/archives/carbon-development/2004/Jun/msg00816.html

I have marked this as "Fixed", because -- since r371 and going forward -- it is 
consistent. Unfortunately, we can't change the past versions!

Original comment by jkbull...@gmail.com on 15 Jul 2010 at 12:35