List Info

Thread: Programmatic manner to determine version?




Programmatic manner to determine version?
country flaguser name
United States
2007-07-19 18:42:58

Hello everyone,

 

I’m working on a build system which encompasses dependencies on OpenLDAP. I’ve done a general of the web with Google, searched the OpenLDAP FAQ, and searched the OpenLDAP mailing lists for how one can determine the version of OpenLDAP software.

 

I understand that there are different version numbers for APIs, software releases, and libraries.

 

However, I’m confused as to how to programmatically determine the version of installed binaries and libraries and then reconcile them with

 

Perhaps this speaks to a lack of experience with the innards of OpenLDAP or some of the build tools, so I am asking here for some insight.

 

All of my examples are on Novell SuSE Linux 9.2, on ia64 architecture, with a build of OpenLDAP 2.3.36. My goal would be to validate that OpenLDAP version 2.3.36 tools and libraries are installed.

 

If one tries to deduce the version of a library you would see this:

  • > cd lib; ls -l libldap*
    • libldap-2.3.so.0 -> libldap-2.3.so.0.2.24
    • libldap-2.3.so.0.2.24
    • libldap.a
    • libldap.la
  • At best, I can confirm this library is from OpenLDAP 2.3.X.
    • Question: Is there anyway to resolve the .X = .36 for this library?
  • Reading libldap.la gives some insight, but nothing more than what I’ve already asserted in the previous sentence.
  • Question: What is the .0.2.24 version suffix? It doesn̵7;t seem to relate to 2.3.36.
  • > objdump -x libldap-2.3.so.0
    • Yeilds a lot of information, but again – nothing seems to relate to 2.3.36.

 

If one tries parse the output of bin/ldapsearch –V or libexec/slapd –V, you can see 2.0.36 – but the output seems to go to the console. I can’t do something like:

  • libexec/slapd -V | head -n 1 | awk '{print $4}'" > /tmp/openldap_version.txt
    • /tmp/openldap_version.txt is blank.
  • Is there an easy way to pipe the output to STDOUT? What am I missing?

 

Aha! I think I found one method: includes/ldap_features.h reveals:

  • ldap_features.h:#define LDAP_VENDOR_VERSION 20336
  • ldap_features.h:#define LDAP_VENDOR_VERSION_PATCH 36

 

Is this the only way?

 

Thanks for any insight anyone can offer.

…230;……R30;……̷0;……           

 

Mark Lavi

Web Producer

SGI

 

mlavisgi.com

tel: 650.933.7707

sgi.com

 

 

01C7CA23.DE3A0940">

 

  Approximate file size 2238 bytes
Re: Programmatic manner to determine version?
country flaguser name
Netherlands
2007-07-20 02:33:28
Mark Lavi skrev, on 20-07-2007 01:42:

[...]

> Is this the only way?

Well, "slapd -V 2>&1 | head -n1 | awk -F "
" '{ print $4 }'" works for 
me. Or isn't this what you meant?

--Tonni

-- 
Tony Earnshaw
Email: tonni at hetnet dot nl

Re: Programmatic manner to determine version?
user name
2007-07-20 05:53:28
On 7/20/07, Tony Earnshaw <tonnihetnet.nl> wrote:
> Mark Lavi skrev, on 20-07-2007 01:42:
>
> [...]
>
> > Is this the only way?
>
> Well, "slapd -V 2>&1 | head -n1 | awk -F
" " '{ print $4 }'" works for
> me. Or isn't this what you meant?

Use something like:
slapd -VV 2>&1|head -n1|awk '{print $4}'

Unless you want a stray slapd running ... (which you may get
with  just -V).

ldapsearch -VV 2>&1|head -n1|awk '{print $5}'

Headers you have, but for libraries ... I'd use my package
management
system (e.g. 'rpm -qf --qf "%n"
/usr/lib64/libldap-2.3.so.0'). You shouldn't have any
software
installed except by your package management system :-P.

Regards,
Buchan

[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )