def compute_version(text):
    """Compute a version number from a version string"""
    version_parts =  text.split(".")
    version = 0
    try:
        if len(version_parts) >= 1:
            version = int(version_parts[0]) * 100 * 100
        if len(version_parts) >= 2:
            version += int(version_parts[1]) * 100
        if len(version_parts) == 3:
            version += int(version_parts[2])
    except:
        version = -1
    return version