Re: [cmake-developers] Improving OpenSSL version support

2012-01-13 Thread Brad King

On 1/13/2012 10:14 AM, Rolf Eike Beer wrote:

So what do we do now? Completely drop the OPENSSL_VERSION_STRING variable
and just throw it's contents into OPENSSL_VERSION? Makes things easier,
cool ;)


That's fine with me!

Thanks,
-Brad

P.S.  When topics become long with iterative exploration like this I
typically like to rewrite them to a new set of commits that make the
final change with logical steps and explanations.  As long as the tip
of the rewritten topic is identical to the original topic it will merge
cleanly to 'next' again.  Then we can merge the clean version to master
to get the change and leave both the old and new histories in 'next'
for reference.
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] Improving OpenSSL version support

2012-01-13 Thread Rolf Eike Beer
> On 1/13/2012 9:47 AM, Rolf Eike Beer wrote:
>>> On 1/13/2012 9:41 AM, Rolf Eike Beer wrote:
 Status = f ->   this is a released version
 PP = 0x1 ->   a
>>>
>>> That doesn't appear in my version.  I guess they added it later.
>>
>> No, indeed exactly the lines you quoted before. It's just that the patch
>> level is encoded as number in the C constant, but written as letter in
>> the
>> string. Look again:
>
> I meant that the exact lines you quoted with the explanation do not
> appear in my version above the examples where they do in your version.
> Given those lines it is clear how 0x1a becomes z.

Ok, sorry. For reference, here is the whole comment from OpenSSL 1.0.0f:

/* Numeric release version identifier:
 * MNNFFPPS: major minor fix patch status
 * The status nibble has one of the values 0 for development, 1 to e for
betas
 * 1 to 14, and f for release.  The patch level is exactly that.
 * For example:
 * 0.9.3-dev  0x00903000
 * 0.9.3-beta10x00903001
 * 0.9.3-beta2-dev 0x00903002
 * 0.9.3-beta20x00903002 (same as ...beta2-dev)
 * 0.9.3  0x0090300f
 * 0.9.3a 0x0090301f
 * 0.9.4  0x0090400f
 * 1.2.3z 0x102031af
 *
 * For continuity reasons (because 0.9.5 is already out, and is coded
 * 0x00905100), between 0.9.5 and 0.9.6 the coding of the patch level
 * part is slightly different, by setting the highest bit.  This means
 * that 0.9.5a looks like this: 0x0090581f.  At 0.9.6, we can start
 * with 0x0090600S...
 *
 * (Prior to 0.9.3-dev a different scheme was used: 0.9.2b is 0x0922.)
 * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for
 *  major minor fix final patch/beta)
 */

So what do we do now? Completely drop the OPENSSL_VERSION_STRING variable
and just throw it's contents into OPENSSL_VERSION? Makes things easier,
cool ;)

I'll go and squash those things together tonight and push into next.

Eike
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] Improving OpenSSL version support

2012-01-13 Thread Brad King

On 1/13/2012 9:47 AM, Rolf Eike Beer wrote:

On 1/13/2012 9:41 AM, Rolf Eike Beer wrote:

Status = f ->   this is a released version
PP = 0x1 ->   a


That doesn't appear in my version.  I guess they added it later.


No, indeed exactly the lines you quoted before. It's just that the patch
level is encoded as number in the C constant, but written as letter in the
string. Look again:


I meant that the exact lines you quoted with the explanation do not
appear in my version above the examples where they do in your version.
Given those lines it is clear how 0x1a becomes z.

-Brad
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] Improving OpenSSL version support

2012-01-13 Thread Rolf Eike Beer
> On 1/13/2012 9:41 AM, Rolf Eike Beer wrote:
>>> The explanation you give in your new commit on the topic is more
>>> coherent.
>>> Where did you get it that information?
>>
>> The lines above the examples.
>>
>> Status = f ->  this is a released version
>> PP = 0x1 ->  a
>
> That doesn't appear in my version.  I guess they added it later.

No, indeed exactly the lines you quoted before. It's just that the patch
level is encoded as number in the C constant, but written as letter in the
string. Look again:

 * 0.9.3  0x0090300f
PP: 0 -> no letter, S: f -> released version
 * 0.9.3a 0x0090301f
PP: 1 -> a, S: f -> released version
 * 1.2.3z 0x102031af
