Enhance configure to work with libparted two digit version number

This commit is contained in:
Curtis Gedak 2009-10-06 16:12:54 -06:00
parent 0810792f02
commit f042f21d65
1 changed files with 11 additions and 3 deletions

View File

@ -60,13 +60,21 @@ int main ()
if ( sscanf( "$LIBPARTED_VERSION", "%d.%d.%d", &min_major, &min_minor, &min_micro ) == 3 )
{
/* Check for libparted three digit version number */
if ( sscanf( ped_get_version(), "%d.%d.%d", &major, &minor, &micro ) == 3 )
{
printf( "Found libparted %s\t", ped_get_version() ) ;
return ! ( (major > min_major) ||
((major == min_major) && (minor > min_minor)) ||
((major == min_major) && (minor == min_minor) && (micro >= min_micro)) ) ;
}
return ! ((major > min_major) ||
((major == min_major) && (minor > min_minor)) ||
((major == min_major) && (minor == min_minor) && (micro >= min_micro))) ;
/* Check for two digit libparted version number */
if ( sscanf( ped_get_version(), "%d.%d", &major, &minor ) == 2 )
{
printf( "Found libparted %s\t", ped_get_version() ) ;
return ! ( (major > min_major) ||
((major == min_major) && (minor >= min_minor)) ) ;
}
}