def METHOD_NAME(versionstr):
    e = '0'
    v = None
    r = None
    colon_index = versionstr.find(':')
    if colon_index > 0:
        e = str(versionstr[:colon_index])
    dash_index = versionstr.find('-')
    if dash_index > 0:
        tmp = versionstr[colon_index + 1:dash_index]
        if tmp != '':
            v = tmp
        arch_index = versionstr.rfind('.', dash_index)
        if arch_index > 0:
            r = versionstr[dash_index + 1:arch_index]
        else:
            r = versionstr[dash_index + 1:]
    else:
        tmp = versionstr[colon_index + 1:]
        if tmp != '':
            v = tmp
    return (e, v, r)