[Date Prev][Date Next] [Chronological] [Thread] [Top]

Programmatic manner to determine version?



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’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.

…………………………           

 

Mark Lavi

Web Producer

SGI

 

mlavi@sgi.com

tel: 650.933.7707

sgi.com