PP: 0x1a = 26 -> z, S: f -> released version

Eike
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] Improving OpenSSL version support

2012-01-13 Thread Brad King

On 1/13/2012 9:41 AM, Rolf Eike Beer wrote:

The explanation you give in your new commit on the topic is more coherent.
Where did you get it that information?


The lines above the examples.

Status = f ->  this is a released version
PP = 0x1 ->  a


That doesn't appear in my version.  I guess they added it later.

Thanks,
-Brad
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] Improving OpenSSL version support

2012-01-13 Thread Rolf Eike Beer
> On 1/12/2012 5:47 PM, Rolf Eike Beer wrote:
>> But I'm not going to add support for things older than 0.9.6, this
>> stuff is ancient.
>
> Okay, thanks.
>
>>> Also, the examples given in the header are confusing because they
>>> leave out the patch level from the string.  I think the patch level
>>> can be included as a fourth component in our OPENSSL_VERSION var.
>>
>> Hm?
>>   * 0.9.3a 0x0090301f
>>   * 0.9.4  0x0090400f
>>   * 1.2.3z 0x102031af
>
> The format is specified as
>
>MNNFFPPS
>
> where
>
>M  = Major   NN = Minor   FF = Fix  PP = Patch  S  = Status
>
> The example 0x0090301f matches up to that as
>
>M  = 0   NN = 09  FF = 03  PP = 01  S  = f
>
> which should be
>
>0.9.3.1f

Nope, see below.

> The example with "z" in it makes no sense at all given the explanation
> right above it:
>
>   * The status nibble has one of the values 0 for development, 1 to e for
> betas
>   * 1 to 14, and f for release.  The patch level is exactly that.
>
> The explanation you give in your new commit on the topic is more coherent.
> Where did you get it that information?

The lines above the examples.

Status = f -> this is a released version
PP = 0x1 -> a

Eike
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] Improving OpenSSL version support

2012-01-13 Thread Brad King

On 1/12/2012 6:12 PM, Rolf Eike Beer wrote:

the patch level
can be included as a fourth component in our OPENSSL_VERSION var.


Or just put the normal OpenSSL version string in there? It works for
VERSION_LESS and friends. And since FIND_PACKAGE() handles version selection
anyway I don't see what a user should have to do with it anyway.


Yes, I think that is reasonable.  It avoids adding the extra _STRING version
variable, right?

Another approach is to convert the patch level to a fourth integer version
component, which is not good for printing but is good for VERSION_LESS.
Then we would still need the _STRING version for printing though.


I've pushed 2 more changes to that branch. The first one add documentation,
the second one parses the version number only once and puts the result in a
list and uses that elements later on. And it get's rid of some really long
lines.


Nice, thanks.

-Brad
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] Improving OpenSSL version support

2012-01-13 Thread Brad King

On 1/12/2012 5:47 PM, Rolf Eike Beer wrote:

But I'm not going to add support for things older than 0.9.6, this
stuff is ancient.


Okay, thanks.


Also, the examples given in the header are confusing because they
leave out the patch level from the string.  I think the patch level
can be included as a fourth component in our OPENSSL_VERSION var.


Hm?
  * 0.9.3a 0x0090301f
  * 0.9.4  0x0090400f
  * 1.2.3z 0x102031af


The format is specified as

  MNNFFPPS

where

  M  = Major   NN = Minor   FF = Fix  PP = Patch  S  = Status

The example 0x0090301f matches up to that as

  M  = 0   NN = 09  FF = 03  PP = 01  S  = f

which should be

  0.9.3.1f

The example with "z" in it makes no sense at all given the explanation
right above it:

 * The status nibble has one of the values 0 for development, 1 to e for betas
 * 1 to 14, and f for release.  The patch level is exactly that.

The explanation you give in your new commit on the topic is more coherent.
Where did you get it that information?

Thanks,
-Brad
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


Re: [cmake-developers] Improving OpenSSL version support

2012-01-12 Thread Rolf Eike Beer
Am Donnerstag 12 Januar 2012, 16:58:05 schrieben Sie:
> On 1/12/2012 3:42 PM, Rolf Eike Beer wrote:
> > I just pushed the topic "openssl-version" to stage and would like
> > someone to review it. There are 2 patches in it. The first one is an
> > obvious bugfix and makes the version number detection work at all with
> > OpenSSL 1.0.0! Currently the version number shown is "1..", which is
> > fixed by the first patch.
> > 
> > The second one adds an additional variable, OPENSSL_VERSION_STRING, like
> > other modules also have. This variable holds the complete version
> > number, e.g. "1.0.0f".
> 
> The opensslv.h in 1.0.0 documents the version number encoding, and
> it looks like it changed a bit through some versions.  Please add
> comments near the parsing code that explain how it handles this.

Done.

> Also, the examples given in the header are confusing because they
> leave out the patch level from the string.  I think the patch level
> can be included as a fourth component in our OPENSSL_VERSION var.

Or just put the normal OpenSSL version string in there? It works for 
VERSION_LESS and friends. And since FIND_PACKAGE() handles version selection 
anyway I don't see what a user should have to do with it anyway.

I've pushed 2 more changes to that branch. The first one add documentation, 
the second one parses the version number only once and puts the result in a 
list and uses that elements later on. And it get's rid of some really long 
lines.

Eike

signature.asc
Description: This is a digitally signed message part.
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Re: [cmake-developers] Improving OpenSSL version support

2012-01-12 Thread Rolf Eike Beer
Am Donnerstag 12 Januar 2012, 16:58:05 schrieben Sie:
> On 1/12/2012 3:42 PM, Rolf Eike Beer wrote:
> > I just pushed the topic "openssl-version" to stage and would like
> > someone to review it. There are 2 patches in it. The first one is an
> > obvious bugfix and makes the version number detection work at all with
> > OpenSSL 1.0.0! Currently the version number shown is "1..", which is
> > fixed by the first patch.
> > 
> > The second one adds an additional variable, OPENSSL_VERSION_STRING, like
> > other modules also have. This variable holds the complete version
> > number, e.g. "1.0.0f".
> 
> The opensslv.h in 1.0.0 documents the version number encoding, and
> it looks like it changed a bit through some versions.  Please add
> comments near the parsing code that explain how it handles this.

No problem. But I'm not going to add support for things older than 0.9.6, this 
stuff is ancient.

> Also, the examples given in the header are confusing because they
> leave out the patch level from the string.  I think the patch level
> can be included as a fourth component in our OPENSSL_VERSION var.

Hm?
 * 0.9.3a 0x0090301f
 * 0.9.4  0x0090400f
 * 1.2.3z 0x102031af

Eike

signature.asc
Description: This is a digitally signed message part.
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Re: [cmake-developers] Improving OpenSSL version support

2012-01-12 Thread Brad King

On 1/12/2012 3:42 PM, Rolf Eike Beer wrote:

I just pushed the topic "openssl-version" to stage and would like someone to
review it. There are 2 patches in it. The first one is an obvious bugfix and
makes the version number detection work at all with OpenSSL 1.0.0! Currently
the version number shown is "1..", which is fixed by the first patch.

The second one adds an additional variable, OPENSSL_VERSION_STRING, like other
modules also have. This variable holds the complete version number, e.g.
"1.0.0f".


The opensslv.h in 1.0.0 documents the version number encoding, and
it looks like it changed a bit through some versions.  Please add
comments near the parsing code that explain how it handles this.

Also, the examples given in the header are confusing because they
leave out the patch level from the string.  I think the patch level
can be included as a fourth component in our OPENSSL_VERSION var.

Comments?
-Brad
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers


[cmake-developers] Improving OpenSSL version support

2012-01-12 Thread Rolf Eike Beer
Hi,

I just pushed the topic "openssl-version" to stage and would like someone to 
review it. There are 2 patches in it. The first one is an obvious bugfix and 
makes the version number detection work at all with OpenSSL 1.0.0! Currently 
the version number shown is "1..", which is fixed by the first patch.

The second one adds an additional variable, OPENSSL_VERSION_STRING, like other 
modules also have. This variable holds the complete version number, e.g. 
"1.0.0f". As an additional bonus it does not parse this version from the 
header file if we used pkg-config to get the library location, but falls back 
to that if pkg-config was not used.

I've tested this locally for all combinations and it works for me. I would 
like to hear some thought, especially about introducing the new variable. I've 
not touched the old one so the module does not change behavior. If noone 
objects I'll merge this into next at the weekend.

Eike

signature.asc
Description: This is a digitally signed message part.
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers