@api.publicApi
def parseChangeSpec(changeSpec, keepExisting=False, updateByDefault=True,
        withFrozenFlavor = False):

    l = changeSpec.split("--")

    if len(l) == 1:
        (troveName, versionStr, flavor) = parseTroveSpec(l[0], False,
            withFrozenFlavor = withFrozenFlavor)

        if troveName[0] == '-':
            return (troveName, (versionStr, flavor), (None, None), False)
        if troveName[0] == '+' or updateByDefault:
            return (troveName, (None, None), (versionStr, flavor),
                    not keepExisting)
        return (troveName, (versionStr, flavor), (None, None), False)

    if len(l) != 2:
        log.error("one -- expected in change spec '%s'", changeSpec)
        raise TroveSpecError(changeSpec, "one -- expected in change spec")

    oldSpec, newSpec = l
    (troveName, oldVersion, oldFlavor) = parseTroveSpec(oldSpec,
        withFrozenFlavor = withFrozenFlavor)

    if newSpec:
        newSpec = troveName + "=" + newSpec
        (troveName, newVersion, newFlavor) = parseTroveSpec(newSpec,
            withFrozenFlavor = withFrozenFlavor)
    else:
        newVersion, newFlavor = None, None

    if (newVersion or (newFlavor is not None)) and \
           not (oldVersion or (oldFlavor is not None)):
        # foo=--1.2
        oldVersion, oldFlavor = None, None

    return (troveName, (oldVersion, oldFlavor), (newVersion, newFlavor), False)
Parse a single change specification, as presented on the command line,
dataset/ETHPy150Open sassoftware/conary/conary/conaryclient/cmdline.py/parseChangeSpec