__all__ += _data.__all__
__all__ += _misc.__all__
-import headers
-headerVersion = ( headers.RSBAC_VERSION_MAJOR ,
- headers.RSBAC_VERSION_MID ,
- headers.RSBAC_VERSION_MINOR )
-
# Note: overwrite the functions with their values
+headerVersion = headerVersion()
libraryVersion = libraryVersion()
-kernelVersion = kernelVersion()
+kernelVersion = kernelVersion()
if ( not 0 <= kernelVersion[ 0 ] < 10
or not 0 <= kernelVersion[ 1 ] < 100
or not 0 <= kernelVersion[ 2 ] < 100 ) : # ok up to 10.100.100 version
print >> sys.stderr , 'Warning: RSBAC kernel version (%s) doesn\'t look right. Wrong librsbac.so?' \
% ( '.'.join( map( str , kernelVersion ) ) )
-if libraryVersion != kernelVersion :
- print >> sys.stderr , 'Warning: RSBAC version mismatch (library: %s, kernel: %s)' \
- % ( '.'.join( map( str , libraryVersion ) ) ,
+if not ( headerVersion == libraryVersion == kernelVersion ) :
+ print >> sys.stderr , 'Warning: RSBAC version mismatch (header: %s, library: %s, kernel: %s)' \
+ % ( '.'.join( map( str , headerVersion ) ) ,
+ '.'.join( map( str , libraryVersion ) ) ,
'.'.join( map( str , kernelVersion ) ) )
-if libraryVersion != headerVersion :
- print >> sys.stderr , 'Warning: RSBAC version mismatch (library: %s, header: %s)' \
- % ( '.'.join( map( str , libraryVersion ) ) ,
- '.'.join( map( str , headerVersion ) ) )
del sys
# Local Variables:
return fun
@export
+def headerVersion() :
+ """Return the RSBAC header version as a 3-tuple.
+
+ """
+ return ( headers.RSBAC_VERSION_MAJOR ,
+ headers.RSBAC_VERSION_MID ,
+ headers.RSBAC_VERSION_MINOR )
+
+@export
def libraryVersion() :
"""Return the RSBAC library version as a 3-tuple.