Compare function for package version sorting

def _cmp_version(item1, item2):
    '''
    Compare function for package version sorting
    '''
    vers1 = _LooseVersion(item1)
    vers2 = _LooseVersion(item2)

    if vers1 < vers2:
        return -1
    if vers1 > vers2:
        return 1
    return 0