def cmp_version(a, b):
    """Compare two version strings (eg 0.0.1.10 > 0.0.1.9)."""
    a = a.split('.')
    b = b.split('.')

    # Compare each individual portion of both version strings
    for va, vb in zip(a, b):
        ret = int(va) - int(vb)
        if ret:
            return ret

    # Fallback to comparing length last
    return len(a) - len(b)